InstrumentTrack: Add support for more MIDI commands
MIDI commands All Notes Off, All Sound Off and Omni/Mono/Poly mode will now silence all playing notes, as they should. Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
committed by
Tobias Doerffel
parent
174037c31a
commit
9ec7613678
@@ -98,6 +98,16 @@ enum MidiStandardControllers
|
||||
MidiControllerSostenuto = 66,
|
||||
MidiControllerSoftPedal = 67,
|
||||
MidiControllerLegatoFootswitch = 68,
|
||||
// Channel Mode Messages are controllers too...
|
||||
MidiControllerAllSoundOff = 120,
|
||||
MidiControllerResetAllControllers = 121,
|
||||
MidiControllerLocalControl = 122,
|
||||
MidiControllerAllNotesOff = 123,
|
||||
MidiControllerOmniOn = 124,
|
||||
MidiControllerOmniOff = 125,
|
||||
MidiControllerMonoOn = 126,
|
||||
MidiControllerPolyOn = 127,
|
||||
|
||||
};
|
||||
|
||||
const int MidiChannelCount = 16;
|
||||
|
||||
@@ -315,6 +315,17 @@ void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
m_sustainPedalPressed = false;
|
||||
}
|
||||
}
|
||||
if( _me.controllerNumber() == MidiControllerAllSoundOff ||
|
||||
_me.controllerNumber() == MidiControllerAllNotesOff ||
|
||||
_me.controllerNumber() == MidiControllerOmniOn ||
|
||||
_me.controllerNumber() == MidiControllerOmniOff ||
|
||||
_me.controllerNumber() == MidiControllerMonoOn ||
|
||||
_me.controllerNumber() == MidiControllerPolyOn )
|
||||
{
|
||||
silenceAllNotes();
|
||||
}
|
||||
m_instrument->handleMidiEvent( _me, _time );
|
||||
break;
|
||||
|
||||
case MidiProgramChange:
|
||||
m_instrument->handleMidiEvent( _me, _time );
|
||||
|
||||
Reference in New Issue
Block a user