Last active
August 29, 2015 14:02
-
-
Save xavriley/b7ad02fd94593c53c095 to your computer and use it in GitHub Desktop.
Sonic Pi random beat slicer in a tweet (140 chars)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}} |
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
had to cheat a little bit by hard coding a sleep value