InstrumentTrack: directly forward MIDI events under special circumstances

In the special case that a MIDI event comes from a MIDI port, the
instrument is MIDI based (VST plugin, Sf2Player etc.) and the user did
not set dedicated MIDI output channel, directly forward the MIDI event
to the instrument plugin so properties such as MIDI channels are kept.

Based on patch by nuio <numa_shsk/at/mail/dot/goo/dot/ne/dot/jp>, 2013-01-20
This commit is contained in:
Tobias Doerffel
2013-01-23 23:12:04 +01:00
parent 2327581da7
commit a3abcdb2e0

View File

@@ -221,6 +221,18 @@ void InstrumentTrack::processInEvent( const midiEvent & _me,
const midiTime & _time )
{
engine::getMixer()->lock();
// in the special case this event comes from a MIDI port, the instrument
// is MIDI based (VST plugin, Sf2Player etc.) and the user did not set
// a dedicated MIDI output channel, directly pass the MIDI event to the
// instrument plugin
if( _me.isFromMidiPort() && m_instrument->isMidiBased() &&
midiPort()->realOutputChannel() < 0 )
{
m_instrument->handleMidiEvent( _me, _time );
return;
}
switch( _me.m_type )
{
// we don't send MidiNoteOn, MidiNoteOff and MidiKeyPressure