Skip to content

Instantly share code, notes, and snippets.

@josephwilk
Last active August 29, 2015 14:06
Show Gist options
  • Save josephwilk/3684a3ccac715c54ebaf to your computer and use it in GitHub Desktop.
Save josephwilk/3684a3ccac715c54ebaf to your computer and use it in GitHub Desktop.
degrees for sonic-pi
define :degrees do |degree,scale,root|
the_degrees = {:i => 1, :ii => 2, :iii => 3,
:iv => 4, :v => 5, :vi => 6,
:vii => 7, :_ => nil}
intervals = Scale::SCALE[scale]
intervals = intervals.cycle.take(the_degrees[degree]-1)
note(root) + intervals.reduce(0,:+)
end
play degrees(:i, :major, :A3)
sleep 1
play degrees(:iii, :major, :A3)
sleep 1
play degrees(:v, :major, :A3)
sleep 1
play degrees(:i, :minor, :A3)
sleep 1
play degrees(:ii, :minor, :A3)
sleep 1
play degrees(:iii, :minor, :A3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment