Skip to content

Commit

Permalink
Fluid: fixed Let Ring / Pedal playback for voices
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPudashkin committed Dec 19, 2024
1 parent f6ecff7 commit bb56ceb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;

Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FluidSequencer : public AbstractEventSequencer<midi::Event>
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);
Expand Down

0 comments on commit bb56ceb

Please sign in to comment.