
Make music with code for live performances and compositions. Learn programming concepts step by step for musicians with no prior knowledge, using notes and scales on any computer.
Explore Sonic Pi, a Ruby-based music framework by Sam Aaron, download and install on Windows, Mac, or Raspberry Pi, and join its free education-focused community for teaching kids to code.
Explore the Sonic Pi user interface by loading code, running and stopping it, recording output, saving and loading code, and navigating buffers, panels, and the help and preferences sections.
Learn to generate sound with Sonic Pi by using play and sleep to build notes, chords, and arpeggios, explore MIDI note numbers and BPM basics.
Use MIDI note names and numbers in Sonic Pi by prefixing notes with a colon, switching between major triad notes, flats and sharps, and adjusting octaves.
Master code comments in Sonic Pi by using the hash symbol to annotate a C minor arpeggio, with comments ignored during playback, and toggle them with command or control slash.
Use the log and lock windows to track Sonic Pi activity, verify notes at 48 (c3), 51 (d sharp three), and 55 (g3), and diagnose code behavior by scanning log.
Explore Sonic Pi play options to control note dynamics with amplitude and pan, and learn how left-right stereo placement and clipping influence individual notes.
Set and explore tempo in Sonic Pi by playing a note at 60, sleeping one beat between notes, and adjusting the default 60 BPM with use underscore BPM to 110.
Discover how Sonic Pi offers over forty built-in synths, switch sounds with use_synth, and experiment with tb303, blade, and profit for richer, more engaging tones.
Learn to apply synth filters in Sonic Pi by adjusting cutoff and resonance, hear how envelopes affect notes like E3, and use the log to track when actions occur.
Learn to use ADSR envelopes in Sonic Pi, configuring attack level, decay level, sustain level, and release to shape amplitude over time with the play command.
Discover how to play built-in and external samples in Sonic Pi using the sample keyword, control amplitude, rate, pan, and envelopes, and load samples from disk with zero-based folder indexing.
Explore program flow by examining sequence, selection, and iteration; learn how instructions run in order, use conditionals for decisions, and repeat patterns like a C major triad with sleeps.
Master loops in Sonic Pi to repeat a C major triad efficiently, using loop do end. Always include a sleep in each loop for readable, properly timed music.
Nest loops inside loops in Sonic Pi to create layered beats, using sleep timing and code formatting; build a bass drum with four closed hi-hats per beat for a groove.
Understand how infinite loops disrupt program flow and master looping with four dot times to structure kicks, hats, and a sample. Practice by typing the code and adding a snare.
Experiment with a four-beat loop to place a kick drum, high hats, and snare sample. Explore sequence and iterations in Sonic Pi to craft a pleasing beat as code.
Explore randomization in Sonic Pi to generate melodies by playing random notes between 50 and 100 with the rand command. Use use_random_seed for results, noting microtonal ideas in non-integer notes.
Explore generative music by applying randomisation to notes, timing, and samples in Sonic Pi, and experiment with envelopes, filters, and amplitudes.
Explore Sonic Pi's randomization functions, including run (0–1), rand (float), and rand_i (integers like 50–100), and apply them to notes, durations, and envelopes to spark generative possibilities.
Master selection in Sonic Pi by using comparison operators and boolean logic with if and IFF to decide which samples play.
Explore conditional logic in Sonic Pi by using if-else to route two execution paths, and blend randomness with rand to decide between samples like kick drum and open hi-hat.
Explore combining comparisons in Sonic Pi by using and (&&) and or (||) in if statements to decide when to play the open hi hat, cymbal, or bass drum.
Combine randomization functions with loops in Sonic Pi to generate generative music that selects cymbals or bass drum based on rand, and adjust with one_in two or one_in ten.
Discover a simpler, readable way to write if statements in Sonic Pi, using one-in-four and one-in-six probability to trigger samples and create looping, unpredictable music.
Variables act as named memory slots in Sonic Pi, storing values with equals and double equals for comparison, retrieving them later, and using samples like high hat, snare, and kick.
Track loop progress with a counter in Sonic Pi, looping 30 times to play increasing notes and sleep a quarter beat, then explore a shorter pipe-based version.
Master lists in Sonic Pi to simplify chord patterns with square-bracket lists. Learn to loop, sleep, and use choose to randomize notes, and store values in a scale_list for reuse.
Explore indexing in Sonic Pi by selecting specific items from a list using zero-based indices, with rests and a counter to loop through items for a simple drum sequencer.
Build a 16-step drum sequencer in sonic pi by defining sample variables and 16-character patterns, then loop to play hi-hat, snare, and kick.
Explore play_pattern and play_pattern_timed in Sonic Pi to play notes from a list, control timing with sleeps or rests, and create arpeggios with a chosen synth.
Learn to play chords in Sonic Pi, including major, minor, major seventh, and diminished, use indices to pick notes, and explore arpeggio timing and ring-based progressions with roman numerals.
Explore built-in scales in Sonic Pi, set a root note and three octaves, play a major pentatonic scale with precise timing and release, and log scale names for quick reference.
Explore how rings wrap a list in Sonic Pi, looping back to the first item after the end, preventing out-of-range errors and producing rests when an index is nil.
Master ring functions in Sonic Pi by applying reverse, shuffle, mirror, reflect, and more; take or drop elements, stretch timing, repeat, and chain patterns for looping music.
Learn to define functions with the defined keyword, creating verse and chorus blocks, then call them to assemble and reorder a simple song in Sonic Pi.
Learn how to pass parameters to functions in Sonic Pi, set default parameters, and reuse verses and choruses to organize code and make changes across a song.
Master over 40 built-in effects in Sonic Pi by wrapping sounds in an effects block to apply reverb, flanger, or distortion to samples or synthesizers.
Apply the echo effect in Sonic Pi by adjusting phase, amplitude, mix, and decay to shape a delayed sound across notes and samples.
Nest effects in sonic pi by wrapping one block inside another, applying echo first and then a reverb, to create layered sounds while noting potential performance impacts.
Learn to capture a running synth into a variable, then use control to modify notes, pan, and envelope-related parameters across the synth without redefining each play command.
Explore how to use Sonic Pi's control function to apply note slide, a glide between notes, by adding the note_slide parameter set to one beat.
Apply a bubble effect in Sonic Pi, declare a variable, and use control to modulate the wet mix in real time, exploring phase and phase slide.
Explore live performance with Sonic Pi's live_loop construct, allowing real-time code changes and simultaneous loops for drums, melody, and chords.
Convert a sequencer into a live performance setup by using named live loops for drums and bass, syncing them, and exploring minor pentatonic riffs with random seeds.
Enable incoming cues in preferences, connect your MIDI keyboard, and log note-ons and velocities in the cues panel; use real time to remove latency in Sonic Pi and trigger patterns.
Route MIDI out from Sonic Pi to an external analog synth and virtual instruments like Vital, using MIDI note on/off, channels, and velocity, with simple code demonstrating external synth control.
Route live audio into Sonic Pi from a microphone or guitar, enable inputs, name the input, and use an effects loop with reverb and distortion.
Explore the vast Sonic Pi library as you finish the course, encouraging hands-on experimentation, daily practice, and sharing code with the community to turn ideas into live performances.
Aimed at musicians with little or no coding experience, this fun course will teach you how to compose and perform music using code as your instrument. Based on the free Sonic Pi framework, popular in the Algorave scene, you'll cover everything from the very basics of programming to using Sonic Pi for live performance, including writing a drum sequencer. Later in the course, you'll even learn how to integrate your code with MIDI & audio instruments.
With four hours of video split across fifty lectures, you will find detailed descriptions and demonstrations of:
How to create music by coding musical patterns with synths and samples.
Fundamental programming concepts, including program flow and Sonic Pi's built-in data structures.
Creating a drum sequencer, looping melodies, chord progressions and bass lines from scratch.
How to use filters and ADSR envelopes for code-based sound design.
How to add effects such as distortion, delay and reverb to make your sounds more interesting.
How to control MIDI and audio from your code.
How to use the features of Sonic Pi to enhance your live performances.
We'll be using the free Sonic Pi throughout the course, and by the end, you'll be able to apply what you've learned to create unique musical compositions and perform live using code. As you’ll see, anyone can learn to program. We take each new concept step-by-step, and it’s easier than you think, even if you have absolutely no prior coding experience!