<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/instruments/monome/grid_keyboard.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,54 +1,24 @@
+require 'rubygems'
+require 'midiator'
+require 'datagrammer'
 require 'lib/ourouborous'
+require 'lib/interfaces/midiator'
 require 'lib/devices/monome'
-# require 'lib/sequencers/tape'
+require 'lib/instruments/monome/grid_keyboard'
 
-class GridKeyboard
-  attr_accessor :rows, :cols, :grid, :sequencer, :step_x, :step_y, :basenote, :velocity, :notes
-  attr_accessor :interface
-  
-  include Ourouborous::MIDI::Generator
-  
-  def initialize(cols, rows, options={})
-    super
-    @rows = rows
-    @cols = cols
-    
-    @step_x = options[:step_x] || 2
-    @step_y = options[:step_y] || 5
-    @basenote = options[:basenote] || 36
-    @velocity = options[:velocity] || 100
-    @notes = Array.new(128, 0)
-    
-    @grid = Monome::Grid.new(cols, rows, L{|c,r,v| press(c,r,v) })
-    # @sequencer = 
-  end
-  
-  def press(col, row, val)
-    pitch = (col * @step_x) + ((@rows.last - row - 1) * @step_y) + @basenote
-    light(pitch, val)
-    note(pitch, val)
-  end
-  
-  def light(pitch, val)
-    @notes[pitch] = [(@notes[pitch] + (val.zero? ? -1 : 1)), 0].max
-    if (@notes[pitch].zero? &amp;&amp; val.zero?) || (@notes[pitch] == 1 &amp;&amp; val.nonzero?)
-      pitch_to_coords(pitch).compact.each {|x,y| val ? @grid.on(x,y) : @grid.off(x,y) }
-    end
-  end
-  
-  def pitch_to_coords(pitch)
-    rows.collect do |row|
-      col = ((pitch - @basenote) - ((row - @rows.first) * @step_y)) / (@step_x * 1.0)
-      if @cols.include?(col) &amp;&amp; col == col.round
-        [col.to_i, row]
-      else 
-        nil
-      end
-    end
-  end
-  
-  def note(pitch, val)
-    note_on(1, pitch, val.zero?? 0 : @velocity)
-  end
-  
-end
\ No newline at end of file
+require 'ruby-debug'
+Debugger.start
+
+@s = Ourouborous::Scheduler.new :timekeeper =&gt; Ourouborous::LocalTimer.new(120)
+
+@midi = Midiator.new
+@monome = Monome.new
+@s.subscribers &lt;&lt; @monome
+
+@keyboard = GridKeyboard.new(0..15, 0..15, :interface =&gt; @midi, :channel =&gt; 3)
+@monome.add_subgrid @keyboard.grid
+
+Signal.trap(&quot;INT&quot;) { @s.timekeeper.thread.exit!; @monome.clear; &quot;Interrupt caught, cancelling...&quot; }
+
+@s.start
+@s.timekeeper.thread.join
\ No newline at end of file</diff>
      <filename>examples/monome_keys.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5c06655c8fb45a45a9a00becfc0bde31ec4d6673</id>
    </parent>
  </parents>
  <author>
    <name>Matt Lyon</name>
    <email>matt@flowerpowered.com</email>
  </author>
  <url>http://github.com/mattly/ourouborous/commit/7d3b910aec5c9711ced9ba4f765ea6feef58efc7</url>
  <id>7d3b910aec5c9711ced9ba4f765ea6feef58efc7</id>
  <committed-date>2008-11-06T16:45:18-08:00</committed-date>
  <authored-date>2008-11-06T16:45:18-08:00</authored-date>
  <message>my version of the fourths patch</message>
  <tree>a26d4b6e8b41fdeadb933892791fc711e41bd58c</tree>
  <committer>
    <name>Matt Lyon</name>
    <email>matt@flowerpowered.com</email>
  </committer>
</commit>
