From c09823a10cd31fc12764bb5406f0a43ed38a1a3d Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 23 May 2025 01:21:06 +0300 Subject: Experiment: Allow multiple note dupes on same channel Should fix the problem of some of Heretic songs --- src/adlmidi_midiplay.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/adlmidi_midiplay.hpp') diff --git a/src/adlmidi_midiplay.hpp b/src/adlmidi_midiplay.hpp index dd5b34e..6ab0915 100644 --- a/src/adlmidi_midiplay.hpp +++ b/src/adlmidi_midiplay.hpp @@ -311,6 +311,14 @@ public: return it; } + notes_iterator create_activenote(unsigned note) + { + NoteInfo ni; + ni.note = note; + notes_iterator it = activenotes.insert(activenotes.end(), ni); + return it; + } + notes_iterator ensure_find_or_create_activenote(unsigned note) { notes_iterator it = find_or_create_activenote(note); @@ -318,6 +326,13 @@ public: return it; } + notes_iterator ensure_create_activenote(unsigned note) + { + notes_iterator it = create_activenote(note); + assert(!it.is_end()); + return it; + } + /** * @brief Reset channel into initial state */ -- cgit v1.2.3