43 |
|
|
44 |
finalSynthesisParameters.filterLeft.Reset(); |
finalSynthesisParameters.filterLeft.Reset(); |
45 |
finalSynthesisParameters.filterRight.Reset(); |
finalSynthesisParameters.filterRight.Reset(); |
46 |
|
|
47 |
|
pEq = NULL; |
48 |
|
bEqSupport = false; |
49 |
} |
} |
50 |
|
|
51 |
AbstractVoice::~AbstractVoice() { |
AbstractVoice::~AbstractVoice() { |
52 |
if (pLFO1) delete pLFO1; |
if (pLFO1) delete pLFO1; |
53 |
if (pLFO2) delete pLFO2; |
if (pLFO2) delete pLFO2; |
54 |
if (pLFO3) delete pLFO3; |
if (pLFO3) delete pLFO3; |
55 |
|
|
56 |
|
if(pEq != NULL) delete pEq; |
57 |
|
} |
58 |
|
|
59 |
|
void AbstractVoice::CreateEq() { |
60 |
|
if(!bEqSupport) return; |
61 |
|
if(pEq != NULL) delete pEq; |
62 |
|
pEq = new EqSupport; |
63 |
|
pEq->InitEffect(GetEngine()->pAudioOutputDevice); |
64 |
} |
} |
65 |
|
|
66 |
/** |
/** |
306 |
VCFCutoffCtrl.controller = 0; |
VCFCutoffCtrl.controller = 0; |
307 |
VCFResonanceCtrl.controller = 0; |
VCFResonanceCtrl.controller = 0; |
308 |
} |
} |
309 |
|
|
310 |
|
const bool bEq = |
311 |
|
pSignalUnitRack != NULL && pSignalUnitRack->HasEq() && pEq->HasSupport(); |
312 |
|
|
313 |
|
if (bEq) { |
314 |
|
pEq->GetInChannelLeft()->Clear(); |
315 |
|
pEq->GetInChannelRight()->Clear(); |
316 |
|
pEq->RenderAudio(GetEngine()->pAudioOutputDevice->MaxSamplesPerCycle()); |
317 |
|
} |
318 |
|
|
319 |
return 0; // success |
return 0; // success |
320 |
} |
} |
357 |
(pMidiKeyInfo->ReverbSend || pMidiKeyInfo->ChorusSend); |
(pMidiKeyInfo->ReverbSend || pMidiKeyInfo->ChorusSend); |
358 |
|
|
359 |
const bool bEq = |
const bool bEq = |
360 |
pSignalUnitRack != NULL && pSignalUnitRack->HasEq() && GetEngine()->pEq->HasSupport(); |
pSignalUnitRack != NULL && pSignalUnitRack->HasEq() && pEq->HasSupport(); |
361 |
|
|
362 |
if (bEq) { |
if (bEq) { |
363 |
GetEngine()->pEq->GetInChannelLeft()->Clear(); |
pEq->GetInChannelLeft()->Clear(); |
364 |
GetEngine()->pEq->GetInChannelRight()->Clear(); |
pEq->GetInChannelRight()->Clear(); |
365 |
finalSynthesisParameters.pOutLeft = &GetEngine()->pEq->GetInChannelLeft()->Buffer()[Skip]; |
finalSynthesisParameters.pOutLeft = &pEq->GetInChannelLeft()->Buffer()[Skip]; |
366 |
finalSynthesisParameters.pOutRight = &GetEngine()->pEq->GetInChannelRight()->Buffer()[Skip]; |
finalSynthesisParameters.pOutRight = &pEq->GetInChannelRight()->Buffer()[Skip]; |
367 |
pSignalUnitRack->UpdateEqSettings(GetEngine()->pEq); |
pSignalUnitRack->UpdateEqSettings(pEq); |
368 |
} else if (bVoiceRequiresDedicatedRouting) { |
} else if (bVoiceRequiresDedicatedRouting) { |
369 |
finalSynthesisParameters.pOutLeft = &GetEngine()->pDedicatedVoiceChannelLeft->Buffer()[Skip]; |
finalSynthesisParameters.pOutLeft = &GetEngine()->pDedicatedVoiceChannelLeft->Buffer()[Skip]; |
370 |
finalSynthesisParameters.pOutRight = &GetEngine()->pDedicatedVoiceChannelRight->Buffer()[Skip]; |
finalSynthesisParameters.pOutRight = &GetEngine()->pDedicatedVoiceChannelRight->Buffer()[Skip]; |
587 |
|
|
588 |
if (bVoiceRequiresDedicatedRouting) { |
if (bVoiceRequiresDedicatedRouting) { |
589 |
if (bEq) { |
if (bEq) { |
590 |
GetEngine()->pEq->RenderAudio(Samples); |
pEq->RenderAudio(Samples); |
591 |
GetEngine()->pEq->GetOutChannelLeft()->CopyTo(GetEngine()->pDedicatedVoiceChannelLeft, Samples); |
pEq->GetOutChannelLeft()->CopyTo(GetEngine()->pDedicatedVoiceChannelLeft, Samples); |
592 |
GetEngine()->pEq->GetOutChannelRight()->CopyTo(GetEngine()->pDedicatedVoiceChannelRight, Samples); |
pEq->GetOutChannelRight()->CopyTo(GetEngine()->pDedicatedVoiceChannelRight, Samples); |
593 |
} |
} |
594 |
optional<float> effectSendLevels[2] = { |
optional<float> effectSendLevels[2] = { |
595 |
pMidiKeyInfo->ReverbSend, |
pMidiKeyInfo->ReverbSend, |
597 |
}; |
}; |
598 |
GetEngine()->RouteDedicatedVoiceChannels(pEngineChannel, effectSendLevels, Samples); |
GetEngine()->RouteDedicatedVoiceChannels(pEngineChannel, effectSendLevels, Samples); |
599 |
} else if (bEq) { |
} else if (bEq) { |
600 |
GetEngine()->pEq->RenderAudio(Samples); |
pEq->RenderAudio(Samples); |
601 |
GetEngine()->pEq->GetOutChannelLeft()->CopyTo(pChannel->pChannelLeft, Samples); |
pEq->GetOutChannelLeft()->MixTo(pChannel->pChannelLeft, Samples); |
602 |
GetEngine()->pEq->GetOutChannelRight()->CopyTo(pChannel->pChannelRight, Samples); |
pEq->GetOutChannelRight()->MixTo(pChannel->pChannelRight, Samples); |
603 |
} |
} |
604 |
} |
} |
605 |
|
|