Sonic Pi

The Live Coding Music Synth for Everyone.

Welcome to the future of music.

Simple enough for computing and music lessons.
Powerful enough for professional musicians.
Free to download with a friendly tutorial.

Learn to code creatively by composing or performing music in an incredible range of styles from classical & jazz to EDM.

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

Sonic Pi v2.11.1 is available free for:


Created at the University of Cambridge Computer Laboratory
with kind support from the Raspberry Pi Foundation & pi-top.
Sonic Pi is an Open Source Project released under the MIT Licence.

Introducing Sonic Pi...



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 Live Coding

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

Scheme of Work for Music Lessons

Classroom Ready

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

Introduction for Teachers

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

Live Coding Performances

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...

The Sonic Pi Live and Coding Project.

Daft Punk - Aerodynamic by Sébastien Rannou

Polycore - Sam Aaron & Ben Smith

Phase Abstractions
Coded by Sam Aaron Live at the NODE Festival in Frankfurt

Sonic Pi at TEDx

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

Free Sonic Pi Book

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

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...

Music. Code. Simple.

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

Haunted Bells


loop do
  sample :perc_bell, rate: (rrand 0.125, 1.5)
  sleep rrand(0, 2)
end
                

Listen to the coded bells...



Pentatonic Bleeps

with_fx :reverb, mix: 0.2 do
  loop 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

loop 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
        start_note = chord([:b1, :b2, :e1, :e2, :b3, :e3].choose, :minor).choose
        final_note = chord([:b1, :b2, :e1, :e2, :b3, :e3].choose, :minor).choose

        p = play start_note, release: 8, note_slide: 4, cutoff: 30, cutoff_slide: 4, detune: rrand(0, 0.2), pan: rrand(-1, 0), pan_slide: rrand(4, 8)
        control p, note: final_note, cutoff: rrand(80, 120), pan: rrand(0, 1)
      end
    end
  end
  sleep 8
end
                

Listen to bikes from the future...



Wob Rhythm

with_fx :reverb do
  in_thread do
    loop do
      r = [0.5, 1.0/3, 3.0/5].choose
      8.times do
        sample :ambi_choir, rate: r, pan: rrand(-1, 1)
        sleep 0.5
      end
    end
  end
end

with_fx :wobble, phase: 2 do |w|
  with_fx :echo, mix: 0.6 do
    loop do
      sample :drum_heavy_kick
      sample :bass_hit_c, rate: 0.8, amp: 0.4
      sleep 1
    end
  end
end
                  

Hear the rhythmic wobble...



Ocean Waves

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

Hear the digital waves crash...



IDM Breakbeat

define :play_bb do |n|
  sample :drum_heavy_kick
  sample :ambi_drone, rate: [0.25, 0.5, 0.125, 1].choose, amp: 0.25 if rand < 0.125
  sample :ambi_lunar_land, rate: [0.5, 0.125, 1, -1, -0.5].choose, amp: 0.25 if rand < 0.125
  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
loop {play_bb([1,2,4,8,16].choose)}
                      

Listen to crazy coded beats...



Acid Walk

in_thread do
  use_synth :fm
  sleep 2
  loop do
    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
 end

 use_synth :tb303
 with_fx :reverb do |rev|
   loop do
     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...

What's Happening

Here's a taster of some of the exciting things happening in the Sonic Pi world...

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'

New MagPi Series

The MagPi magazine now features a regular piece by Sam Aaron introducing readers to new features in Sonic Pi. You can either buy the printed magazine or download the free PDF.

Get Sonic Pi for

Raspberry Pi

Get started on the world's most affordable computer.

Pre-installed on Raspbian Jessie

Sonic Pi is already pre-installed on Raspbian Jessie - the SD card image recommended by the Raspberry Pi Foundation.

Manual Download for Raspbian Jessie

sudo dpkg -i sonic-pi_1-2.11.0-2_armhf.deb
sudo apt-get install -f

Download

Raspbian Package Manager

Easily keep your Sonic Pi up-to-date via the Raspbian Package Manager:

sudo apt-get update
sudo apt-get install sonic-pi

Get Sonic Pi for

Windows

Turn any PC into a full Sonic Pi workstation.

Sonic Pi Portable

A portable version that will self-extract and run from a USB stick or folder. No installation necessary.

Download Portable App

Sonic Pi for Windows

Sonic Pi v2.11.1 is compatible with Windows and works well with all versions of Windows from 7 to 10.

Windows Installer

Sonic Pi is available as a self-contained MSI installer for you to install on your machine or network.

Download MSI Installer

Get Sonic Pi for

Debian/Ubuntu Linux

Ready to run binaries for your open source operating system.

Built for Linux

You can compile Sonic Pi from source, but there are binaries ready for use in your Debian and Ubuntu package repositories, thanks to the Debian Multimedia packagers team.

Sonic Pi .deb packages

The Sonic Pi package is in Debian Sid (Unstable), Debian Stretch (Testing) and Ubuntu 16.04. To install, just enter:

sudo apt-get update
sudo apt-get install sonic-pi

Always up to date

The Sonic Pi Ubuntu PPA repository always contains the latest stable release for Ubuntu 14.04 "Trusty Tahr", 15.10 "Wily Werewolf" and 16.04 "Xenial Xerus". Just follow the "Adding this PPA to your system" instructions there.

Get Sonic Pi for

macOS

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

Built for Apple

Sonic Pi has been built as a self-contained macOS app ready for you to download and launch.

Just ensure you give Sonic Pi permission to run in the Security Preferences.

Sonic Pi for macOS

Download Sonic Pi v2.11.1 for macOS here.

Download

Compiled for 64 bit

Compiled for 64 bit architectures, Sonic Pi has been tested to run on OS X Mountain Lion through to macOS Sierra.