From f0cd8631d7d8e82444ea6ab7ff5f75dfd4bbdab9 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 15 Mar 2009 21:57:17 +0100 Subject: [PATCH] Sf2Player: properly update patch if panning support is enabled If SF2_PANNING_SUPPORT is set, changed patches were applied to current channel after calling fluid_synth_noteon(...) - some notes still were played with the old patch until m_channel made one round trip. --- plugins/sf2_player/sf2_player.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 2a94b5d65..02483ee2f 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -593,12 +593,14 @@ void sf2Instrument::playNote( notePlayHandle * _n, sampleFrame * ) m_synthMutex.lock(); +#ifdef SF2_PANNING_SUPPORT + updatePatch(); +#endif + fluid_synth_noteon( m_synth, pluginData->midiChannel, midiNote, _n->getMidiVelocity() ); #ifdef SF2_PANNING_SUPPORT - updatePatch(); - if( ++m_channel > m_maxChannels ) { m_channel = 1;