Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 958 Bytes
$clock.bpm = 175
$mutation = L{|measure| 0 == (measure - 1) % 2}
$measures = 4
probabilities = {}
<% probabilities.each_with_index do |ps, i| %>
probabilities[<%= 36 + i %>] = <%= ps.inspect %>
<% end %>
def note(midi_note_number)
Note.create(:channel => 2,
:number => midi_note_number,
:duration => 0.25,
:velocity => 100 + rand(27))
end
static = L{1.0}
dynamic = L{rand}
check_every_drum = L{|queue| queue[queue.size - 1]}
check_random_drums = L{|queue| queue[rand(queue.size)]}
notes = []
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number),
:when => L{|beat| false},
# :number_generator => static,
:number_generator => dynamic,
# :next => check_every_drum,
:next => check_random_drums,
:probabilities => probabilities[midi_note_number])
end
notes