A beginner's guide to

Live Coding Music

Write a few lines, press run, and change the beat while it plays. Making music by typing code that loops, layers and changes while it plays, usually in Sonic Pi or a browser-based tool like Strudel.

Guide updated 31 October 2026

Start here ↓
Start-up costFree–£60
Best settingComputer
FeelsCurious
PopularityVery popular
CostLow
DifficultyModerate
Time needed30 minutes
Physical effortVery low
Social levelSome social
⌨️

Start this hobby

Your first practical checklist

01

Buy or borrow

A laptop or Raspberry Pi. Sonic Pi is free and runs on Windows, macOS, Linux and Raspberry Pi; Strudel runs in a web browser with no install

02

First 30 minutes

Install Sonic Pi, work through the first few sections of its built-in tutorial and play a four-note melody with play and sleep.

03

First week goal

Build a three-minute piece with at least three loops, starting and stopping them by hand while it plays, and record it.

04

Avoid this mistake

Leaving out the sleep in a live loop makes Sonic Pi freeze or error, so put the sleep in first.

Is this for me?

A quick fit check

Good signs

  • You enjoy making music from patterns and repetition, for instance building a drum beat out of loops, and like experimenting with how patterns combine.
  • You like typing and editing text, and the idea of performing by changing code appeals to you more than playing an instrument.
  • You are happy with unpredictable results, because live coding often produces happy accidents that you decide whether to keep.

Think twice if

  • A mistake in your code can stop the music suddenly, which is part of the fun but can be frustrating when you are trying to record.
  • You need to learn some coding concepts such as loops, lists and randomness, and that may feel slow if you only want to make tunes.
  • The music tends towards repetitive electronic styles, so if you want to write songs with lyrics or play traditional instruments, other tools may suit you better.

Make live coding music easier

Install Sonic Pi or open Strudel in a browser, and work through the built-in tutorial for the first hour. Copy and tweak the example code until you can write a drum loop from memory.

First session

What to do in the first 30 minutes

0–5 min

Open Sonic Pi, run the sample code, and then write play 60, sleep 1 and play 64 to hear two notes in sequence.

5–15 min

Write a live_loop :drums do with sample :bd_haus, sleep 0.5, then run it and change the sleep time while it is playing.

15–25 min

Add a second live_loop with a snare or hi-hat sample at a different rhythm, and use sync or matching sleep values to keep them together.

25–30 min

Add a third loop playing notes from a scale, press Stop and Run to hear it again, and save the buffer with a note about what you did.

The appeal · Musical practice

Why try live coding music?

In live coding music you write short programs that make sound and edit them while they are running, so the music evolves in front of an audience or just in your headphones. It differs from using a DAW such as Ableton or Logic, where you arrange recorded clips and notes visually, and from DJing, where you mix existing tracks. Beginners usually start with Sonic Pi or Strudel, then move to heavier pattern languages like TidalCycles, and some eventually play at algorave-style events.

✦

Learning music and code together

You learn rhythm, scales and structure by writing them out, and programming concepts by hearing them.

✦

Instant feedback

Changes become audible as soon as you press run, so ideas can be tested quickly.

✦

A creative performance format

You can improvise a set live, record it, or share code that others can run and remix.

Keep it simple

What you need to begin

  • A laptop or Raspberry PiSonic Pi is free and runs on Windows, macOS, Linux and Raspberry Pi; Strudel runs in a web browser with no install
  • Closed-back headphonesAny decent pair; at around £20–£50 they let you practise late and hear the quiet details
  • Sonic Pi or StrudelStart with one tool and its built-in tutorial; TidalCycles needs more setup, so leave it until you are comfortable with loops
  • A notes file of snippetsCopy every loop, rhythm or chord pattern you like into one document so you can remix your own library

The fundamentals

Four skills to build

01

Live loops

Putting each musical layer in its own looping block lets you start, stop and change parts independently while the music runs.

02

Rhythm and timing

Using sleep values or pattern strings to place beats accurately is the basis for drums and groove.

03

Scales and chords

Picking notes from a scale or chord, rather than randomly, keeps melodies sounding musical.

04

Randomness and variation

Functions such as choose, rrand and ring, or pattern modifiers in Strudel, give variation so loops do not feel static.

Software deep dive

Live Coding Music: zero to professional

Programming is the practice of turning a messy human problem into small, testable instructions. In 2026, AI assistants can speed up syntax and boilerplate, but beginners still need fundamentals: reading errors, tracing data, using Git and finishing small projects.

Fresh context

What to know now

  • ↳Use AI as a reviewer and explainer, not as the only author. You still need to understand every file you ship.
  • ↳Old single-purpose starter tools age quickly. Prefer official docs, small vanilla projects, or maintained framework starters.
  • ↳Employers and serious collaborators care about proof: deployed projects, readable commits, tests, issue notes and clear explanations of trade-offs.

Start with the right route

Common options and trade-offs

Web path

HTML, CSS and JavaScript give fast visual feedback and teach the browser platform beneath React, Vue, Svelte and every website builder.

Know the trade-offFrameworks help later, but they hide useful basics if you start too early.

Python path

Strong for automation, data, scraping your own data, command-line tools and backend services. The official tutorial is current and well maintained.

Know the trade-offPackaging desktop apps or mobile apps takes extra learning.

JavaScript/TypeScript app path

Good for full-stack apps because one language can cover browser, server, testing and tooling.

Know the trade-offThe ecosystem changes quickly; keep dependencies minimal until the product shape is clear.

A practical setup

Common tools and what each one does

ToolPurposeBeginner advice
VS Code, Zed or another editorWrite and navigate code

Pick one editor and learn search, multi-file replace, terminal, debugger and extensions slowly.

TerminalRun project commands

Learn folders, paths, environment variables, package scripts and how to read exit errors.

GitVersion control

Commit small working checkpoints with messages that explain why, not just what.

GitHub or GitLabRemote repo and collaboration

Use issues, pull requests and CI even for solo projects once the basics work.

Node.js or PythonRun code and install packages

Choose the runtime your project needs; avoid installing every tool mentioned in tutorials.

Test runnerCheck behaviour automatically

Start with a few tests for important functions and previous bugs before chasing full coverage.

Do not skip levels

A five-stage learning roadmap

1
Foundation

Learn files, terminal navigation, variables, functions, conditionals, loops and reading stack traces.

Proof you are ready to move on: Build a calculator, text formatter or static page without copying a full tutorial.

2
Working beginner

Handle user input, arrays or objects, modules, DOM events or files, and basic Git branching.

Proof you are ready to move on: Build a searchable list, quiz, simple API client or useful automation script.

3
Intermediate

Use persistent storage, validation, async code, APIs, authentication basics and automated tests.

Proof you are ready to move on: Ship a tracker with create, edit, delete, empty states, errors and a deploy URL.

4
Advanced

Study architecture, databases, accessibility, security, performance budgets and operational monitoring.

Proof you are ready to move on: Run a small multi-user app with backups, logs, migrations and rollback notes.

5
Professional

Practise code review, issue breakdown, debugging production failures and documenting decisions.

Proof you are ready to move on: Maintain a project used by real people and show how feedback changed it.

How real work gets done

A professional workflow

Use the same sequence on small personal projects that you would use on serious work. The scale changes; the discipline does not.

  1. Write the user problem, constraints and one measurable success condition.
  2. Sketch data, screens and failure states before choosing libraries.
  3. Build the thinnest complete version that runs end to end.
  4. Commit after each working change and keep a readable project log.
  5. Test expected, empty, invalid, slow and failure states.
  6. Deploy, observe real behaviour and document the next decision.

Build evidence, not tutorial history

Three portfolio milestones

Beginner

Tiny personal utility

A script or page that solves one annoyance you actually have.

Intermediate

Local-first tracker

Structured data, filtering, validation, persistence, tests and responsive layout.

Advanced

Production service

Accounts, database migrations, permissions, observability, backups and a deployment pipeline.

The difference at professional level

Habits that make work trustworthy

  • ✓Name variables and functions for their purpose, not their implementation.
  • ✓Keep changes small enough to review and revert.
  • ✓Write tests around important behaviour and past bugs.
  • ✓Treat accessibility, security and error handling as requirements.
  • ✓Document setup, architecture decisions and operational steps.
  • ✓Measure before optimising and verify after deployment.

Words you will encounter

Essential vocabulary

