Sonic Pi logo

Sonic Pi

Experience the sound of code.

Sonic Pi is your free code-based music creation and performance tool.

Powerful for professional musicians and DJs.
Expressive for composition and performance.
Accessible for blind and partially sighted people.
Simple for computing and music lessons.

Learn to code creatively by composing or performing music in an incredible range of styles from Classical & Jazz to Hip hop & EDM. Free for everyone with a friendly tutorial.

Brought to you by Sam Aaron and the Sonic Pi Core Team.


Live Code Everything

Diagram of Sonic Pi's audio, MIDI, OSC and Link connectivity

Sonic Pi lets you use simple code to turn your computer into a fully networked live coding music studio:

  • Multi Channel Audio In/Out
  • Well-timed MIDI In/Out
  • Well-timed OSC (Open Sound Control) In/Out
  • Ableton's Link network metronome built-in

Take the Official Course

Sonic Pi Creator Sam Aaron has created a series of tutorial courses that will kick-start your live coding journey.

Free Lesson Preview

4. Exploring Synths

Learn how to trigger expressive synth sounds with simple code

Sonic Pi - Introduction

Sonic Pi - Introduction

Join Sonic Pi's creator Sam Aaron and learn to express yourself with code. This course will teach you the basics of live coding your own performances and compositions using the powerful live coding software Sonic Pi.

Sponsors

The following organisations are kindly supporting Sonic Pi's mission of lowering the many barriers to entry for creative experiences with code:


Please consider asking your employer to sponsor Sonic Pi.

Community Support

Please consider joining our wonderful community of supporters helping to keep Sonic Pi free for everyone.

Code. Music. Live.

Sonic Pi is a new kind of musical instrument.
Watch how you can use it for live performances from ambient sets to dance music in nightclubs....

Array by DJ_Dave

Sonic Pi Band - Sam Aaron & Ben Smith

Reeled - Jylda & Sam Aaron

Daft Punk - Aerodynamic
coded by Sébastien Rannou

Welcome to our Community

Join the friendly Sonic Pi community and share your ideas and thoughts with other educators, musicians and live coders...

Live Coding Education

Sonic Pi helps you engage students in Computing through music. Read how in the article 'Live Coding Education'

Watch this introductory CAS TV interview with Sonic Pi creator Sam Aaron.

Sonic Pi in the

Computing Classroom

Sonic Pi was specifically designed for and built in collaboration with teachers for use in the classroom.

Music note

Music Live Coding

Sonic Pi is a new kind of musical instrument which enables exciting new learning pathways in the classroom.

Music programming workshop by Mehackit
Blackboard

Classroom Ready

Sonic Pi was designed, implemented and developed with extensive classroom trials in close collaboration with teachers.

Introduction for Teachers
Code

Creative Computing

Sonic Pi comes with a scheme of work targetted for KS3 Computing developed in harmony with the new UK curriculum.

Scheme of Work for Computing Lessons

Free Sonic Pi Book

Sam Aaron, creator of Sonic Pi, has written this book to
complement the built-in tutorial.

Master live loops, code drum breaks, compose your own melodies make random riffs and loops, learn to shape and sculpt sounds and much, much more...

Sonic Pi Talks

"Sonic Pi lowers the barrier to entry for a creative experience with code..."

Music. Code. Simple.

See how easy it is to get started coding your first sounds...

Haunted Bells

live_loop :haunted do
  sample :perc_bell, rate: rrand(-1.5, 1.5)
  sleep rrand(0.1, 2)
end

Listen to the coded bells...

Pentatonic Bleeps

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

Code with scales and chords...

Tron Bikes

use_random_seed 10
notes =  (ring :b1, :b2, :e1, :e2, :b3, :e3)

live_loop :tron do
  with_synth :dsaw do
    with_fx(:slicer, phase: [0.25,0.125].choose) do
      with_fx(:reverb, room: 0.5, mix: 0.3) do

        n1 = (chord notes.choose, :minor).choose
        n2 = (chord notes.choose, :minor).choose

        p = play n1, amp: 2, release: 8, note_slide: 4, cutoff: 30, cutoff_slide: 4, detune: rrand(0, 0.2)
        control p, note: n2, cutoff: rrand(80, 120)
      end
    end
  end

  sleep 8
end

Listen to bikes from the future...

Wob Rhythm

use_debug false

with_fx :reverb do
  live_loop :choral do
    r = (ring 0.5, 1.0/3, 3.0/5).choose
    cue :choir, rate: r
    8.times do
      sample :ambi_choir, rate: r, pan: rrand(-1, 1)
      sleep 0.5
    end
  end
end


live_loop :wub_wub do
  with_fx :wobble, phase: 2, reps: 16 do |w|
    with_fx :echo, mix: 0.6 do
      sample :drum_heavy_kick
      sample :bass_hit_c, rate: 0.8, amp: 0.4
      sleep 1
      ## try changing the wobble's phase duration:
      # control w, phase: (ring 0.5, 1, 2).choose
    end
  end
end

Hear the rhythmic wobble...

Ocean Waves

with_fx :reverb, mix: 0.5 do
  live_loop :oceans do
    s = synth [:bnoise, :cnoise, :gnoise].choose, amp: rrand(0.5, 1.5), attack: rrand(0, 4), sustain: rrand(0, 2), release: rrand(1, 5), cutoff_slide: rrand(0, 5), cutoff: rrand(60, 100), pan: rrand(-1, 1), pan_slide: rrand(1, 5), amp: rrand(0.5, 1)
    control s, pan: rrand(-1, 1), cutoff: rrand(60, 110)
    sleep rrand(2, 4)
  end
end

Hear the digital waves crash...

IDM Breakbeat

