166 |
ActiveVoiceCount = 0; |
ActiveVoiceCount = 0; |
167 |
ActiveVoiceCountMax = 0; |
ActiveVoiceCountMax = 0; |
168 |
GlobalVolume = 1.0; |
GlobalVolume = 1.0; |
169 |
|
CurrentKeyDimension = 0; |
170 |
|
|
171 |
// reset voice stealing parameters |
// reset voice stealing parameters |
172 |
itLastStolenVoice = RTList<Voice>::Iterator(); |
itLastStolenVoice = RTList<Voice>::Iterator(); |
663 |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
664 |
*/ |
*/ |
665 |
void Engine::ProcessNoteOn(Pool<Event>::Iterator& itNoteOnEvent) { |
void Engine::ProcessNoteOn(Pool<Event>::Iterator& itNoteOnEvent) { |
666 |
midi_key_info_t* pKey = &pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key]; |
|
667 |
|
const int key = itNoteOnEvent->Param.Note.Key; |
668 |
|
|
669 |
|
// Change key dimension value if key is in keyswitching area |
670 |
|
if (key >= pInstrument->DimensionKeyRange.low && key <= pInstrument->DimensionKeyRange.high) |
671 |
|
CurrentKeyDimension = ((key - pInstrument->DimensionKeyRange.low) * 128) / |
672 |
|
(pInstrument->DimensionKeyRange.high - pInstrument->DimensionKeyRange.low + 1); |
673 |
|
|
674 |
|
midi_key_info_t* pKey = &pMIDIKeyInfo[key]; |
675 |
|
|
676 |
pKey->KeyPressed = true; // the MIDI key was now pressed down |
pKey->KeyPressed = true; // the MIDI key was now pressed down |
677 |
|
|
745 |
* when there is no free voice |
* when there is no free voice |
746 |
* (optional, default = true) |
* (optional, default = true) |
747 |
* @returns pointer to new voice or NULL if there was no free voice or |
* @returns pointer to new voice or NULL if there was no free voice or |
748 |
* if an error occured while trying to trigger the new voice |
* if the voice wasn't triggered (for example when no region is |
749 |
|
* defined for the given key). |
750 |
*/ |
*/ |
751 |
Pool<Voice>::Iterator Engine::LaunchVoice(Pool<Event>::Iterator& itNoteOnEvent, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
Pool<Voice>::Iterator Engine::LaunchVoice(Pool<Event>::Iterator& itNoteOnEvent, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
752 |
midi_key_info_t* pKey = &pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key]; |
midi_key_info_t* pKey = &pMIDIKeyInfo[itNoteOnEvent->Param.Note.Key]; |
756 |
if (itNewVoice) { |
if (itNewVoice) { |
757 |
// launch the new voice |
// launch the new voice |
758 |
if (itNewVoice->Trigger(itNoteOnEvent, this->Pitch, this->pInstrument, iLayer, ReleaseTriggerVoice, VoiceStealing) < 0) { |
if (itNewVoice->Trigger(itNoteOnEvent, this->Pitch, this->pInstrument, iLayer, ReleaseTriggerVoice, VoiceStealing) < 0) { |
759 |
dmsg(1,("Triggering new voice failed!\n")); |
dmsg(4,("Voice not triggered\n")); |
760 |
pKey->pActiveVoices->free(itNewVoice); |
pKey->pActiveVoices->free(itNewVoice); |
761 |
} |
} |
762 |
else { // on success |
else { // on success |
1184 |
} |
} |
1185 |
|
|
1186 |
String Engine::Version() { |
String Engine::Version() { |
1187 |
String s = "$Revision: 1.21 $"; |
String s = "$Revision: 1.22 $"; |
1188 |
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 |
1189 |
} |
} |
1190 |
|
|