Data Sheet

Bonus chapter.indd 11 Trim size: 7.375 in × 9.1875 in October 24, 2017 7:20 PM
BC11BONUS CHAPTER 1 QUICK REFERENCE TABLES
Chapter 7
Sonic Pi Command Quick Reference Table
Command Description
live_loop :name do...end
Runs any code between do and end at the same time
as another
live_loop block.
play x
Plays note x.
play_pattern
[60,60,67,67,69,69,67]
Plays a pattern of notes inside a list.
rand
Returns a random number.
.reverse
An algorithm that reverses the order of notes in a list.
.shuffle
An algorithm that shufes the order of notes in a list.
use_synth :fm
Sets the synth sound; in this example, the fm sound.
with_fx :reverb do...end
Adds an effect to a block of sounds; in this example,
reverb is added to any code between
do and end.
x.times do...end
Runs any code between do and end x number of
times.
Achievement Unlocked: Head bopping, toe tapping creator of coded
computer music with Sonic Pi!