A TR-808 Drum Machine for Sonic Pi

Hi y’all! I’ve found it tricky or tedious sometimes in making complex beats programmatically. So I’m releasing tr808-pi, a drum machine I made for easily making beats in Sonic Pi just using text! I wanted to make something that was light and text-based so that it’s easy to copy-paste, modify, and share beats with others. Quick demo:

You can check it out here: GitHub - nischalshrestha/tr808-pi: A Roland TR-808 drum machine for Sonic Pi.

It’s really just one script with the TR-808 samples, and essentially creates a live loop that goes through 16 notes for each instrument. You specify the patterns as text, and I’ll be adding more enhancements to tweak certain instruments. I might also generalize it a bit more so you could do this for any sample pack including ones already in Sonic Pi.

Let me know if you have thoughts on this, or ideas for improvement!


Excellent, thank you for sharing.
I am a fan of XOX style beat programming and it’s great to see another structured approach. I haven’t tried it yet, but will.

There are some previous posts on in-thread where they’ve used numbers instead of an x. The numbers are used to simulate velocity sensitivity mainly via amp:.

I think a generalizable version is worth considering.

Thank you for sharing.

1 Like

Thank you!

Yeah I considered directly doing 1s and 0s, but decided to do the Xs and -s because for some reason that visually stood out more. Under the hood, it’s still converted to 1s and 0s though to determine hits.

to simulate velocity sensitivity

That’s interesting, let me know if you remember the posts of these ideas. I’d love to see what others have done with beat making this way. Currently I’m working on a tweak "BD", amp: 1 type syntax to tweak certain samples. It uses the get / set to change parameters of sample command as the live loop is running. Seems to be working so far but would love to know if there are other ways to dynamically tweak params.

You’re welcome.

The thread is here.

DJ_Dave uses XOX a lot, so she’s worth checking out.

1 Like

Ahh worlds are intersecting! I follow her on instagram. Very cool to see how we all converge on similar ideas.

I wonder if anyone has worked on emulating time signatures? I’ve been tinkering with how to make this work, but it all feels messy and hacky.