Skip to content

drum_machine: play audioinstruments' drum machines - #9

Merged
bdbarnett merged 3 commits into
mainfrom
drum-machine/audioinstruments
Oct 31, 2026
Merged

bdbarnett merged 3 commits into
mainfrom
drum-machine/audioinstruments

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

The drum machine example now plays the five drum machines in audioinstruments 0.5.0: rhythm808, rhythm909, rhythm606, rhythm78 and electronic_drums5. The rows are each machine's own pads, named from its NOTE_MAP; the electronic kit has no hats, so its last two rows are toms.

The new instruments cannot be scheduled on the audio pump's queue, so the example keeps time on its wall-clock step timer. It gives the instrument its fill() turn every 10 ms from a machine.Timer where the port has one (and from the step timer where it does not). A turn that arrives inside another, or inside a kit change, is dropped. A machine that will not build at the output's sample rate is reported and the previous one stays loaded.

Run on unix MicroPython (1.30 preview) and desktop CPython 3.12: every machine loads, its four rows sound with nonzero output, a pattern plays and the step indicator advances, and the instrument panel opens over each one. rhythm909 does not build on MicroPython below 32 kHz, which includes the desktop output's 24 kHz; that is PyDevices/audioinstruments#35. It builds and plays on CPython.

…ument its fill() turns

The five machines in audioinstruments replace the ten from audiocomponents
(rhythm808, 909, 606, 78 and electronic_drums5). Their instruments are not
schedulable on the audio pump's queue, so the example keeps time on its
wall-clock step timer and gives the instrument fill() every 10 ms from a
machine.Timer, dropping a turn that lands inside another or inside a kit
change. A machine that will not build at the output's sample rate is
reported and the previous one stays.
@bdbarnett
bdbarnett merged commit dc983c8 into main Oct 31, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the drum-machine/audioinstruments branch October 31, 2026 14:55
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.

1 participant