Repository navigation
drum_machine: play audioinstruments' drum machines - #9
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 amachine.Timerwhere 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.
rhythm909does 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.