diff --git a/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.cpp b/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.cpp index 865481d360396..59a31a444ee33 100644 --- a/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.cpp +++ b/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.cpp @@ -130,7 +130,7 @@ void FluidSequencer::updatePlaybackEvents(EventSequenceMap& destination, const m destination[timestampTo].emplace(std::move(noteOff)); - appendControlSwitch(destination, noteEvent, PEDAL_CC_SUPPORTED_TYPES, midi::SUSTAIN_PEDAL_CONTROLLER); + appendControlSwitch(destination, noteEvent, PEDAL_CC_SUPPORTED_TYPES, midi::SUSTAIN_PEDAL_CONTROLLER, channelIdx); appendPitchBend(destination, noteEvent, BEND_SUPPORTED_TYPES, channelIdx); } } @@ -150,7 +150,8 @@ void FluidSequencer::updateDynamicEvents(EventSequenceMap& destination, const mp } void FluidSequencer::appendControlSwitch(EventSequenceMap& destination, const mpe::NoteEvent& noteEvent, - const mpe::ArticulationTypeSet& appliableTypes, const int midiControlIdx) + const mpe::ArticulationTypeSet& appliableTypes, + const int midiControlIdx, const channel_t channelIdx) { mpe::ArticulationType currentType = mpe::ArticulationType::Undefined; @@ -170,12 +171,14 @@ void FluidSequencer::appendControlSwitch(EventSequenceMap& destination, const mp midi::Event start(Event::Opcode::ControlChange, Event::MessageType::ChannelVoice10); start.setIndex(midiControlIdx); + start.setChannel(channelIdx); start.setData(127); destination[noteEvent.arrangementCtx().actualTimestamp].emplace(std::move(start)); midi::Event end(Event::Opcode::ControlChange, Event::MessageType::ChannelVoice10); end.setIndex(midiControlIdx); + end.setChannel(channelIdx); end.setData(0); destination[articulationMeta.timestamp + articulationMeta.overallDuration].emplace(std::move(end)); diff --git a/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.h b/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.h index 00f7015fb9095..4a5fdb0f397b0 100644 --- a/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.h +++ b/src/framework/audio/internal/synthesizers/fluidsynth/fluidsequencer.h @@ -52,7 +52,7 @@ class FluidSequencer : public AbstractEventSequencer void updateDynamicEvents(EventSequenceMap& destination, const mpe::DynamicLevelLayers& changes); void appendControlSwitch(EventSequenceMap& destination, const mpe::NoteEvent& noteEvent, const mpe::ArticulationTypeSet& appliableTypes, - const int midiControlIdx); + const int midiControlIdx, const midi::channel_t channelIdx); void appendPitchBend(EventSequenceMap& destination, const mpe::NoteEvent& noteEvent, const mpe::ArticulationTypeSet& appliableTypes, const midi::channel_t channelIdx);