<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>apps/stretta/blinkin_lights_without_midi.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,7 @@ require File.dirname(__FILE__) + '/../../lib/monomer'
 
 class BlinkinLights &lt; Monomer::Listener
   before_start do
+    @midi = Monomer::MidiOut.new
     @spawn_rate = 1
     @sustain = 3
   end
@@ -30,8 +31,10 @@ class BlinkinLights &lt; Monomer::Listener
     x = monome.rand_x
     y = monome.rand_y
     monome.led_on(x,y)
+    @midi.on(x * 8) rescue nil #need to figure out what the midi integers really mean...
     sleep sustain
     monome.led_off(x,y)
+    @midi.off(x * 8) rescue nil
   end
   
 end</diff>
      <filename>apps/stretta/blinkin_lights.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class PressCoffee &lt; Monomer::Listener
     patterns_to_play.each_with_index do |pattern, index|
       
       if pattern
-        monome.light_column(index, *pattern)
+        monome.light_column(index, pattern)
         @midi.prepare_note(:duration =&gt; 0.5, :note =&gt; 40 + index) if pattern[monome.max_y] == 1
       end
       </diff>
      <filename>apps/stretta/press_coffee.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,17 @@ module Monomer
       end
       
       def light_column(col, *pattern)
-        send_col(col, pattern.to_s.to_i(2))
+        split_patterns = []
+        (0...(pattern.size / 8)).each {|i| split_patterns &lt;&lt; pattern.slice(i*8, 8)}
+        split_patterns.map!{|i| i.to_s.to_i(2)}
+        send_col(col, split_patterns)
+      end
+      
+      def light_row(row, *pattern)
+        split_patterns = []
+        (0...(pattern.size / 8)).each {|i| split_patterns &lt;&lt; pattern.slice(i*8, 8)}
+        split_patterns.map!{|i| i.to_s.to_i(2)}
+        send_row(row, split_patterns)
       end
       
       def clear
@@ -89,12 +99,12 @@ module Monomer
         @client.send(OSC::Message.new(&quot;#{@prefix}/led&quot;, nil, x,y, led_status))
       end
       
-      def send_row(row_num, decimal)
-        @client.send(OSC::Message.new(&quot;#{@prefix}/led_row&quot;, nil, row_num, decimal))
+      def send_row(row_num, decimals)
+        @client.send(OSC::Message.new(&quot;#{@prefix}/led_row&quot;, nil, row_num, *decimals))
       end
       
-      def send_col(col_num, decimal)
-        @client.send(OSC::Message.new(&quot;#{@prefix}/led_col&quot;, nil, col_num, decimal))
+      def send_col(col_num, decimals)
+        @client.send(OSC::Message.new(&quot;#{@prefix}/led_col&quot;, nil, col_num, *decimals))
       end
       
       def send_frame(offset_x, offset_y, c1, c2, c3, c4, c5, c6, c7, c8)</diff>
      <filename>lib/monomer/core/communicator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,24 +6,30 @@ module Monomer
     
     extend Core::Timer
     
-    def self.loop_on_button_sustain(x=:any, y=:any, &amp;block)
-      postfix = determine_postfix(x,y)
+    def self.loop_on_button_sustain(register_x=:any, register_y=:any, &amp;block)
+      postfix = determine_postfix(register_x,register_y)
       
-      meta_def &quot;listen_for_button_sustain_on do#{postfix}&quot; do |x,y|
-        @key_threads[[x,y]] = Thread.new do
+      sustain_on = &lt;&lt;-EVIL
+      meta_def &quot;listen_for_button_sustain_on#{postfix}&quot; do |x,y|
+        @key_threads[[x,y, '#{postfix}']] = Thread.new do
           change_to_s_of_this_thread_to_map_to_calling_class
           loop do
             block.call(x,y)
           end
         end
       end
+      EVIL
+      eval sustain_on
       
+      sustain_off = &lt;&lt;-EVIL2
       meta_def &quot;listen_for_button_sustain_off#{postfix}&quot; do |x,y|
-        if thread = @key_threads[[x,y]]
+        if thread = @key_threads[[x,y, '#{postfix}']]
           thread.kill
-          @key_threads[[x,y]] = nil
+          @key_threads[[x,y, '#{postfix}']] = nil
         end
       end
+      EVIL2
+      eval sustain_off
     end
     
     def self.before_start(&amp;block)
@@ -52,8 +58,8 @@ module Monomer
       end
     end
     
-    def self.on_button_press(x=:any, y=:any, &amp;block)
-      postfix = determine_postfix(x,y)
+    def self.on_button_press(register_x=:any, register_y=:any, &amp;block)
+      postfix = determine_postfix(register_x,register_y)
       
       meta_def &quot;listen_for_button_pressed#{postfix}&quot; do |x,y|
         Thread.new do
@@ -63,8 +69,8 @@ module Monomer
       end
     end
     
-    def self.on_button_release(x=:any, y=:any, &amp;block)
-      postfix = determine_postfix(x,y)
+    def self.on_button_release(register_x=:any, register_y=:any, &amp;block)
+      postfix = determine_postfix(register_x,register_y)
       
       meta_def &quot;listen_for_button_released#{postfix}&quot; do |x,y|
         Thread.new do</diff>
      <filename>lib/monomer/listener.rb</filename>
    </modified>
    <modified>
      <diff>@@ -104,14 +104,18 @@ module Monomer
     end
     
     def clear_column(col)
-      col__light_pattern = (0..max_y).map{|y|led_off(col,y)}.map{|need_to_turn_off| need_to_turn_off ? 0 : 1}
-      light_column(col, *col__light_pattern)
+      col_light_pattern = (0..max_y).map{|y|led_off(col,y)}.map{|need_to_turn_off| need_to_turn_off ? 0 : 1}
+      light_column(col, col_light_pattern)
     end
     
-    def light_column(col, *pattern)
+    def light_column(col, pattern)
       @communicator.light_column(col, *pattern)
     end
     
+    def light_row(row, pattern)
+      @communicator.light_row(row, *pattern)
+    end
+    
     def clear
       @communicator.clear
     end</diff>
      <filename>lib/monomer/monome.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>apps/stretta/blinkin_lights_with_midi.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8f30b689d008d25d13c7f44e1033affbdc26c0dc</id>
    </parent>
  </parents>
  <author>
    <name>Sam Aaron</name>
    <email>samaaron@gmail.com</email>
  </author>
  <url>http://github.com/samaaron/monomer/commit/369bf85edbe108875096d9d0bee7ac7a1a8770e9</url>
  <id>369bf85edbe108875096d9d0bee7ac7a1a8770e9</id>
  <committed-date>2008-06-28T16:11:34-07:00</committed-date>
  <authored-date>2008-06-28T16:11:34-07:00</authored-date>
  <message>added the ability to light rows and columns with arrays of patterns (correctly deals with the 128, and therefore hopefully the 256)</message>
  <tree>994ef4799ac9a233e53e6385527b1bb1006f3950</tree>
  <committer>
    <name>Sam Aaron</name>
    <email>samaaron@gmail.com</email>
  </committer>
</commit>
