explaingit

sonic-pi-net/sonic-pi

11,812C++Audience · generalComplexity · 2/5Setup · easy

TLDR

Sonic Pi is a live-coding music instrument where you write short programs to produce beats and melodies in real time, originally built to teach programming to school children but also used by professional performers on stage.

Mindmap

mindmap
  root((sonic-pi))
    What it does
      Live-coded music
      Code as instrument
      Instant audio feedback
    Audience
      School students
      Live performers
      Educators
    Features
      Loops and beats
      Synths and samples
      Effects and randomization
    Platforms
      Linux
      macOS
      Windows
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Teach programming to beginners by having them write code that produces music they can hear and change instantly.

USE CASE 2

Perform live-coded electronic music on stage by editing loops and beats in real time while the audience listens.

USE CASE 3

Compose algorithmic melodies and drum patterns that evolve procedurally during a performance.

USE CASE 4

Explore live-coding as an art form combining technology, music, and programming education.

Tech stack

C++Ruby

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Sonic Pi is a music instrument that you play by writing code. Instead of pressing keys on a keyboard or plucking strings, you type short programs that produce sound: beats, melodies, basslines, and more. You can change the code while the music is playing and hear the result immediately, which is a style of performance called live coding. The project was originally built to teach programming to children in schools. The idea was that making music is more motivating than writing programs that just print text, so students would engage more readily with coding concepts when the output is something they can hear and enjoy. That educational origin still shapes the design: the tool is meant to be approachable for beginners, including young students, while also being capable enough for skilled performers. Over time it has grown beyond the classroom and is also used by professional musicians and DJs who perform with it on stage. The README describes it as sitting at the intersection of art, technology, and education: it gives artists a way to express musical ideas in code, gives researchers a context for exploring questions about live performance and timing in programming languages, and gives educators a tool that encourages open play rather than rigid instruction. Sonic Pi runs on Linux, Mac, and Windows. It is open source and the application and its built-in tutorial have been translated into many languages, including French, German, Spanish, Japanese, Chinese, Russian, and others. The repository contains build instructions for each platform and welcomes contributions, including translation contributions. If you have never seen live coding before, the project website includes videos and examples that show what it looks and sounds like in practice.

Copy-paste prompts

Prompt 1
Write a Sonic Pi program that plays a 4-bar drum loop with a kick on beats 1 and 3, a snare on 2 and 4, and a bass line that changes note every 2 bars, all at 120 BPM.
Prompt 2
Help me create a Sonic Pi live-coding set that layers samples for a kick drum, snare, and hi-hat using the sample player, and modulates the reverb effect in real time.
Prompt 3
Show me how to use Sonic Pi's randomization functions to generate a melody that picks random notes from a scale and is slightly different each time the loop repeats.
Prompt 4
Write a beginner Sonic Pi classroom exercise that introduces the loop construct, a variable for BPM, and one audio effect like reverb, with a short explanation of each concept.
Prompt 5
Explain how Sonic Pi's live-loop feature works and write an example with two live_loops running simultaneously at different rates that stay in sync.
Open on GitHub → Explain another repo

← sonic-pi-net on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.