What is Sonic Pi and what can you do with it?
Updated
Sonic Pi is a free, code-based music creation and performance tool. You write short programs that describe melodies, rhythms, and synth sounds, then run them live to hear the result immediately. It runs on Windows, macOS, and Linux, and is designed both for professional musicians and DJs and for computing and music lessons. If you want to make music by writing code rather than clicking a piano roll, Sonic Pi is built for exactly that.
How it works
Instead of sequencing notes in a grid, you describe music as code. Sonic Pi turns that code into sound in real time, so you can edit and re-run while it plays.
The site frames this as a shift in vocabulary:
- Instead of sequencing, you write melodies.
- Instead of iteration, you write repeating rhythms.
- Instead of lists, you write bass lines and riffs.
Synths are also code. Each synth has its own page in the documentation, where you can play it from its keys and shape it with its dials. That gives you algorithmic precision and control over the sound rather than fixed presets.
A minimal example from the site shows how compact this is — a reverb-wrapped loop that picks random notes from an E-flat major pentatonic scale:
with_fx :reverb, mix: 0.2 do
live_loop :bleeps do
play scale(:Eb2, :major_pentatonic, num_octaves: 3).choose, release: 0.1, amp: rand
sleep 0.1
end
end
What you can do with it
- Compose and perform using algorithms and code, from ambient sets to dance music in nightclubs.
- Play live — Sonic Pi is described as a new kind of musical instrument, and the site links live-coded performances including Array by DJ_Dave, a set by Sam Aaron & Ben Smith, alsoknownasrox at The Lot Radio, and a coded version of Daft Punk's Aerodynamic by Sébastien Rannou.
- Learn code and music together — rather than learning to code in a distant, abstract way, you learn by making music.
- Connect to other tools — simple code turns your computer into a fully networked live coding music studio, with OSC, MIDI, and Link support (see the comparison below).
- Use it accessibly — the site lists blind and partially sighted people among its intended users.
App vs. Web: what each supports
Sonic Pi is available as a downloadable app and as a web version, but they are not equivalent. The site's own feature table:
| Feature | App | Web |
|---|---|---|
| Gamepad input | yes | yes |
| Live audio in and out | yes | multichannel |
| Live audio out | yes | stereo |
| Well-timed MIDI in and out | yes | yes (not Safari) |
| Low-latency audio through your interface (ASIO, Core Audio, PipeWire) | yes | no |
| Well-timed OSC in and out | yes | no |
| Ableton Link and Link Audio | yes | no |
If you need low-latency audio, OSC, or Ableton Link, the app is the version to use. The web version covers basic live audio and MIDI, with the caveat that MIDI timing is not supported in Safari.
Who it's for
- Professional musicians and DJs — for composition and performance.
- Teachers and students — for computing and music lessons.
- Blind and partially sighted users — accessibility is an explicit design goal.
Background
Sonic Pi began as a Computer Lab research project at Cambridge University in collaboration with Raspberry Pi. It is now independent, open source, and community supported. It has been used from school assemblies to the Royal Albert Hall — including a performance with 1,000 young musicians on traditional instruments accompanied by a Sonic Pi quartet — and up to the International Space Station.
Getting started
Launch Sonic Pi, or get the app for Windows, macOS, or Linux. The site's suggested path is to explore, experiment, and have fun, with a "Start learning" entry point for beginners.