Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

redis attempt failed, for timing reasons

  • Loading branch information...
commit dd2953d96069ac81db2de81780e1e9daa7cfd449 1 parent 99bfde6
Giles authored
Showing with 14 additions and 3 deletions.
  1. +6 −2 db_drum_definition.rb
  2. +1 −1  drums_live.rb
  3. +7 −0 readme.md
8 db_drum_definition.rb
View
@@ -1,3 +1,7 @@
+require 'redis'
+redis = Redis.new
+redis.set "current_probability_level", "0.9"
+
probabilities = {}
probabilities[:none] = [0.0] * 16
@@ -31,7 +35,7 @@
# ((1..6).to_a)[rand(6)] madness
def note(midi_note_number)
- Note.create(:channel => rand(7),
+ Note.create(:channel => 0,
:number => midi_note_number,
:duration => 0.25,
:velocity => 100 + rand(27))
@@ -41,7 +45,7 @@ def note(midi_note_number)
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number),
:when => L{|beat| false},
- :number_generator => L{0.9},
+ :number_generator => L{redis.get("current_probability_level").to_f},
# :number_generator => L{rand},
:next => L{|queue| queue[queue.size - 1]},
# :next => L{|queue| queue[rand(queue.size)]},
2  drums_live.rb
View
@@ -9,7 +9,7 @@
:evil_timer_offset_wtf => 0.2,
:midi => LiveMIDI.new(:clock => @clock, # meh
:logging => false,
- :midi_destination => 1),
+ :midi_destination => 0),
:generator => Rhythm.new(:drumfile => "db_drum_definition.rb",
:mutation => L{|measure| 0 == (measure - 1) % 2}))
@loop.generate_beats
7 readme.md
View
@@ -0,0 +1,7 @@
+my god, what a concept. a readme.
+
+so this was an aborted attempt to use Redis to control Archaeopteryx.
+
+more likely I'm either going to hook it into Ari Russo's UniMIDI, or finally get around to reading that Unix book that seems to drive the thinking behind everything at GitHub.
+
+possibly both.
Please sign in to comment.
Something went wrong with that request. Please try again.