@@ -254,7 +254,7 @@ void FluidSynth::setupSound(const PlaybackSetupData& setupData)
254
254
255
255
fluid_synth_activate_key_tuning (m_fluid->synth , 0 , 0 , " standard" , NULL , true );
256
256
257
- m_sequencer. channelAdded (). onReceive ( this , [this ](const midi::channel_t channelIdx, const midi::Program& program) {
257
+ auto setupChannel = [this ](const midi::channel_t channelIdx, const midi::Program& program) {
258
258
fluid_synth_set_interp_method (m_fluid->synth , channelIdx, FLUID_INTERP_DEFAULT);
259
259
fluid_synth_pitch_wheel_sens (m_fluid->synth , channelIdx, 24 );
260
260
fluid_synth_bank_select (m_fluid->synth , channelIdx, program.bank );
@@ -264,9 +264,17 @@ void FluidSynth::setupSound(const PlaybackSetupData& setupData)
264
264
fluid_synth_set_portamento_mode (m_fluid->synth , channelIdx, FLUID_CHANNEL_PORTAMENTO_MODE_EACH_NOTE);
265
265
fluid_synth_set_legato_mode (m_fluid->synth , channelIdx, FLUID_CHANNEL_LEGATO_MODE_RETRIGGER);
266
266
fluid_synth_activate_tuning (m_fluid->synth , channelIdx, 0 , 0 , 0 );
267
- }) ;
267
+ };
268
268
269
+ m_sequencer.channelAdded ().onReceive (this , setupChannel);
269
270
m_sequencer.init (setupData);
271
+
272
+ for (const auto & voice : m_sequencer.channels ().data ()) {
273
+ for (const auto & pair : voice.second ) {
274
+ const ChannelMap::ChannelMapping& channelMapping = pair.second ;
275
+ setupChannel (channelMapping.first , channelMapping.second );
276
+ }
277
+ }
270
278
}
271
279
272
280
void FluidSynth::setupEvents (const mpe::PlaybackData& playbackData)
0 commit comments