Skip to content

Instantly share code, notes, and snippets.

@xavriley
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavriley/b7ad02fd94593c53c095 to your computer and use it in GitHub Desktop.
Save xavriley/b7ad02fd94593c53c095 to your computer and use it in GitHub Desktop.
Sonic Pi random beat slicer in a tweet (140 chars)
# better version that doesn't hard code sleep time - try changing loop_amen to another sample!
s=:loop_amen;n=16;b=(0..1).step(1.0/n).each_cons(2).to_a.shuffle;loop{b.each{|p|sample s,start:p[0],finish:p[1];sleep sample_duration(s)/n}}
@xavriley
Copy link
Author

had to cheat a little bit by hard coding a sleep value

@xavriley
Copy link
Author

Updated to version without hard coded value now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment