69 |
Voice::RegionInfo Voice::GetRegionInfo() { |
Voice::RegionInfo Voice::GetRegionInfo() { |
70 |
RegionInfo ri; |
RegionInfo ri; |
71 |
ri.UnityNote = pRegion->pitch_keycenter; |
ri.UnityNote = pRegion->pitch_keycenter; |
72 |
ri.FineTune = pRegion->tune; |
ri.FineTune = pRegion->tune + pRegion->transpose * 100; |
73 |
ri.Pan = int(pRegion->pan * 0.63); // convert from -100..100 to -64..63 |
ri.Pan = int(pRegion->pan * 0.63); // convert from -100..100 to -64..63 |
74 |
ri.SampleStartOffset = 0; // TODO: |
ri.SampleStartOffset = 0; // TODO: |
75 |
|
|
501 |
return expf(RgnInfo.ReleaseTriggerDecay * noteLength); |
return expf(RgnInfo.ReleaseTriggerDecay * noteLength); |
502 |
} |
} |
503 |
|
|
504 |
|
void Voice::ProcessGroupEvent(RTList<Event>::Iterator& itEvent) { |
505 |
|
dmsg(4,("Voice %x processGroupEvents event type=%d", this, itEvent->Type)); |
506 |
|
if (itEvent->Type == Event::type_control_change || |
507 |
|
(Type & Voice::type_controller_triggered) || |
508 |
|
itEvent->Param.Note.Key != MIDIKey) { |
509 |
|
dmsg(4,("Voice %x - kill", this)); |
510 |
|
if (pRegion->off_mode == ::sfz::OFF_NORMAL) { |
511 |
|
// turn off the voice by entering release envelope stage |
512 |
|
EnterReleaseStage(); |
513 |
|
} else { |
514 |
|
// kill the voice fast |
515 |
|
pEG1->enterFadeOutStage(); |
516 |
|
} |
517 |
|
} |
518 |
|
} |
519 |
|
|
520 |
}} // namespace LinuxSampler::sfz |
}} // namespace LinuxSampler::sfz |