addNote
creates a copy of the state so you’d need to remove the note state returned by addNote
. E.g.
auto addedNote = sequence.addNote (note, nullptr);
sequence.removeNote (*addedNote);
Why would notes be removed after they’ve been played? That would be very odd in a DAW if every time the play head moved over a note they disappeared…
But it sounds like you’ve not quite understood the model/playback separation here. The MidiList
is the model of the MIDI sequence, that is independent of it being played back.
When the model needs to be played back, a juce::MidiMessageSequence
is created using MidiList::exportToPlaybackMidiSequence
which is then used to create a MidiNode
which adds the notes from the sequence to the play back graph at the correct play head time.