From a42be43a3aa5e1494267f3ae93d70a37afe48673 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 7 Nov 2021 16:57:57 -0500 Subject: Stop using MIDI messages for selecting presets used by fluidsynth. --- core/qmpmidioutfluid.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/qmpmidioutfluid.cpp') diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp index 2abdc5c..a0586ae 100644 --- a/core/qmpmidioutfluid.cpp +++ b/core/qmpmidioutfluid.cpp @@ -206,6 +206,14 @@ void qmpMidiOutFluid::onMapped(uint8_t, int) void qmpMidiOutFluid::onUnmapped(uint8_t, int) { } + +bool qmpMidiOutFluid::selectPreset(uint8_t ch, uint16_t bank, uint8_t prog) +{ + fluid_synth_set_channel_type(synth, ch, bank == 128 ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC); + fluid_synth_bank_select(synth, ch, bank); + fluid_synth_program_change(synth, ch, prog); + return true; +} std::vector> qmpMidiOutFluid::getBankList() { return bnk; -- cgit v1.2.3