From 8726f42d05140d5fbd33b3b9608ef84ac6b9c2b2 Mon Sep 17 00:00:00 2001 From: Me Here Date: Sat, 30 May 2026 11:30:49 -0500 Subject: [PATCH] PM_K-1 0.0.22: cleanup -- delete the dead _step_dur fallback By 0.0.20 every site that needed step duration had switched to L['durs'][step] (the precomputed tuple from _rebuild_dur). _step_dur was kept as a "legacy fallback" with a comment claiming it was still used by the tap-tempo path -- which was wrong; grep showed zero callers. Ten lines of unreachable code. Now that 0.0.21 is sounding clean on the Pico 2, time to trim the sediment. No behavior change; .mpy shrinks slightly. Co-Authored-By: Claude Opus 4.7 (1M context) --- pico-cp/app.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pico-cp/app.py b/pico-cp/app.py index 0c83eaf..bdc6f9d 100644 --- a/pico-cp/app.py +++ b/pico-cp/app.py @@ -18,7 +18,7 @@ import board, busio, digitalio, analogio, pwmio, displayio, vectorio, time, json, gc, os, supervisor supervisor.runtime.autoreload = False # we write our own files (log + pushed programs); never self-restart -APP_VERSION = "0.0.21" # firmware version (the A/B updater pushes/compares this) +APP_VERSION = "0.0.22" # firmware version (the A/B updater pushes/compares this) try: import rtc # set from the editor's clock SysEx so the log has real timestamps except ImportError: @@ -962,16 +962,6 @@ class App: with open("/settings.json", "w") as f: json.dump(d, f) except OSError: self.can_write = False - def _step_dur(self, L, step): # legacy fallback (still used by _start_play tap-tempo path) - beat = self._beat_ns - if L['poly']: - m = self.lanes[0]; master_bar = beat * (m['steps'] // m['sub']) - return master_bar // L['steps'] - sub = L['sub'] - if L['swing'] and sub % 2 == 0: - pair = beat // (sub // 2) - return (pair * 2) // 3 if (step % sub) % 2 == 0 else pair // 3 - return beat // sub def _rebuild_dur(self, L): # cache the per-step ns durations into L['durs'] (tuple lookup is ~10us) beat = self._beat_ns sub = max(1, L['sub']); steps = max(1, L['steps'])