<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>GuruBlog : Articles about icontrol</title>
    <description>local-guru.net</description>
    <link>http://www.local-guru.net/blog</link>
    <ttl>40</ttl>
    <item>
      <title>Chuck iControl Projectpage</title>
      <link>http://www.local-guru.net//blog/2008/7/14/chuck-icontrol-projectpage</link>
      <description>&lt;p&gt;as written &lt;a href="http://www.local-guru.net/blog/articles/2008/05/22/chuck-icontrol"&gt;before&lt;/a&gt;,
i have started writing a chuck script that mapps the
midi-data from my iControl to OSC events. I now have set up a proper
&lt;a href="/blog/pages/chuckicontrol"&gt;project page&lt;/a&gt; for the script.&lt;/p&gt;
</description>
      <pubDate>2008-07-14T06:46:00+02:00</pubDate>
    </item>
    <item>
      <title>Processing OSC</title>
      <link>http://www.local-guru.net//blog/2008/7/4/processing-osc</link>
      <description>&lt;p&gt;I have recently posted about my &lt;a href="http://www.local-guru.net/blog/articles/2008/05/22/chuck-icontrol"&gt;chuck-script&lt;/a&gt; that
generates osc events from my m-audio iControl. Now i have written a &lt;a href="http://www.processing.org"&gt;Processing&lt;/a&gt;-sketch, that
visualizes the events. The OSC-Events are parsed using the &lt;a href="http://www.sojamo.de/libraries/oscP5"&gt;oscP5&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import oscP5.*;
import netP5.*;

OscP5 oscP5;
int buttons[] = {0,0,0,0,0,0,0,0};
float knobs[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

void setup() {
size(500,500);
frameRate(25);
background( 0 );
oscP5 = new OscP5( this, "239.0.0.1", 3334 );
}

void draw() {
drawControl();
}

void drawControl() {
smooth();
ellipseMode( CORNER );
for (int i = 0; i &amp;lt; 8; i++ ) {
    fill( 255 * buttons[i] );
    stroke( 255 );
    ellipse( 10, 20 + i * 20, 15, 15 );

    fill( 0 );
    rect( 40, 20 + i * 20, 100, 15 );  
    noStroke();
    fill( 0, 0, 128 );
    rect( 41, 21 + i * 20, 99 * knobs[i], 14 );  

}
}

void oscEvent( OscMessage m ) {
print( " pattern " + m.addrPattern());
println( " type " + m.typetag());
if (m.addrPattern().equals( "/icontrol/button" )) {
    int chan = m.get(0).intValue();
    int val = m.get(1).intValue();
    buttons[chan] = val;
} else if ( m.addrPattern().equals( "/icontrol/knob")) {
    int chan = m.get(0).intValue();
    float val = m.get(1).floatValue();
    knobs[chan] = val;
}
}
&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>2008-07-04T06:23:00+02:00</pubDate>
    </item>
    <item>
      <title>chuck icontrol</title>
      <link>http://www.local-guru.net//blog/2008/5/22/chuck-icontrol</link>
      <description>&lt;p&gt;I own a &lt;a href="http://createdigitalmusic.com/2005/04/08/m-audio-icontrol-new-hardware-for-garageband-analyzed/"&gt;m-audio icontrol&lt;/a&gt; and some time ago i started to play with
&lt;a href="http://chuck.cs.princeton.edu/"&gt;chuck&lt;/a&gt; a programming language for making electronic music. today
i managed to link them together and use my icontrol to start and stop
my chuck programms :-)&lt;/p&gt;

&lt;p&gt;next thing i will try is to convert the values from the "endless"-knobs to floats
and to pass messages to the sub programms&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;1 =&amp;gt; int device;

MidiIn min;
MidiOut mout;
MidiMsg msg;

// open the device
if( !min.open( device ) ) me.exit();
if( !mout.open( device ) ) me.exit();
[0,0,0,0,0,0,0,0] @=&amp;gt; int on[];
[-1, -1, -1, -1, -1, -1, -1, -1] @=&amp;gt; int ids[];
["beep.ck", "sing.ck", "autoloop.ck", "", "", "", "", "" ] @=&amp;gt; string names[];
while ( true ) {
    min =&amp;gt; now;

    // get the message(s)
    while( min.recv(msg) ) {
        // print out midi message
        &amp;lt;&amp;lt;&amp;lt; msg.data1, msg.data2, msg.data3 &amp;gt;&amp;gt;&amp;gt;;

        if ( msg.data1 == 176 &amp;amp;&amp;amp; msg.data2 &amp;gt;= 64 &amp;amp;&amp;amp; msg.data2 &amp;lt; 72 &amp;amp;&amp;amp; msg.data3 == 127 ) {
            msg.data2 - 64 =&amp;gt; int chan;
            if ( on[chan] == 1 ) {
                0 =&amp;gt; on[chan];
                sendOff( chan );
                if (ids[chan] &amp;gt; 0) {
                    Machine.remove( ids[ chan ] )
                        -1 =&amp;gt; ids[chan];
                    }
                } else {
                    1 =&amp;gt; on[chan];
                    sendOn( chan );
                    if ( names[chan] != "" ) {
                        Machine.add( names[chan] ) =&amp;gt; ids[chan];
                    }
                }
            }
            // send( msg.data1, msg.data2, msg.data3 );
        }
    }

    fun void sendOn( int chan ) {
    send( 176, 64 + chan , 127 );
    }

    fun void sendOff( int chan ) {
    send( 176, 64 + chan, 0 );
    }

    fun void send( int d1, int d2, int d3 ) {
        MidiMsg msg;
    d1 =&amp;gt; msg.data1;
    d2 =&amp;gt; msg.data2;
    d3 =&amp;gt; msg.data3;
    mout.send( msg );
    }
&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>2008-05-22T18:04:00+02:00</pubDate>
    </item>
  </channel>
</rss>

