Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 35 lines (30 sloc) 1.512 kb
150acc4 @gilesbowkett More progress. Now I have major triads and a bassline, following the cir...
authored
1 probabilities = {}
2
3 probabilities[:none] = [0.0] * 16
4 probabilities[:all] = [1.0] * 16
5
6 probabilities[36] = [0.23, 0.0, 0.0, 0.0, 0.0, 0.0, 0.23, 0.0, 0.0, 0.0, 0.0, 0.0, 0.23, 0.0, 0.0, 0.0]
7 probabilities[37] = [0.0, 0.0, 0.0, 0.0, 0.23, 0.0, 0.0, 0.0, 0.0, 0.0, 0.23, 0.0, 0.0, 0.0, 0.0, 0.0]
8 probabilities[38] = [0.2, 0.0, 0.3, 0.0, 0.3, 0.1, 0.3, 0.4, 0.0, 0.0, 0.2, 0.0, 0.4, 0.0, 0.0, 0.0]
9 probabilities[39] = [0.3, 0.0, 0.2, 0.6, 0.1, 0.0, 0.4, 0.1, 0.35, 0.15, 0.0, 0.0, 0.2, 0.0, 0.1, 0.0]
10 probabilities[40] = [0.0, 0.0, 0.2, 0.0, 0.4, 0.0, 0.0, 0.0, 0.2, 0.0, 0.3, 0.0, 0.3, 0.1, 0.3, 0.4]
11 probabilities[41] = [0.32, 0.0, 0.23, 0.0, 0.0, 0.0, 0.23, 0.0, 0.15, 0.0, 0.15, 0.0, 0.29, 0.0, 0.15, 0.0]
12 probabilities[42] = [0.23, 0.0, 0.13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.13, 0.0, 0.23, 0.0, 0.0, 0.35, 0.0]
13 probabilities[43] = [0.3] * 16
14 probabilities[44] = [0.15] * 16
15 probabilities[45] = [0.32, 0.23] * 8
16
17 def note(midi_note_number, channel)
18 Note.create(:channel => channel,
19 :number => midi_note_number,
20 :duration => 0.25,
21 :velocity => 100 + rand(27))
22 end
23
24 notes = []
5abd15a @gilesbowkett Got the ambient thing working to the point where I can call it done. Sta...
authored
25 if rand > 0.95
26 (36..45).each do |midi_note_number|
27 notes << Drum.new(:note => note(midi_note_number, 3),
28 :when => L{|beat| false},
29 :number_generator => L{rand},
30 :next => L{|queue| queue[rand(queue.size)]},
31 :probabilities => probabilities[midi_note_number] || probabilities[:none])
32 end
150acc4 @gilesbowkett More progress. Now I have major triads and a bassline, following the cir...
authored
33 end
34 notes
Something went wrong with that request. Please try again.