143 |
} |
} |
144 |
} |
} |
145 |
} |
} |
146 |
|
|
147 |
|
// In case scale tuning has been changed, recalculate pitch for |
148 |
|
// all active voices. |
149 |
|
ProcessScaleTuningChange(); |
150 |
|
|
151 |
// reset internal voice counter (just for statistic of active voices) |
// reset internal voice counter (just for statistic of active voices) |
152 |
ActiveVoiceCountTemp = 0; |
ActiveVoiceCountTemp = 0; |
649 |
dmsg(5,("Engine: MIDI CC received\n")); |
dmsg(5,("Engine: MIDI CC received\n")); |
650 |
ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent); |
ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent); |
651 |
break; |
break; |
652 |
|
case Event::type_channel_pressure: |
653 |
|
dmsg(5,("Engine: MIDI Chan. Pressure received\n")); |
654 |
|
ProcessChannelPressure((EngineChannel*)itEvent->pEngineChannel, itEvent); |
655 |
|
break; |
656 |
|
case Event::type_note_pressure: |
657 |
|
dmsg(5,("Engine: MIDI Note Pressure received\n")); |
658 |
|
ProcessPolyphonicKeyPressure((EngineChannel*)itEvent->pEngineChannel, itEvent); |
659 |
|
break; |
660 |
case Event::type_pitchbend: |
case Event::type_pitchbend: |
661 |
dmsg(5,("Engine: Pitchbend received\n")); |
dmsg(5,("Engine: Pitchbend received\n")); |
662 |
ProcessPitchbend(static_cast<AbstractEngineChannel*>(itEvent->pEngineChannel), itEvent); |
ProcessPitchbend(static_cast<AbstractEngineChannel*>(itEvent->pEngineChannel), itEvent); |
1464 |
|
|
1465 |
return -1; |
return -1; |
1466 |
} |
} |
1467 |
|
|
1468 |
|
/** |
1469 |
|
* Checks whether scale tuning setting has been changed since last |
1470 |
|
* time this method was called, if yes, it recalculates the pitch |
1471 |
|
* for all active voices. |
1472 |
|
*/ |
1473 |
|
void ProcessScaleTuningChange() { |
1474 |
|
const bool changed = ScaleTuningChanged.readAndReset(); |
1475 |
|
if (!changed) return; |
1476 |
|
|
1477 |
|
for (int i = 0; i < engineChannels.size(); i++) { |
1478 |
|
EngineChannelBase<V, R, I>* channel = |
1479 |
|
static_cast<EngineChannelBase<V, R, I>*>(engineChannels[i]); |
1480 |
|
channel->OnScaleTuningChanged(); |
1481 |
|
} |
1482 |
|
} |
1483 |
|
|
1484 |
private: |
private: |
1485 |
Pool<V>* pVoicePool; ///< Contains all voices that can be activated. |
Pool<V>* pVoicePool; ///< Contains all voices that can be activated. |