59 |
pVoicePool->clear(); |
pVoicePool->clear(); |
60 |
|
|
61 |
pSynthesisParameters[0] = NULL; // we allocate when an audio device is connected |
pSynthesisParameters[0] = NULL; // we allocate when an audio device is connected |
62 |
|
pBasicFilterParameters = NULL; |
63 |
|
pMainFilterParameters = NULL; |
64 |
|
|
65 |
ResetInternal(); |
ResetInternal(); |
66 |
} |
} |
87 |
if (pVoicePool) delete pVoicePool; |
if (pVoicePool) delete pVoicePool; |
88 |
if (pActiveKeys) delete pActiveKeys; |
if (pActiveKeys) delete pActiveKeys; |
89 |
if (pEventGenerator) delete pEventGenerator; |
if (pEventGenerator) delete pEventGenerator; |
90 |
|
if (pMainFilterParameters) delete[] pMainFilterParameters; |
91 |
|
if (pBasicFilterParameters) delete[] pBasicFilterParameters; |
92 |
if (pSynthesisParameters[0]) delete[] pSynthesisParameters[0]; |
if (pSynthesisParameters[0]) delete[] pSynthesisParameters[0]; |
93 |
} |
} |
94 |
|
|
293 |
for (int dst = 1; dst < Event::destination_count; dst++) |
for (int dst = 1; dst < Event::destination_count; dst++) |
294 |
pSynthesisParameters[dst] = pSynthesisParameters[dst - 1] + pAudioOut->MaxSamplesPerCycle(); |
pSynthesisParameters[dst] = pSynthesisParameters[dst - 1] + pAudioOut->MaxSamplesPerCycle(); |
295 |
|
|
296 |
|
// (re)allocate biquad filter parameter sequence |
297 |
|
if (pBasicFilterParameters) delete[] pBasicFilterParameters; |
298 |
|
if (pMainFilterParameters) delete[] pMainFilterParameters; |
299 |
|
pBasicFilterParameters = new biquad_param_t[pAudioOut->MaxSamplesPerCycle()]; |
300 |
|
pMainFilterParameters = new biquad_param_t[pAudioOut->MaxSamplesPerCycle()]; |
301 |
|
|
302 |
dmsg(1,("Starting disk thread...")); |
dmsg(1,("Starting disk thread...")); |
303 |
pDiskThread->StartThread(); |
pDiskThread->StartThread(); |
304 |
dmsg(1,("OK\n")); |
dmsg(1,("OK\n")); |
645 |
*/ |
*/ |
646 |
void Engine::ResetSynthesisParameters(Event::destination_t dst, float val) { |
void Engine::ResetSynthesisParameters(Event::destination_t dst, float val) { |
647 |
int maxsamples = pAudioOutputDevice->MaxSamplesPerCycle(); |
int maxsamples = pAudioOutputDevice->MaxSamplesPerCycle(); |
648 |
for (int i = 0; i < maxsamples; i++) pSynthesisParameters[dst][i] = val; |
float* m = &pSynthesisParameters[dst][0]; |
649 |
|
for (int i = 0; i < maxsamples; i += 4) { |
650 |
|
m[i] = val; |
651 |
|
m[i+1] = val; |
652 |
|
m[i+2] = val; |
653 |
|
m[i+3] = val; |
654 |
|
} |
655 |
} |
} |
656 |
|
|
657 |
float Engine::Volume() { |
float Engine::Volume() { |