492 |
* this audio fragment cycle |
* this audio fragment cycle |
493 |
*/ |
*/ |
494 |
void Engine::RenderActiveVoices(EngineChannel* pEngineChannel, uint Samples) { |
void Engine::RenderActiveVoices(EngineChannel* pEngineChannel, uint Samples) { |
495 |
|
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
496 |
|
|
497 |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
498 |
RTList<uint>::Iterator end = pEngineChannel->pActiveKeys->end(); |
RTList<uint>::Iterator end = pEngineChannel->pActiveKeys->end(); |
499 |
while (iuiKey != end) { // iterate through all active keys |
while (iuiKey != end) { // iterate through all active keys |
622 |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
* @param itNoteOnEvent - key, velocity and time stamp of the event |
623 |
*/ |
*/ |
624 |
void Engine::ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) { |
void Engine::ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) { |
625 |
|
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
626 |
|
|
627 |
const int key = itNoteOnEvent->Param.Note.Key; |
const int key = itNoteOnEvent->Param.Note.Key; |
628 |
|
|
682 |
* @param itNoteOffEvent - key, velocity and time stamp of the event |
* @param itNoteOffEvent - key, velocity and time stamp of the event |
683 |
*/ |
*/ |
684 |
void Engine::ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) { |
void Engine::ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) { |
685 |
midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[itNoteOffEvent->Param.Note.Key]; |
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
686 |
|
|
687 |
|
midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[itNoteOffEvent->Param.Note.Key]; |
688 |
pKey->KeyPressed = false; // the MIDI key was now released |
pKey->KeyPressed = false; // the MIDI key was now released |
689 |
|
|
690 |
// release voices on this key if needed |
// release voices on this key if needed |
1185 |
dmsg(4,("PEDAL DOWN\n")); |
dmsg(4,("PEDAL DOWN\n")); |
1186 |
pEngineChannel->SustainPedal = true; |
pEngineChannel->SustainPedal = true; |
1187 |
|
|
1188 |
|
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
1189 |
|
|
1190 |
// cancel release process of voices if necessary |
// cancel release process of voices if necessary |
1191 |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
1192 |
for (; iuiKey; ++iuiKey) { |
for (; iuiKey; ++iuiKey) { |
1205 |
dmsg(4,("PEDAL UP\n")); |
dmsg(4,("PEDAL UP\n")); |
1206 |
pEngineChannel->SustainPedal = false; |
pEngineChannel->SustainPedal = false; |
1207 |
|
|
1208 |
|
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
1209 |
|
|
1210 |
// release voices if their respective key is not pressed |
// release voices if their respective key is not pressed |
1211 |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
1212 |
for (; iuiKey; ++iuiKey) { |
for (; iuiKey; ++iuiKey) { |
1431 |
} |
} |
1432 |
|
|
1433 |
String Engine::Version() { |
String Engine::Version() { |
1434 |
String s = "$Revision: 1.49 $"; |
String s = "$Revision: 1.50 $"; |
1435 |
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 |
1436 |
} |
} |
1437 |
|
|