Skip to content

drum_machine: no orange CLK TIMER! where there is simply no pump - #148

Merged
bdbarnett merged 1 commit into
mainfrom
polish-a-clk
Sep 24, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
polish-a-clk

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

Fixes #147.

It was a false alarm. from audiodev import pump succeeds on every host, so the grey "no pump" branch never ran. Without the C audiopump engine (desktop CPython, the Android Runner, Pyodide) events() is None, no sequencer is built, and _refresh_clock filled in "this kit is not schedulable" as the reason. TR808 was never the problem; the timer path it fell back to is the one it was designed for on those hosts.

The label now keys off the queue: grey TIMER with no pump (or before a browser opens audio), grey CLK LIVE for a kit that plays live by design (acoustickit), green CLK AUDIO on the pump, orange CLK TIMER! only when a pump is present and didn't take the graph. The reason prints once.

Checked, default kit, pressing PLAY from a probe:

  • desktop CPython + SDL (dummy drivers): label TIMER, step 4,8,12,0,4 at 500 ms samples. Same probe on main: CLK TIMER! and the old print.
  • MicroPython unix (has the pump): CLK AUDIO, playhead advancing, so the real warning path is untouched.
  • browser, the dogfood PWA with this main.py, Chromium muted via Playwright: TIMER, audio started, steps advancing 4,8,12,0,4,8,12.

Android shows the same thing as desktop CPython (no pump there); the phone check happens in another session.

audiodev.pump imports on every host, so the 'no pump' branch never ran:
without the C engine the event queue is None, the sequencer is None, and
the label guessed 'this kit is not schedulable' in orange. That was every
desktop CPython, Android and browser run on the default kit. The label now
reads grey TIMER when there is no queue (or audio is not open yet), grey
CLK LIVE for a kit that plays live by design, green CLK AUDIO on the pump,
and orange CLK TIMER! only when a pump is here and the graph did not take.
It also prints its reason once rather than on every refresh.

Fixes #147
@bdbarnett
bdbarnett merged commit 5d9958f into main Sep 24, 2026
4 checks passed
@bdbarnett
bdbarnett deleted the polish-a-clk branch September 24, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

drum_machine: orange CLK TIMER! on Android and in the browser, on the default kit

1 participant