Tod Kurt's Breakbeats Generator Puts an RP2040-Based Board to Work Making Randomized Beats

Making use of CircuitPython's ability to play multiple samples at once, this tiny music player creates near-infinite variations.

Gareth Halfacree
2 years ago β€’ Music / Python on Hardware

ThingM's Tod Kurt has showcased the potential for CircuitPython and RP2040-based development boards like the Raspberry Pi Pico in music creation, building a simple little circuit that generates breakbeats on-demand.

"Want breakbeats but have no time? Let CircuitPython do the work on a Raspberry Pi RP2040-based board," Kurt writes of his latest project. "[CircuitPython] can play multiple simultaneous samples easily. And [the] RP2040 chip has PWM [Pulse Width Modulation] audio out."

The project revolves around manually-sliced uncompressed audio files β€” the famously widely-sampled "amen break," in Kurt's version, a drum break taken from the 1969 Winstons track Amen, Brother and that has since appeared as a sample in thousands of tracks, plus an audio track as a bonus β€” which are played at random on each measure.

The reason it works: CircuitPython's AudioMixer object, which is capable of handling multiple playback streams at once β€” mixing them so samples can overlap. The playback, meanwhile, is handled purely through PWM β€” plus a single resistor and a capacitor, with a 3.5mm jack breakout added to ease connection to an amplified speaker.

"Try your own samples," Kurt says, with a warning: "But since CircuitPython can't adjust pitch/rate of multiple samples, use another program like Live to beat-match them. Also expect some serious audio glitches if it's playing and you do USB disk access to it."

More information is available in Kurt's Twitter thread, while the source code and the samples used in the demo have been published on GitHub under an unspecified open-source license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles