From a3abcdb2e0ac91887c5ef7b4299ab8113994625c Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 23 Jan 2013 23:12:04 +0100 Subject: [PATCH] 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 , 2013-01-20 --- src/tracks/InstrumentTrack.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 4ffe3c22d..e60610c6f 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -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