From a2c9ec78d3cb772a856615b97a2f1c344b8ff820 Mon Sep 17 00:00:00 2001 From: DevEd Date: Sun, 10 Sep 2023 17:41:16 -0400 Subject: [PATCH] add compatibility flag for arp phase reset on new note --- src/engine/playback.cpp | 4 +++- src/engine/song.h | 4 +++- src/gui/compatFlags.cpp | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 572add9cf..bca403af2 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1067,7 +1067,9 @@ void DivEngine::processRow(int i, bool afterDelay) { } } else if (!chan[i].noteOnInhibit) { dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8)); - chan[i].arpStage=-1; + if (song.resetArpPhaseOnNewNote) { + chan[i].arpStage=-1; + } chan[i].goneThroughNote=true; chan[i].wentThroughNote=true; keyHit[i]=true; diff --git a/src/engine/song.h b/src/engine/song.h index 78c49b4e1..ae144d714 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -377,6 +377,7 @@ struct DivSong { bool brokenPortaLegato; bool brokenFMOff; bool preNoteNoEffect; + bool resetArpPhaseOnNewNote; std::vector ins; std::vector wave; @@ -496,7 +497,8 @@ struct DivSong { patchbayAuto(true), brokenPortaLegato(false), brokenFMOff(false), - preNoteNoEffect(false) { + preNoteNoEffect(false), + resetArpPhaseOnNewNote(false) { for (int i=0; isong.resetArpPhaseOnNewNote); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("when enabled, the arpeggio phase is reset on a new note."); // TODO: Better description + } ImGui::EndTabItem(); } ImGui::EndTabBar();