270 |
void CCUnit::SetCCs(ArrayList< ::sfz::CC>& cc) { |
void CCUnit::SetCCs(ArrayList< ::sfz::CC>& cc) { |
271 |
RemoveAllCCs(); |
RemoveAllCCs(); |
272 |
for (int i = 0; i < cc.size(); i++) { |
for (int i = 0; i < cc.size(); i++) { |
273 |
if (cc[i].Influence != 0) AddCC(cc[i].Controller, cc[i].Influence); |
if (cc[i].Influence != 0) { |
274 |
|
short int curve = cc[i].Curve; |
275 |
|
if (curve >= GetCurveCount()) curve = -1; |
276 |
|
AddCC(cc[i].Controller, cc[i].Influence, curve); |
277 |
|
} |
278 |
} |
} |
279 |
} |
} |
280 |
|
|
281 |
|
int CCUnit::GetCurveCount() { |
282 |
|
return pVoice->pRegion->GetInstrument()->curves.size(); |
283 |
|
} |
284 |
|
|
285 |
|
::sfz::Curve* CCUnit::GetCurve(int idx) { |
286 |
|
return &pVoice->pRegion->GetInstrument()->curves[idx]; |
287 |
|
} |
288 |
|
|
289 |
|
|
290 |
EndpointUnit::EndpointUnit(SfzSignalUnitRack* rack): EndpointSignalUnit(rack) { |
EndpointUnit::EndpointUnit(SfzSignalUnitRack* rack): EndpointSignalUnit(rack) { |
323 |
AmpLFOUnit* u = &(GetRack()->suAmpLFO); |
AmpLFOUnit* u = &(GetRack()->suAmpLFO); |
324 |
vol *= u->Active() ? ::sf2::ToRatio((u->GetLevel() * u->pLfoInfo->volume) * 10.0) : 1; |
vol *= u->Active() ? ::sf2::ToRatio((u->GetLevel() * u->pLfoInfo->volume) * 10.0) : 1; |
325 |
|
|
326 |
|
vol *= ::sf2::ToRatio(GetRack()->suVolOnCC.GetLevel() * 10.0); |
327 |
|
|
328 |
return vol; |
return vol; |
329 |
} |
} |
330 |
|
|
401 |
|
|
402 |
SfzSignalUnitRack::SfzSignalUnitRack(Voice* voice) |
SfzSignalUnitRack::SfzSignalUnitRack(Voice* voice) |
403 |
: SignalUnitRack(MaxUnitCount), pVoice(voice), suEndpoint(this), suVolEG(this), suFilEG(this), suPitchEG(this), |
: SignalUnitRack(MaxUnitCount), pVoice(voice), suEndpoint(this), suVolEG(this), suFilEG(this), suPitchEG(this), |
404 |
EGs(maxEgCount), volEGs(maxEgCount), pitchEGs(maxEgCount), |
EGs(maxEgCount), volEGs(maxEgCount), pitchEGs(maxEgCount), suVolOnCC(this), |
405 |
suAmpLFO(this), suPitchLFO(this), suFilLFO(this), |
suAmpLFO(this), suPitchLFO(this), suFilLFO(this), |
406 |
LFOs(maxLfoCount), pitchLFOs(maxLfoCount), filLFOs(maxLfoCount), resLFOs(maxLfoCount), panLFOs(maxLfoCount) |
LFOs(maxLfoCount), pitchLFOs(maxLfoCount), filLFOs(maxLfoCount), resLFOs(maxLfoCount), panLFOs(maxLfoCount) |
407 |
{ |
{ |
408 |
suEndpoint.pVoice = suVolEG.pVoice = suFilEG.pVoice = suPitchEG.pVoice = voice; |
suEndpoint.pVoice = suVolEG.pVoice = suFilEG.pVoice = suPitchEG.pVoice = voice; |
409 |
suAmpLFO.pVoice = suPitchLFO.pVoice = suFilLFO.pVoice = voice; |
suAmpLFO.pVoice = suPitchLFO.pVoice = suFilLFO.pVoice = suVolOnCC.pVoice = voice; |
410 |
suPitchLFO.suDepthCC.pVoice = suPitchLFO.suFadeEG.pVoice = suPitchLFO.suFreqOnCC.pVoice = voice; |
suPitchLFO.suDepthCC.pVoice = suPitchLFO.suFadeEG.pVoice = suPitchLFO.suFreqOnCC.pVoice = voice; |
411 |
suFilLFO.suFadeEG.pVoice = suFilLFO.suFreqOnCC.pVoice = voice; |
suFilLFO.suFadeEG.pVoice = suFilLFO.suFreqOnCC.pVoice = voice; |
412 |
suAmpLFO.suFadeEG.pVoice = suAmpLFO.suFreqOnCC.pVoice = voice; |
suAmpLFO.suFadeEG.pVoice = suAmpLFO.suFreqOnCC.pVoice = voice; |
448 |
|
|
449 |
::sfz::Region* const pRegion = pVoice->pRegion; |
::sfz::Region* const pRegion = pVoice->pRegion; |
450 |
|
|
451 |
|
suVolOnCC.SetCCs(pRegion->volume_oncc); |
452 |
|
|
453 |
for (int i = 0; i < pRegion->eg.size(); i++) { |
for (int i = 0; i < pRegion->eg.size(); i++) { |
454 |
if (pRegion->eg[i].node.size() == 0) continue; |
if (pRegion->eg[i].node.size() == 0) continue; |
455 |
|
|
512 |
|
|
513 |
Units.clear(); |
Units.clear(); |
514 |
|
|
515 |
|
Units.add(&suVolOnCC); |
516 |
|
|
517 |
Units.add(&suVolEG); |
Units.add(&suVolEG); |
518 |
Units.add(&suFilEG); |
Units.add(&suFilEG); |
519 |
Units.add(&suPitchEG); |
Units.add(&suPitchEG); |