From 8f629669bb6f25842fa993dad6bb935ffebf9996 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 17 Apr 2026 12:56:46 -0700 Subject: [PATCH] notepat: drum mode swaps only upper octave, add trigger logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously drumMode converted every note (both octaves) to the 12-drum kit, which didn't match the native kitRight semantics and made it feel like the button wasn't doing anything — you lost your melody row too. Now drumMode only intercepts notes prefixed with "+" / "++" (the upper grid), so the lower octave keeps pitched playback and you can play melody + drums at once. Added 🥁 console logs on toggle and on each drum hit so the route is visible while debugging. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../public/aesthetic.computer/disks/notepat.mjs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/system/public/aesthetic.computer/disks/notepat.mjs b/system/public/aesthetic.computer/disks/notepat.mjs index 68ca1e1e7e..e15cb7f299 100644 --- a/system/public/aesthetic.computer/disks/notepat.mjs +++ b/system/public/aesthetic.computer/disks/notepat.mjs @@ -5958,13 +5958,17 @@ function startButtonNote(note, velocity = 127, apiRef = null) { if (downs[note]) return false; - // Drum mode: each key fires the shared 12-drum kit instead of a pitched note. - // Strip octave prefix (++, +, -) and lowercase so "C" or "+c" both land on `c`. - if (drumMode && soundContext) { + // 🥁 Drum mode: the upper octave (notes prefixed with "+" or "++") fires the + // shared 12-drum kit instead of a pitched note. Lower octave stays pitched so + // you can play melody + drums simultaneously. Mirrors the kitRight behaviour + // in fedac/native/pieces/notepat.mjs. + if (drumMode && note.startsWith("+") && soundContext) { const letter = note.replace(/^[+\-]+/, "").toLowerCase(); const pan = getPanForButtonNote(note); + const volume = Math.max(0.1, velocity / 127); + console.log("🥁 drum:", letter, "from", note, "vol", volume.toFixed(2), "pan", pan.toFixed(2)); playPercussion(soundContext, letter, { - volume: Math.max(0.1, velocity / 127), + volume, pan, pitchFactor: 1.0, phase: "both", @@ -7180,8 +7184,9 @@ function act({ drumBtn?.act(e, { down: () => api.beep(400), push: () => { - api.beep(drumMode ? 200 : 600); drumMode = !drumMode; + api.beep(drumMode ? 600 : 200); + console.log("🥁 drumMode:", drumMode ? "ON (upper octave → drum kit)" : "OFF (pitched)"); }, }); -- 2.51.2