zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit db3981853d16fe418f755277419bdc6049f34142
parent 4ba256a4ce733e9613d48ec25c95cc68f23d39e5
Author: fundamental <[email protected]>
Date:   Sun, 27 Dec 2009 21:25:13 -0500

Master: removed GetAudioOutSamples

- Removed method, as it is now unused
  (the OutMgr (nio) is now responsible for resampling when needed)

Diffstat:
Msrc/Misc/Master.cpp | 84-------------------------------------------------------------------------------
Msrc/Misc/Master.h | 9---------
2 files changed, 0 insertions(+), 93 deletions(-)

diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp @@ -45,29 +45,16 @@ Master::Master() tmpmixl = new REALTYPE[SOUND_BUFFER_SIZE]; tmpmixr = new REALTYPE[SOUND_BUFFER_SIZE]; - audiooutl = new REALTYPE[SOUND_BUFFER_SIZE]; - audiooutr = new REALTYPE[SOUND_BUFFER_SIZE]; - ksoundbuffersample = -1; //this is only time when this is -1; this means that the GetAudioOutSamples was never called - ksoundbuffersamplelow = 0.0; - oldsamplel = 0.0; - oldsampler = 0.0; shutup = 0; for(int npart = 0; npart < NUM_MIDI_PARTS; npart++) { vuoutpeakpart[npart] = 1e-9; fakepeakpart[npart] = 0; } - for(int i = 0; i < SOUND_BUFFER_SIZE; i++) { - audiooutl[i] = 0.0; - audiooutr[i] = 0.0; - } - for(int npart = 0; npart < NUM_MIDI_PARTS; npart++) part[npart] = new Part(&microtonal, fft, &mutex); - - //Insertion Effects init for(int nefx = 0; nefx < NUM_INS_EFX; nefx++) insefx[nefx] = new EffectMgr(1, &mutex); @@ -462,75 +449,6 @@ void Master::AudioOut(REALTYPE *outl, REALTYPE *outr) dump.inctick(); } -void Master::GetAudioOutSamples(int nsamples, - int samplerate, - REALTYPE *outl, - REALTYPE *outr) -{ - if(ksoundbuffersample == -1) { //first time - AudioOut(&audiooutl[0], &audiooutr[0]); - ksoundbuffersample = 0; - } - - - if(samplerate == SAMPLE_RATE) { //no resample - int ksample = 0; - while(ksample < nsamples) { - outl[ksample] = audiooutl[ksoundbuffersample]; - outr[ksample] = audiooutr[ksoundbuffersample]; - - ksample++; - ksoundbuffersample++; - if(ksoundbuffersample >= SOUND_BUFFER_SIZE) { - AudioOut(&audiooutl[0], &audiooutr[0]); - ksoundbuffersample = 0; - } - } - } - else { //Resample - int ksample = 0; - REALTYPE srinc = SAMPLE_RATE / (REALTYPE)samplerate; - - while(ksample < nsamples) { - if(ksoundbuffersample != 0) { - outl[ksample] = audiooutl[ksoundbuffersample] - * ksoundbuffersamplelow - + audiooutl[ksoundbuffersample - - 1] * (1.0 - ksoundbuffersamplelow); - outr[ksample] = audiooutr[ksoundbuffersample] - * ksoundbuffersamplelow - + audiooutr[ksoundbuffersample - - 1] * (1.0 - ksoundbuffersamplelow); - } - else { - outl[ksample] = audiooutl[ksoundbuffersample] - * ksoundbuffersamplelow - + oldsamplel * (1.0 - ksoundbuffersamplelow); - outr[ksample] = audiooutr[ksoundbuffersample] - * ksoundbuffersamplelow - + oldsampler * (1.0 - ksoundbuffersamplelow); - } - - ksample++; - - ksoundbuffersamplelow += srinc; - if(ksoundbuffersamplelow >= 1.0) { - ksoundbuffersample += (int) floor(ksoundbuffersamplelow); - ksoundbuffersamplelow = ksoundbuffersamplelow - floor( - ksoundbuffersamplelow); - } - - if(ksoundbuffersample >= SOUND_BUFFER_SIZE) { - oldsamplel = audiooutl[SOUND_BUFFER_SIZE - 1]; - oldsampler = audiooutr[SOUND_BUFFER_SIZE - 1]; - AudioOut(&audiooutl[0], &audiooutr[0]); - ksoundbuffersample = 0; - } - } - } -} - - Master::~Master() { for(int npart = 0; npart < NUM_MIDI_PARTS; npart++) @@ -540,8 +458,6 @@ Master::~Master() for(int nefx = 0; nefx < NUM_SYS_EFX; nefx++) delete sysefx[nefx]; - delete [] audiooutl; - delete [] audiooutr; delete [] tmpmixl; delete [] tmpmixr; delete (fft); diff --git a/src/Misc/Master.h b/src/Misc/Master.h @@ -169,16 +169,7 @@ class Master REALTYPE *tmpmixl; REALTYPE *tmpmixr; - int keyshift; - - //Audio Output samples (if it used GetAudioOutSamples - eg. for Jack output; elsewhere is unused) - REALTYPE *audiooutl; - REALTYPE *audiooutr; - - int ksoundbuffersample; //this is used to know if there is need to call AudioOut by GetAudioOutSamples method - REALTYPE ksoundbuffersamplelow; //this is used for resampling (eg. if Jack samplerate!= SAMPLE_RATE) - REALTYPE oldsamplel, oldsampler; //this is used for resampling };