use Hash
{noteA => chanceA, noteB => chanceB, noteC => chanceC}
random choose note by chance
def picker(options)
current, max = 0, options.values.inject(:+)
random_value = rrand(0,max)
options.each do |key,val|
current += val
return key if random_value <= current
end
end
opti = {:C4=>1, :D4=>2, :E4=>3 }
9.times do
play picker(opti)
sleep 0.25
end
random_value should use rrand(0,max), not rand(max)+1