414 |
ActiveVoiceCount = ActiveVoiceCountTemp; |
ActiveVoiceCount = ActiveVoiceCountTemp; |
415 |
if (ActiveVoiceCount > ActiveVoiceCountMax) ActiveVoiceCountMax = ActiveVoiceCount; |
if (ActiveVoiceCount > ActiveVoiceCountMax) ActiveVoiceCountMax = ActiveVoiceCount; |
416 |
|
|
417 |
|
FrameTime += Samples; |
418 |
|
|
419 |
return 0; |
return 0; |
420 |
} |
} |
421 |
|
|
612 |
midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key]; |
midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key]; |
613 |
|
|
614 |
pKey->KeyPressed = true; // the MIDI key was now pressed down |
pKey->KeyPressed = true; // the MIDI key was now pressed down |
615 |
|
pKey->Velocity = itNoteOnEvent->Param.Note.Velocity; |
616 |
|
pKey->NoteOnTime = FrameTime + itNoteOnEvent->FragmentPos(); // will be used to calculate note length |
617 |
|
|
618 |
// cancel release process of voices on this key if needed |
// cancel release process of voices on this key if needed |
619 |
if (pKey->Active && !pEngineChannel->SustainPedal) { |
if (pKey->Active && !pEngineChannel->SustainPedal) { |
669 |
RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents); |
RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents); |
670 |
|
|
671 |
// spawn release triggered voice(s) if needed |
// spawn release triggered voice(s) if needed |
672 |
if (pKey->ReleaseTrigger && itNoteOffEventOnKeyList->Param.Note.Velocity) { |
if (pKey->ReleaseTrigger) { |
673 |
// first, get total amount of required voices (dependant on amount of layers) |
// first, get total amount of required voices (dependant on amount of layers) |
674 |
::gig::Region* pRegion = pEngineChannel->pInstrument->GetRegion(itNoteOffEventOnKeyList->Param.Note.Key); |
::gig::Region* pRegion = pEngineChannel->pInstrument->GetRegion(itNoteOffEventOnKeyList->Param.Note.Key); |
675 |
if (pRegion) { |
if (pRegion) { |
676 |
int voicesRequired = pRegion->Layers; |
int voicesRequired = pRegion->Layers; |
677 |
|
|
678 |
|
// MIDI note-on velocity is used instead of note-off velocity |
679 |
|
itNoteOffEventOnKeyList->Param.Note.Velocity = pKey->Velocity; |
680 |
|
|
681 |
// now launch the required amount of voices |
// now launch the required amount of voices |
682 |
for (int i = 0; i < voicesRequired; i++) |
for (int i = 0; i < voicesRequired; i++) |
683 |
LaunchVoice(pEngineChannel, itNoteOffEventOnKeyList, i, true, false); //FIXME: for the moment we don't perform voice stealing for release triggered samples |
LaunchVoice(pEngineChannel, itNoteOffEventOnKeyList, i, true, false); //FIXME: for the moment we don't perform voice stealing for release triggered samples |
1203 |
} |
} |
1204 |
|
|
1205 |
String Engine::Version() { |
String Engine::Version() { |
1206 |
String s = "$Revision: 1.39 $"; |
String s = "$Revision: 1.40 $"; |
1207 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
1208 |
} |
} |
1209 |
|
|