live_loop :idm_bb do
  n = [1,2,4,8,16].choose
  sample :drum_heavy_kick, amp: 2
  sample :ambi_drone, rate: [0.25, 0.5, 0.125, 1].choose, amp: 0.25 if one_in(8)
  sample :ambi_lunar_land, rate: [0.5, 0.125, 1, -1, -0.5].choose, amp: 0.25 if one_in(8)
  sample :loop_amen, attack: 0, release: 0.05, start: 1 - (1.0 / n), rate: [1,1,1,1,1,1,-1].choose
  sleep sample_duration(:loop_amen) / n
end

Listen to crazy coded beats...

Acid Walk

live_loop :drums_n_bass, delay: 2 do
  use_synth :fm
  28.times do
    sample :drum_bass_hard, amp: 0.8
    sleep 0.25
    play :e2, release: 0.2
    sample :elec_cymbal, rate: 12, amp: 0.6
    sleep 0.25
  end
  sleep 4
end


with_fx :reverb do |rev|
  live_loop :walk  do
    use_synth :tb303
    control rev, mix: rrand(0, 0.3)
    with_fx :slicer, phase: 0.125 do
      sample :ambi_lunar_land, sustain: 0, release: 8, amp: 2
    end

    control rev, mix: rrand(0, 0.6)
    r = rrand(0.05, 0.3)
    64.times do
      play chord(:e3, :minor).choose, release: r, cutoff: rrand(50, 90), amp: 0.5
      sleep 0.125
    end

    control rev, mix: rrand(0, 0.6)
    r = rrand(0.1, 0.2)
    with_synth :prophet do
      32.times do
        sleep 0.125
        play chord(:a3, :m7).choose, release: r, cutoff: rrand(40, 130), amp: 0.7
      end
    end

    control rev, mix: rrand(0, 0.6)
    r = rrand(0.05, 0.3)
    32.times do
      play chord(:e3, :minor).choose, release: r, cutoff: rrand(110, 130), amp: 0.4
      sleep 0.125
    end

    control rev, mix: rrand(0, 0.6)
    with_fx :echo, phase: 0.25, decay: 8 do
      16.times do
        play chord([:e2, :e3, :e4].choose, :m7).choose, release: 0.05, cutoff: rrand(50, 129), amp: 0.5
        sleep 0.125
      end
    end
  end
end

Start producing longer tracks...

Highlights from the

Sonic Pi Story

Some of our favourite moments from over the years — from classrooms and clubs to the International Space Station...

The Music Commission

The Music Commission

Sonic Pi is represented by Sam Aaron on The Music Commission panel, a new enquiry launched by ABRSM exploring how to better sustain & support progress & progression in learning music.

Naked Scientists

The Naked Scientists

The wonderful Naked Scientists covered Sonic Pi in an interview which was broadcast live on BBC radio and is available to listen and read here.

The Big Bang Fair

The Big Bang Fair 2018

The Big Bang Fair is the UK's largest celebration of STEM for young people. In 2018 the Sonic Pi Band performed a series of shows demonstrating how to live code your own band.

Mehackit

Kokoa Certified Resources

The incredible Mehackit Sonic Pi creative coding resource has been certified by the Finnish Education Standard Kakoa for its educational quality.

Codebus Africa

Codebus Africa

In 2017, African and Finnish tech and education innovators collaborated to use Sonic Pi to deliver creative coding workshops engaging almost 2000 children in 10 African countries.

Google Logo

Google Open Source Winner

Google have announced Sonic Pi as one of a number of projects they either use or think are important.

MistaJam

CBBC Ten Pieces Masterclass

Radio 1 DJ MistaJam and Live Coder Sam Aaron compose a piece of music using Sonic Pi, inspired by Bizet's 'Carmen'

Get Sonic Pi for

Raspberry Pi OS - 64 bit

Get started on the world's most affordable computer.

Built for Raspberry Pi

Raspberry Pi logo

Get the latest version of Sonic Pi for your Raspberry Pi to take advantage of all the new features such as MIDI, OSC networking, new translations, improved interface, headphone audio and much, much more...

64 bit package

ARM64 chip

v4.6.0
Download then right click and choose 'install package'

Requires the 64 bit release of Raspberry Pi OS (Trixie)

Download (64 bit)
Using 32 bit Raspberry Pi OS?
Download a 32 bit version here

Terminal Installation

Terminal box

To install run the following commands via the terminal (within the directory you downloaded the deb file):

sudo apt update
sudo apt install ./sonic-pi_4.6.0_2_trixie.arm64.deb

Get Sonic Pi for

Windows

Turn any PC into a full Sonic Pi workstation.

Built for Windows 10 & 11

Windows laptop

Sonic Pi has been developed and designed to work perfectly on laptops and desktops running either Windows 10 or 11.

Sonic Pi for Windows

Intel CPU

Download and double-click to install
v4.6.0

Requires Windows 10.

Windows 10/11 (64 bit)
MSI Installer
Still using Windows 7 or 8.1?
Download v3.1 here

MSI Installer

Windows logo

Sonic Pi is available as a signed MSI installer for you to securely install on your machine or network.

Get Sonic Pi for

macOS

Use the full power of your Mac to take Sonic Pi to the next level.

macOS - Apple Silicon

Apple Silicon chip

v4.6.0
for Macs with Apple M series chips

Requires Ventura
(macOS 13)

Mac with Apple chip

Securely Built for Apple

Apple logo

Intel or Apple Silicon?

There are two versions available to download. Apple Silicon for newer Macs powered by M1 or M2 chips and Intel for older Macs.

See "About This Mac" for your chip type.

Using macOS 10.15 or below?
Download previous releases here

macOS - Intel x64

Intel CPU

v4.6.0
for older Macs with Intel chips

Requires Ventura
(macOS 13)

Mac with Intel chip
Most Common