From 26a84837c250c5040296f89c8deefe16eefdeed4 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 14 Jan 2015 22:01:42 +0200 Subject: [PATCH] Switch track imported from MIDI channel 10 to bank 128, patch 0 in SF2 player. (aka. import drum tracks) --- plugins/MidiImport/MidiImport.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index ec3178d85..67e7ba3b4 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -497,6 +497,15 @@ bool MidiImport::readSMF( TrackContainer* tc ) } } + // Set channel 10 to drums as per General MIDI's orders + if( chs[9].hasNotes && chs[9].it_inst && chs[9].isSF2 ) + { + // AFAIK, 128 should be the standard bank for drums in SF2. + // If not, this has to be made configurable. + chs[9].it_inst->childModel( "bank" )->setValue( 128 ); + chs[9].it_inst->childModel( "patch" )->setValue( 0 ); + } + return true; }