This file contains hidden or 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
use_random_seed(1) | |
t = 0 | |
m = 0 | |
# t goes from 0 to 9, which is 3 measures | |
live_loop :main do | |
cue :_whatnow_ if t.modulo(3)==0 && m<6 | |
cue :_boom_ if t==0 && m>=1 | |
cue :_wizz_ if t==0 && m>=2 && m<6 |
This file contains hidden or 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
#sonic pi | |
#a piece inspired from Ambien Experiment code by Darin Wilson | |
#a is the array, i is the previous index. returns a new index in a, in probability close to i. | |
#The distance is abs(i - j) | |
#never mind...it just help me remember what the function does | |
def perlin(a, i) | |
#create array with probabilities as a function of distance | |
#the indexes of this new array represent distances from i | |
a2 = Array.new(a.length){|index| Math.exp(a.length - index)} |