From 5cd2200c7eb28cf054ea23528a53d10c92463175 Mon Sep 17 00:00:00 2001 From: Armin Date: Thu, 13 Aug 2026 04:00:25 +0200 Subject: [PATCH] replace screenshot, fix arpeggiator reset --- Source/DSP/Arpeggiator.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/DSP/Arpeggiator.h b/Source/DSP/Arpeggiator.h index 2e689f7..ef67536 100644 --- a/Source/DSP/Arpeggiator.h +++ b/Source/DSP/Arpeggiator.h @@ -68,6 +68,12 @@ public: bool wasIdle = heldNotes.empty(); heldNotes.push_back(note); velocities[note] = velocity; + // The held set changed, so the pitch pool changed too. Restart the + // sequence from the top so the pattern always starts from a known + // note instead of continuing at stepIndex % newPoolSize. + stepIndex = 0; + randomOncePool.clear(); + randomOnceOrder.clear(); // A fresh key press should sound immediately instead of waiting for // the next host-synced tick. if (wasIdle) @@ -76,8 +82,12 @@ public: void noteOff(int note) { auto it = std::find(heldNotes.begin(), heldNotes.end(), note); - if (it != heldNotes.end()) + if (it != heldNotes.end()) { heldNotes.erase(it); + stepIndex = 0; + randomOncePool.clear(); + randomOnceOrder.clear(); + } } bool hasHeldNotes() const { return !heldNotes.empty(); } @@ -97,6 +107,8 @@ public: heldNotes.clear(); stepIndex = 0; needsImmediateStep = false; + randomOncePool.clear(); + randomOnceOrder.clear(); } // Advances one step. Notes that should stop go into `notesToStop`