Repository
A project and its version history, usually managed by Git.
API
A defined way for one piece of software to request data or behaviour from another.
Runtime
The program or environment that executes code, such as a browser, Node.js or Python.
Dependency
External code a project relies on; dependencies must be updated and reviewed.
Framework
A structured set of tools and conventions that controls part of an application's architecture.
Deployment
The repeatable process that releases a tested version for people to use.

Continue with primary sources

Official learning resources

Documentation is a working tool, not something to read once from beginning to end. Follow one structured introduction, then return with specific questions from a project.

Four small steps

Your first week

  1. Install Sonic Pi, work through the first few sections of its built-in tutorial and play a four-note melody with play and sleep.
  2. Write a live_loop :drums with sample :bd_haus and sleep 0.5, then add a second loop with a hi-hat sample at a different sleep time.
  3. Add a bass or lead line using play choose(scale(:e3, :minor_pentatonic)), change use_bpm while it runs, and note which edits sound good.
  4. Build a three-minute piece with at least three loops, starting and stopping them by hand while it plays, and record it.

The longer path

How progress usually looks

For live coding music, a sustainable rhythm is three 30 to 45-minute sessions a week, plus occasional recording of a piece you like. Move forward when the current step feels repeatable, not merely possible once.

1

First loops

You can write a drum loop and a bassline, change them live and understand what each line does.

2

Building a piece

You layer several loops with effects, use scales and random choices, and structure a few minutes of music with an intro and drop.

3

Performing live

You rehearse a set, switch between prepared snippets, and perform or stream it to a few friends.

4

Exploring further

You try other tools such as Strudel or TidalCycles, use samples of your own, or go to an algorave or live-coding meetup.

Progress markers

What improvement looks like

Beginner

You can write a drum loop and a bassline, change them live and understand what each line does.

Intermediate

You rehearse a set, switch between prepared snippets, and perform or stream it to a few friends.

Confident

You try other tools such as Strudel or TidalCycles, use samples of your own, or go to an algorave or live-coding meetup.

Spend deliberately

A realistic cost plan

The headline starting range is Free–£60, but access, borrowing and second-hand equipment can change that substantially.

Try it£0Sonic Pi or Strudel, both free, on a laptop and with the headphones you already own.
Get going£0–£30A decent pair of closed-back headphones if yours are poor, which at around £20–£50 helps you hear details.
Later£60+A MIDI keyboard, a Raspberry Pi or audio interface, or software to record and edit your sets.

Learn with other people

Community and safety

☺

Finding your people

TOPLAP is the main live-coding community, and the Sonic Pi and TidalCycles forums are active, beginner-friendly places to ask questions. Algorave events and live-coding meetups happen in several UK cities, and many people also share sets online.

+

Safety note

Keep the volume low on headphones, especially when experimenting with effects, because levels can jump when you change a value, and take breaks to protect your hearing. Check the code you run from other people before executing it, and be careful about sudden loud bass if you play through speakers near neighbours.

Three common beginner mistakes

  • Leaving out the sleep in a live loop makes Sonic Pi freeze or error, so put the sleep in first.
  • Writing one huge loop makes it hard to change anything live, so split drums, bass and melody into separate live loops.
  • Making edits and running them without saving ideas means losing good versions, so copy working snippets into a notes file.

Good to know

One tip worth keeping

From the HobbyWiki notebook

Every loop needs a sleep inside it or the program stops with an error, so add the sleep first and the sounds afterwards. Keep the volume modest on headphones, because it is easy to push levels up while experimenting.

Find your angle

Useful searches from here

Before you begin

Common questions

What is the difference between Sonic Pi and Strudel?+

Sonic Pi is a desktop app with a Ruby-based language and a built-in tutorial. Strudel runs in a browser and uses compact pattern notation, inspired by TidalCycles. Both are good for beginners.

Do I need to know music theory?+

No. You can learn scales and rhythms as you go, and the tools make it easy to pick notes from a scale or chord.

Do I need to know how to code?+

Not before you start. The built-in tutorials teach the basics, and the music gives you a reason to learn loops and variables.

Can I record or share my music?+

Yes. Sonic Pi can record your output, and you can share code snippets or stream your sessions. Check licences if you use samples that are not included with the tool.

What is an algorave?+

An event where performers live-code dance music and visuals. They are friendly occasions, and many welcome beginners who just want to watch.