Skip to content

Instantly share code, notes, and snippets.

@mrjoshida
Last active January 3, 2021 21:05
Show Gist options
  • Save mrjoshida/d08c49a491d4fc621de0e180a234d86d to your computer and use it in GitHub Desktop.
Save mrjoshida/d08c49a491d4fc621de0e180a234d86d to your computer and use it in GitHub Desktop.
Starter code for the Chapter 3 project The Shape of Sounds in the book Coding and the Arts (creativecodingbook.com). Paste into Sonic Pi to run.
use_bpm 120
define :my_sound do |n|
play n,
attack: 0.5,
attack_level: 1,
decay: 0.25,
sustain_level: 0.4,
sustain: 0.75,
release: 0.5
end
my_sound('C')
sleep 1
my_sound('D')
sleep 1
my_sound('E')
sleep 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment