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 |
/** |
/** |
348 |
(pMidiKeyInfo->ReverbSend || pMidiKeyInfo->ChorusSend); |
(pMidiKeyInfo->ReverbSend || pMidiKeyInfo->ChorusSend); |
349 |
|
|
350 |
const bool bEq = |
const bool bEq = |
351 |
pSignalUnitRack != NULL && pSignalUnitRack->HasEq() && GetEngine()->pEq->HasSupport(); |
pSignalUnitRack != NULL && pSignalUnitRack->HasEq() && pEq->HasSupport(); |
352 |
|
|
353 |
if (bEq) { |
if (bEq) { |
354 |
GetEngine()->pEq->GetInChannelLeft()->Clear(); |
pEq->GetInChannelLeft()->Clear(); |
355 |
GetEngine()->pEq->GetInChannelRight()->Clear(); |
pEq->GetInChannelRight()->Clear(); |
356 |
finalSynthesisParameters.pOutLeft = &GetEngine()->pEq->GetInChannelLeft()->Buffer()[Skip]; |
finalSynthesisParameters.pOutLeft = &pEq->GetInChannelLeft()->Buffer()[Skip]; |
357 |
finalSynthesisParameters.pOutRight = &GetEngine()->pEq->GetInChannelRight()->Buffer()[Skip]; |
finalSynthesisParameters.pOutRight = &pEq->GetInChannelRight()->Buffer()[Skip]; |
358 |
pSignalUnitRack->UpdateEqSettings(GetEngine()->pEq); |
pSignalUnitRack->UpdateEqSettings(pEq); |
359 |
} else if (bVoiceRequiresDedicatedRouting) { |
} else if (bVoiceRequiresDedicatedRouting) { |
360 |
finalSynthesisParameters.pOutLeft = &GetEngine()->pDedicatedVoiceChannelLeft->Buffer()[Skip]; |
finalSynthesisParameters.pOutLeft = &GetEngine()->pDedicatedVoiceChannelLeft->Buffer()[Skip]; |
361 |
finalSynthesisParameters.pOutRight = &GetEngine()->pDedicatedVoiceChannelRight->Buffer()[Skip]; |
finalSynthesisParameters.pOutRight = &GetEngine()->pDedicatedVoiceChannelRight->Buffer()[Skip]; |
578 |
|
|
579 |
if (bVoiceRequiresDedicatedRouting) { |
if (bVoiceRequiresDedicatedRouting) { |
580 |
if (bEq) { |
if (bEq) { |
581 |
GetEngine()->pEq->RenderAudio(Samples); |
pEq->RenderAudio(Samples); |
582 |
GetEngine()->pEq->GetOutChannelLeft()->CopyTo(GetEngine()->pDedicatedVoiceChannelLeft, Samples); |
pEq->GetOutChannelLeft()->CopyTo(GetEngine()->pDedicatedVoiceChannelLeft, Samples); |
583 |
GetEngine()->pEq->GetOutChannelRight()->CopyTo(GetEngine()->pDedicatedVoiceChannelRight, Samples); |
pEq->GetOutChannelRight()->CopyTo(GetEngine()->pDedicatedVoiceChannelRight, Samples); |
584 |
} |
} |
585 |
optional<float> effectSendLevels[2] = { |
optional<float> effectSendLevels[2] = { |
586 |
pMidiKeyInfo->ReverbSend, |
pMidiKeyInfo->ReverbSend, |
588 |
}; |
}; |
589 |
GetEngine()->RouteDedicatedVoiceChannels(pEngineChannel, effectSendLevels, Samples); |
GetEngine()->RouteDedicatedVoiceChannels(pEngineChannel, effectSendLevels, Samples); |
590 |
} else if (bEq) { |
} else if (bEq) { |
591 |
GetEngine()->pEq->RenderAudio(Samples); |
pEq->RenderAudio(Samples); |
592 |
GetEngine()->pEq->GetOutChannelLeft()->CopyTo(pChannel->pChannelLeft, Samples); |
pEq->GetOutChannelLeft()->MixTo(pChannel->pChannelLeft, Samples); |
593 |
GetEngine()->pEq->GetOutChannelRight()->CopyTo(pChannel->pChannelRight, Samples); |
pEq->GetOutChannelRight()->MixTo(pChannel->pChannelRight, Samples); |
594 |
} |
} |
595 |
} |
} |
596 |
|
|