1. Home
  2. /
  3. Sonic-pi-live
  4. /
  5. Arpeggio Pattern

Arpeggio Pattern - Sonic-pi-live Typing CST Test

Loading…

Arpeggio Pattern — Sonic-pi-live Code

A live loop creating a simple arpeggio pattern with a synth.

live_loop :arpeggio do
	use_synth :piano
	play_pattern_timed chord(:C4, :major), 0.25
	sleep 1
end

Sonic-pi-live Language Guide

Sonic Pi is a live coding environment designed for creating music through code. It allows users to write Ruby-based scripts that generate real-time audio, enabling both learning and performance in music programming.

Primary Use Cases

  • ▸Teaching programming through music
  • ▸Algorithmic and generative composition
  • ▸Live music performance and improvisation
  • ▸Interactive sound installations
  • ▸Exploring synthesis, effects, and audio experimentation

Notable Features

  • ▸Live coding environment with immediate audio feedback
  • ▸Built-in synthesizers, samples, and effects
  • ▸Concurrency with multiple live threads
  • ▸Integration of MIDI and external instruments
  • ▸Cross-platform and open-source

Origin & Creator

Created by Sam Aaron at the University of Cambridge, first released in 2012, inspired by the use of live coding for both education and performance.

Industrial Note

Primarily used in education, music performance, workshops, and experimental art; rarely used in mainstream music production but influential in live coding communities.

Quick Explain

  • ▸Sonic Pi uses code to produce sounds, sequences, and rhythms in real-time.
  • ▸It combines music composition with programming education, teaching loops, functions, and concurrency.
  • ▸Supports synthesizers, samples, effects, and live manipulation of sound parameters.
  • ▸Designed for live performance, algorithmic composition, and interactive music coding.
  • ▸Can run on multiple platforms including Windows, macOS, Linux, and Raspberry Pi.

Core Features

  • ▸Ruby-based scripting language
  • ▸Use of sleep, loops, and functions for timing and structure
  • ▸Synth and sample playback
  • ▸Effects like reverb, echo, distortion
  • ▸Live code update without stopping the sound

Learning Path

  • ▸Learn basic Ruby syntax and commands in Sonic Pi
  • ▸Understand sleep, loops, and live loops
  • ▸Explore synths, samples, and effects
  • ▸Practice layering and concurrency
  • ▸Experiment with live coding performances

Practical Examples

  • ▸Play a basic melody using a synth and sleep commands
  • ▸Create a drum beat with samples in a live loop
  • ▸Layer multiple live loops for a complex rhythm
  • ▸Apply effects like echo and reverb to a melody
  • ▸Generate algorithmic music using randomization and control structures

Comparisons

  • ▸Sonic Pi vs DAWs: DAWs are GUI-based; Sonic Pi is code-based
  • ▸Sonic Pi vs Pure Data: Sonic Pi is Ruby-based, simpler for beginners
  • ▸Sonic Pi vs Max/MSP: Max is visual; Sonic Pi is text/live coding
  • ▸Sonic Pi vs TidalCycles: Tidal uses Haskell; Sonic Pi uses Ruby
  • ▸Sonic Pi vs traditional instruments: Digital live coding, flexible but requires programming

Strengths

  • ▸Immediate feedback encourages experimentation
  • ▸Educationally powerful for learning coding and music together
  • ▸Supports creative, algorithmic composition
  • ▸Live coding performance ready
  • ▸Highly extensible with samples, MIDI, and effects

Limitations

  • ▸Not a full-featured DAW for commercial music production
  • ▸Learning curve for non-programmers
  • ▸Timing-sensitive code may require precision
  • ▸Limited built-in instruments compared to professional DAWs
  • ▸Dependent on computer performance for real-time audio

When NOT to Use

  • ▸Professional commercial music production requiring advanced mixing
  • ▸Audio mastering workflows
  • ▸Complex orchestral scoring
  • ▸Non-coding-based music production
  • ▸Extremely low-latency professional setups beyond hobbyist or teaching

Cheat Sheet

  • ▸play :c4 - plays note C4
  • ▸sleep 1 - pauses for 1 beat
  • ▸live_loop :drums do ... end - creates repeating loop
  • ▸use_synth :prophet - sets synthesizer
  • ▸sample :loop_amen - plays built-in sample

FAQ

  • ▸Can Sonic Pi connect to MIDI? -> Yes, supports MIDI in/out.
  • ▸Is Sonic Pi suitable for live performance? -> Yes, designed for live coding.
  • ▸Do I need to know Ruby? -> Basic Ruby syntax is helpful.
  • ▸Can Sonic Pi run on Raspberry Pi? -> Yes, fully supported.
  • ▸Where to learn Sonic Pi? -> Official docs, tutorials, workshops.

30-Day Skill Plan

  • ▸Week 1: Basic melodies and beats
  • ▸Week 2: Live loops with multiple layers
  • ▸Week 3: Applying effects and sample manipulation
  • ▸Week 4: Algorithmic and generative compositions
  • ▸Week 5: Live performance and improvisation practice

Final Summary

  • ▸Sonic Pi is a live coding platform for music creation using code.
  • ▸It is educational, performative, and experimental.
  • ▸Supports real-time synthesis, sampling, and effects.
  • ▸Enables algorithmic composition and interactive performances.
  • ▸Ideal for learning coding through music and live coding artistry.

Project Structure

  • ▸Single script or multiple scripts using 'require' for modularity
  • ▸Live loops and functions define musical structures
  • ▸Comments for musical notation or code explanation
  • ▸Optional sample directories for audio files
  • ▸Output audio routed to system or MIDI devices

Monetization

  • ▸Workshops and live coding events
  • ▸Educational course material
  • ▸Music compositions and recordings
  • ▸Community coding challenges and competitions
  • ▸Content creation for YouTube or tutorials

Productivity Tips

  • ▸Start small with basic loops
  • ▸Experiment with synths and samples incrementally
  • ▸Use effects sparingly at first
  • ▸Organize code for readability during live performance
  • ▸Practice improvisation with live loops

Basic Concepts

  • ▸Code is executed in real-time to produce sound.
  • ▸Sleep determines the timing between notes.
  • ▸Live loops allow concurrent, repeating musical patterns.
  • ▸Synths and samples define the type of sound produced.
  • ▸Effects modify sound in real-time during playback.

Official Docs

  • ▸https://sonic-pi.net/
  • ▸https://github.com/samaaron/sonic-pi

More Sonic-pi-live Typing Exercises

Simple Live Loop Beat in Sonic PiLayered Live Loop Melody and DrumsRandom MelodyDrum FillBass Line GrooveChord ProgressionEcho Effect LoopReverb Drum LoopStep Sequencer Pattern

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher