<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for addi.tv</title>
	<atom:link href="http://addi.tv/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://addi.tv</link>
	<description>simplicity+{complexity}</description>
	<lastBuildDate>Wed, 27 Mar 2013 11:32:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Sequencing and VJing: Iannix, Duration and my OSC to MIDI converter &#124; Bocho&#039;s Blog</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-1038</link>
		<dc:creator>Sequencing and VJing: Iannix, Duration and my OSC to MIDI converter &#124; Bocho&#039;s Blog</dc:creator>
		<pubDate>Wed, 27 Mar 2013 11:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-1038</guid>
		<description>[...] have tried a couple of tools out there: Moco and Konkreet but I have to say that they did not work they way I [...]</description>
		<content:encoded><![CDATA[<p>[...] have tried a couple of tools out there: Moco and Konkreet but I have to say that they did not work they way I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by additv</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-565</link>
		<dc:creator>additv</dc:creator>
		<pubDate>Fri, 18 May 2012 18:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-565</guid>
		<description>Cool! Glad to hear you&#039;re making good use of it!  If you have any videos I&#039;d love to see them.</description>
		<content:encoded><![CDATA[<p>Cool! Glad to hear you&#8217;re making good use of it!  If you have any videos I&#8217;d love to see them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Murilo Polese</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-564</link>
		<dc:creator>Murilo Polese</dc:creator>
		<pubDate>Fri, 18 May 2012 14:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-564</guid>
		<description>Man, that&#039;s really awsome!
I&#039;m using it for live performances with circuit bent devices and self made sequencers controlling Ableton Live and PureData.
I need to say, your software is really awsome!
Now with the code I&#039;m thinking about a &quot;sync&quot; functionality.
Thank you!</description>
		<content:encoded><![CDATA[<p>Man, that&#8217;s really awsome!<br />
I&#8217;m using it for live performances with circuit bent devices and self made sequencers controlling Ableton Live and PureData.<br />
I need to say, your software is really awsome!<br />
Now with the code I&#8217;m thinking about a &#8220;sync&#8221; functionality.<br />
Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Black Snow by tom</title>
		<link>http://addi.tv/black-snow/comment-page-1/#comment-540</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Sat, 28 Jan 2012 15:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=211#comment-540</guid>
		<description>Actual snow cannot be black-of course, so&#039;Black Snow&#039; here is the title of an artifact preconceived to use (white) snow as a part of it under that name.</description>
		<content:encoded><![CDATA[<p>Actual snow cannot be black-of course, so&#8217;Black Snow&#8217; here is the title of an artifact preconceived to use (white) snow as a part of it under that name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Mike</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-327</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 25 Oct 2011 13:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-327</guid>
		<description>Never mind, I had an outdated version of controlP5.</description>
		<content:encoded><![CDATA[<p>Never mind, I had an outdated version of controlP5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Mike</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-326</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 25 Oct 2011 01:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-326</guid>
		<description>Thanks for getting back so quickly.

The two for loops that added the controls for the midi ins and outs was a little strange.

Also, how did you manage when the midi controls use the same name?</description>
		<content:encoded><![CDATA[<p>Thanks for getting back so quickly.</p>
<p>The two for loops that added the controls for the midi ins and outs was a little strange.</p>
<p>Also, how did you manage when the midi controls use the same name?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by additv</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-325</link>
		<dc:creator>additv</dc:creator>
		<pubDate>Mon, 24 Oct 2011 14:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-325</guid>
		<description>Hi Mike,
Glad you like it!
I just threw up the code, so hopefully you can find what is causing you trouble!
Cheers!</description>
		<content:encoded><![CDATA[<p>Hi Mike,<br />
Glad you like it!<br />
I just threw up the code, so hopefully you can find what is causing you trouble!<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by additv</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-324</link>
		<dc:creator>additv</dc:creator>
		<pubDate>Mon, 24 Oct 2011 14:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-324</guid>
		<description>Hi Kasper, good eye, it *was* down in Processing with MidiBus, OSCP5, and ControlP5.
Though more accurately it was done in Eclipse (pure java) using the processing libs.
I&#039;d be happy to share the code.  It was just thrown together in an afternoon, so forgive me if it isn&#039;t tidy.
&lt;code&gt;

package moco;
/*
 * Moco: A Midi-OSC OSC-Midi converter
 * By Rob King 2010
 */
import javax.sound.midi.MidiMessage;

import netP5.NetAddress;
import oscP5.OscMessage;
import oscP5.OscP5;
import processing.core.PApplet;
import themidibus.MidiBus;
import controlP5.ControlEvent;
import controlP5.ControlP5;
import controlP5.RadioButton;
import controlP5.Textfield;
import controlP5.Toggle;


public class Moco extends PApplet {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1816549495367020936L;
	MidiBus midi = null;
	OscP5 osc = null;
	int oscRecievePort = 5005;
	
	NetAddress oscOuptutAddress;
	NetAddress oscLoopbackAddress;
	NetAddress oscLoopbackAddress2;
	NetAddress oscSend2;
	NetAddress oscSend3;
	
	String[] midiInputs;
	String[] midiOutputs;
	ControlP5 controlP5;
	
	Textfield cOSCRecievePort;
	Textfield cOSCSendPort;
	Textfield cOSCIP;
	RadioButton cMIDIIn;
	RadioButton cMIDIOut;
	Toggle cSendRaw;
	
	boolean midiRecieved = false;
	boolean oscRecieved  = false;
	
	boolean sendRawMidi = false;
	
	public void setup() {
		size(560,300);
		midi = new MidiBus(this);
		midiInputs = MidiBus.availableInputs();
		midiOutputs = MidiBus.availableOutputs();
		osc = new OscP5(this, oscRecievePort);
		oscOuptutAddress = new NetAddress(&quot;127.0.0.1&quot;, 5000);
		oscLoopbackAddress = new NetAddress(&quot;127.0.0.1&quot;, oscRecievePort);
		oscSend2 = new NetAddress(&quot;127.0.0.1&quot;, oscRecievePort+1);
		oscSend3 = new NetAddress(&quot;127.0.0.1&quot;, oscRecievePort+2);
		oscLoopbackAddress2 = new NetAddress(&quot;127.0.0.1&quot;, oscRecievePort+3);
		
		frame.setTitle(&quot;Moco&quot;);
		
		
		controlP5 = new ControlP5(this);

		
		controlP5.addTextlabel(&quot;MidiIns&quot;, &quot;Midi Inputs&quot;, 10, 20);
		cMIDIIn = controlP5.addRadioButton(&quot;midiInput&quot;, 10, 35);
		for(int i = 0; i&lt;midiInputs.length; i++)
			cMIDIIn.addItem(midiInputs[i], i);
		
		controlP5.addTextlabel(&quot;Title&quot;, &quot;Moco : MIDI - OSC Converter : addi.tv &quot;, 2, 2);
		
		controlP5.addTextlabel(&quot;OSC Output&quot;, &quot;OSC Output&quot;, 150, 20);
		cOSCSendPort = controlP5.addTextfield(&quot;OSC Sending Port&quot;, 150, 65, 100, 15);
		cOSCSendPort.setText(Integer.toString(oscOuptutAddress.port()));
		cOSCSendPort.setAutoClear(false);
		cOSCIP = controlP5.addTextfield(&quot;OSC Sending Address&quot;, 150, 35, 100, 15);
		cOSCIP.setText(oscOuptutAddress.address());
		cOSCIP.setAutoClear(false);
		cSendRaw = controlP5.addToggle(&quot;Send Raw Midi&quot;, sendRawMidi, 150, 95, 100, 15);
		
		controlP5.addTextlabel(&quot;OSC Input&quot;, &quot;OSC Input&quot;, 300, 20);
		cOSCRecievePort = controlP5.addTextfield(&quot;OSC Listening Port&quot;, 300, 35, 100, 15);
		cOSCRecievePort.setText(Integer.toString(oscRecievePort));
		cOSCRecievePort.setAutoClear(false);
		
		
		controlP5.addTextlabel(&quot;MidiOuts&quot;, &quot;Midi Outputs&quot;, 420, 20);
		cMIDIOut = controlP5.addRadioButton(&quot;midiOutput&quot;, 420, 35);
		for(int i = 0; i&lt;midiOutputs.length; i++)
			cMIDIOut.addItem(midiOutputs[i], i);
		
		
		controlP5.addTextarea(&quot;description&quot;, &quot;OSC Namespace:\n\n&quot; +
				&quot;/midi/noteon \n&quot; +
				&quot;   int:channel\n&quot; +
				&quot;   int:pitch\n&quot; +
				&quot;   int:velocity\n\n&quot; +
				&quot;/midi/noteoff \n&quot; +
				&quot;   int:channel\n&quot; +
				&quot;   int:pitch\n&quot; +
				&quot;   int:velocity\n\n&quot; +
				&quot;/midi/cc \n&quot; +
				&quot;   int:channel\n&quot; +
				&quot;   int:cc#\n&quot; +
				&quot;   int:value\n\n&quot; +
				&quot;/midi/raw \n&quot; +
				&quot;   ints:data\n&quot; +
				&quot;&quot;,  300, 90, 100, 200);
		
		
	}
	
	public void changeMIDIInput(String deviceName){
		midi.clearInputs();
		if(deviceName!=null){
			midi.addInput(deviceName);
			println(&quot;MidiDeviceChanged to &quot;+deviceName);
		}
	}
	public void changeMIDIOutput(String deviceName){
		midi.clearOutputs();
		if(deviceName!=null){
			midi.addOutput(deviceName);
			println(&quot;MidiDeviceChanged to &quot;+deviceName);
		}
	}
	
	public void changeOSCOutputAddress(String ip, int port){
		oscOuptutAddress = new NetAddress(ip, port);
		oscSend2 = new NetAddress(ip, port+2);
		oscSend3 = new NetAddress(ip, port+3);
	}
	public void changeOSCOutputAddress(String ip){
		oscOuptutAddress = new NetAddress(ip, oscOuptutAddress.port());
		oscSend2 = new NetAddress(ip, oscOuptutAddress.port()+2);
		oscSend3 = new NetAddress(ip, oscOuptutAddress.port()+3);
		println(&quot;Changing destination ip to &quot; + ip);
	}
	public void changeOSCOutputPort(int port){
		oscOuptutAddress = new NetAddress(oscOuptutAddress.address(), port);
	}
	public void changeOSCInputPort(int port){
		osc.stop();
		osc = new OscP5(this, port);
	}
	
	public void draw() {
		background(150);
		fill(100);
		stroke(255);

		
		if(midiRecieved){
			stroke(0, 255,0);
			midiRecieved = false;
		}else{
			stroke(255);
		}
		rect(5,15,250,height-20);
		line(70,22,140,22);
		line(140,22, 137,25);
		line(140,22, 137,19);
		
		if(oscRecieved){
			stroke(0, 255,0);
			oscRecieved = false;
		}else{
			stroke(255);
		}
		rect(295,15,255,height-20);
		line(350,22,410,22);
		line(410,22, 407,25);
		line(410,22, 407,19);
		
			
	}
	
	public void controlEvent(ControlEvent theEvent) {
		if(theEvent.isController()){
			if(theEvent.controller() == cOSCRecievePort){
				boolean canParsePort = false;
				try{
					Integer.valueOf(cOSCRecievePort.getText());
					canParsePort = true;
				}catch(NumberFormatException exc){
					System.err.println(&quot;Couldn&#039;t parse recieve port&quot;);
					cOSCRecievePort.setText(Integer.toString(oscRecievePort));
				}
				if(canParsePort)
					changeOSCInputPort(Integer.valueOf(cOSCRecievePort.getText()));
			}
			if(theEvent.controller() == cOSCSendPort){
				boolean canParsePort = false;
				try{
					Integer.valueOf(cOSCSendPort.getText());
					canParsePort = true;
				}catch(NumberFormatException exc){
					System.err.println(&quot;Couldn&#039;t parse recieve port&quot;);
					cOSCSendPort.setText(Integer.toString(oscOuptutAddress.port()));
				}
				if(canParsePort)
					changeOSCOutputPort(Integer.valueOf(cOSCSendPort.getText()));
			}
			if(theEvent.controller() == cOSCIP)
				changeOSCOutputAddress(cOSCIP.getText());
			if(theEvent.controller() == cSendRaw)
				sendRawMidi = cSendRaw.getState();
		}
		if(theEvent.isGroup()){
			if(theEvent.group() == cMIDIIn){
				if(theEvent.group().value() == -1)
					changeMIDIInput(null);
				else
					changeMIDIInput(midiInputs[(int)theEvent.group().value()]);
			}
			if(theEvent.group() == cMIDIOut){
				if(theEvent.group().value() == -1)
					changeMIDIOutput(null);
				else
					changeMIDIOutput(midiOutputs[(int)theEvent.group().value()]);
			}
		}
		  
	}
	

	public void noteOn(int channel, int pitch, int velocity) {
		
		OscMessage msg = new OscMessage(&quot;/midi/noteon&quot;);
		msg.add(channel);
		msg.add(pitch);
		msg.add(velocity);
		try{
			osc.send(msg, oscOuptutAddress);
			osc.send(msg, oscLoopbackAddress);
			osc.send(msg, oscLoopbackAddress2);
			osc.send(msg, oscSend2);
			osc.send(msg, oscSend3);
			
			println(&quot;Sent &quot; + msg + &quot; to &quot; + oscOuptutAddress);
		}catch (Exception e) {
			// TODO: handle exception
		}
	}

	public void noteOff(int channel, int pitch, int velocity) {
		OscMessage msg = new OscMessage(&quot;/midi/noteoff&quot;);
		msg.add(channel);
		msg.add(pitch);
		msg.add(velocity);
		try{
			osc.send(msg, oscOuptutAddress);
			osc.send(msg, oscLoopbackAddress);
			osc.send(msg, oscLoopbackAddress2);
			osc.send(msg, oscSend2);
			osc.send(msg, oscSend3);
		}catch (Exception e) {
			// TODO: handle exception
		}
	}

	public void controllerChange(int channel, int number, int value) {
		OscMessage msg = new OscMessage(&quot;/midi/cc&quot;);
		msg.add(channel);
		msg.add(number);
		msg.add(value);
		try{
			osc.send(msg, oscOuptutAddress);
			osc.send(msg, oscLoopbackAddress);
			osc.send(msg, oscLoopbackAddress2);
			osc.send(msg, oscSend2);
			osc.send(msg, oscSend3);
		}catch (Exception e) {
			// TODO: handle exception
		}
	}
	
	public void midiMessage(MidiMessage message) { 
		midiRecieved = true;
		OscMessage oscMessage = new OscMessage(&quot;/midi/raw&quot;);
		//print (&quot;Sent: &quot; );
		for(int i = 0; i&lt;message.getMessage().length; i++){
			oscMessage.add(message.getMessage()[i]);
			//print(message.getMessage()[i] + &quot; &quot;);
		}
		//println(&quot;&quot;);
		if(sendRawMidi){
			try{
				osc.send(oscMessage, oscOuptutAddress);
				osc.send(oscMessage, oscLoopbackAddress);
				osc.send(oscMessage, oscLoopbackAddress2);
				osc.send(oscMessage, oscSend2);
				osc.send(oscMessage, oscSend3);
			}catch (Exception e) {
				// TODO: handle exception
			}
		}
		
	}
	
	public void oscEvent(OscMessage theOscMessage) {
		  /* print the address pattern and the typetag of the received OscMessage */
		//println(theOscMessage);
		  oscRecieved = true;
			  if(theOscMessage.checkAddrPattern(&quot;/midi/raw&quot;)){
				 
				 int rawLength = theOscMessage.typetag().length();
				 byte[] midiData = new byte[rawLength];
				 //print(&quot;Got:  &quot;);
				 for(int i = 0; i&lt;rawLength; i++){
					 midiData[i] = (byte) theOscMessage.get(i).intValue();
					//print((byte) theOscMessage.get(i).intValue() + &quot; &quot;); 
				 }
				 println(&quot; : RAW&quot;);
				 	
				  
				 midi.sendMessage(midiData);
				 
		  	}

			  if(theOscMessage.checkAddrPattern(&quot;/midi/noteon&quot;)){
				  println(&quot;Sending noteon to &quot;+midi);
				  println(theOscMessage.get(0).intValue() + &quot; &quot;+  theOscMessage.get(1).intValue()+ &quot; &quot; + theOscMessage.get(2).intValue());
				  midi.sendNoteOn(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;
			  }
			  if(theOscMessage.checkAddrPattern(&quot;/midi/noteoff&quot;)){
				  midi.sendNoteOff(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;
			  }
			  if(theOscMessage.checkAddrPattern(&quot;/midi/cc&quot;)){
				  midi.sendControllerChange(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;
			  }
	}
	
	
	
	public static void main(String _args[]) {
		PApplet.main(new String[] { moco.Moco.class.getName() });
	}
}
&lt;/code&gt;

Your OSC monitor looks cool, I&#039;ve been building a monitor/recorder too so I&#039;ll have to check yours out.
Cheers!</description>
		<content:encoded><![CDATA[<p>Hi Kasper, good eye, it *was* down in Processing with MidiBus, OSCP5, and ControlP5.<br />
Though more accurately it was done in Eclipse (pure java) using the processing libs.<br />
I&#8217;d be happy to share the code.  It was just thrown together in an afternoon, so forgive me if it isn&#8217;t tidy.<br />
<code></p>
<p>package moco;<br />
/*<br />
 * Moco: A Midi-OSC OSC-Midi converter<br />
 * By Rob King 2010<br />
 */<br />
import javax.sound.midi.MidiMessage;</p>
<p>import netP5.NetAddress;<br />
import oscP5.OscMessage;<br />
import oscP5.OscP5;<br />
import processing.core.PApplet;<br />
import themidibus.MidiBus;<br />
import controlP5.ControlEvent;<br />
import controlP5.ControlP5;<br />
import controlP5.RadioButton;<br />
import controlP5.Textfield;<br />
import controlP5.Toggle;</p>
<p>public class Moco extends PApplet {</p>
<p>	/**<br />
	 *<br />
	 */<br />
	private static final long serialVersionUID = 1816549495367020936L;<br />
	MidiBus midi = null;<br />
	OscP5 osc = null;<br />
	int oscRecievePort = 5005;</p>
<p>	NetAddress oscOuptutAddress;<br />
	NetAddress oscLoopbackAddress;<br />
	NetAddress oscLoopbackAddress2;<br />
	NetAddress oscSend2;<br />
	NetAddress oscSend3;</p>
<p>	String[] midiInputs;<br />
	String[] midiOutputs;<br />
	ControlP5 controlP5;</p>
<p>	Textfield cOSCRecievePort;<br />
	Textfield cOSCSendPort;<br />
	Textfield cOSCIP;<br />
	RadioButton cMIDIIn;<br />
	RadioButton cMIDIOut;<br />
	Toggle cSendRaw;</p>
<p>	boolean midiRecieved = false;<br />
	boolean oscRecieved  = false;</p>
<p>	boolean sendRawMidi = false;</p>
<p>	public void setup() {<br />
		size(560,300);<br />
		midi = new MidiBus(this);<br />
		midiInputs = MidiBus.availableInputs();<br />
		midiOutputs = MidiBus.availableOutputs();<br />
		osc = new OscP5(this, oscRecievePort);<br />
		oscOuptutAddress = new NetAddress("127.0.0.1", 5000);<br />
		oscLoopbackAddress = new NetAddress("127.0.0.1", oscRecievePort);<br />
		oscSend2 = new NetAddress("127.0.0.1", oscRecievePort+1);<br />
		oscSend3 = new NetAddress("127.0.0.1", oscRecievePort+2);<br />
		oscLoopbackAddress2 = new NetAddress("127.0.0.1", oscRecievePort+3);</p>
<p>		frame.setTitle("Moco");</p>
<p>		controlP5 = new ControlP5(this);</p>
<p>		controlP5.addTextlabel("MidiIns", "Midi Inputs", 10, 20);<br />
		cMIDIIn = controlP5.addRadioButton("midiInput", 10, 35);<br />
		for(int i = 0; i<midiinputs .length; i++)<br />
			cMIDIIn.addItem(midiInputs[i], i);</p>
<p>		controlP5.addTextlabel("Title", "Moco : MIDI - OSC Converter : addi.tv ", 2, 2);</p>
<p>		controlP5.addTextlabel("OSC Output", "OSC Output", 150, 20);<br />
		cOSCSendPort = controlP5.addTextfield("OSC Sending Port", 150, 65, 100, 15);<br />
		cOSCSendPort.setText(Integer.toString(oscOuptutAddress.port()));<br />
		cOSCSendPort.setAutoClear(false);<br />
		cOSCIP = controlP5.addTextfield("OSC Sending Address", 150, 35, 100, 15);<br />
		cOSCIP.setText(oscOuptutAddress.address());<br />
		cOSCIP.setAutoClear(false);<br />
		cSendRaw = controlP5.addToggle("Send Raw Midi", sendRawMidi, 150, 95, 100, 15);</p>
<p>		controlP5.addTextlabel("OSC Input", "OSC Input", 300, 20);<br />
		cOSCRecievePort = controlP5.addTextfield("OSC Listening Port", 300, 35, 100, 15);<br />
		cOSCRecievePort.setText(Integer.toString(oscRecievePort));<br />
		cOSCRecievePort.setAutoClear(false);</p>
<p>		controlP5.addTextlabel("MidiOuts", "Midi Outputs", 420, 20);<br />
		cMIDIOut = controlP5.addRadioButton("midiOutput", 420, 35);<br />
		for(int i = 0; i<midiOutputs.length; i++)<br />
			cMIDIOut.addItem(midiOutputs[i], i);</p>
<p>		controlP5.addTextarea("description", "OSC Namespace:\n\n" +<br />
				"/midi/noteon \n" +<br />
				"   int:channel\n" +<br />
				"   int:pitch\n" +<br />
				"   int:velocity\n\n" +<br />
				"/midi/noteoff \n" +<br />
				"   int:channel\n" +<br />
				"   int:pitch\n" +<br />
				"   int:velocity\n\n" +<br />
				"/midi/cc \n" +<br />
				"   int:channel\n" +<br />
				"   int:cc#\n" +<br />
				"   int:value\n\n" +<br />
				"/midi/raw \n" +<br />
				"   ints:data\n" +<br />
				"",  300, 90, 100, 200);</p>
<p>	}</p>
<p>	public void changeMIDIInput(String deviceName){<br />
		midi.clearInputs();<br />
		if(deviceName!=null){<br />
			midi.addInput(deviceName);<br />
			println("MidiDeviceChanged to "+deviceName);<br />
		}<br />
	}<br />
	public void changeMIDIOutput(String deviceName){<br />
		midi.clearOutputs();<br />
		if(deviceName!=null){<br />
			midi.addOutput(deviceName);<br />
			println("MidiDeviceChanged to "+deviceName);<br />
		}<br />
	}</p>
<p>	public void changeOSCOutputAddress(String ip, int port){<br />
		oscOuptutAddress = new NetAddress(ip, port);<br />
		oscSend2 = new NetAddress(ip, port+2);<br />
		oscSend3 = new NetAddress(ip, port+3);<br />
	}<br />
	public void changeOSCOutputAddress(String ip){<br />
		oscOuptutAddress = new NetAddress(ip, oscOuptutAddress.port());<br />
		oscSend2 = new NetAddress(ip, oscOuptutAddress.port()+2);<br />
		oscSend3 = new NetAddress(ip, oscOuptutAddress.port()+3);<br />
		println("Changing destination ip to " + ip);<br />
	}<br />
	public void changeOSCOutputPort(int port){<br />
		oscOuptutAddress = new NetAddress(oscOuptutAddress.address(), port);<br />
	}<br />
	public void changeOSCInputPort(int port){<br />
		osc.stop();<br />
		osc = new OscP5(this, port);<br />
	}</p>
<p>	public void draw() {<br />
		background(150);<br />
		fill(100);<br />
		stroke(255);</p>
<p>		if(midiRecieved){<br />
			stroke(0, 255,0);<br />
			midiRecieved = false;<br />
		}else{<br />
			stroke(255);<br />
		}<br />
		rect(5,15,250,height-20);<br />
		line(70,22,140,22);<br />
		line(140,22, 137,25);<br />
		line(140,22, 137,19);</p>
<p>		if(oscRecieved){<br />
			stroke(0, 255,0);<br />
			oscRecieved = false;<br />
		}else{<br />
			stroke(255);<br />
		}<br />
		rect(295,15,255,height-20);<br />
		line(350,22,410,22);<br />
		line(410,22, 407,25);<br />
		line(410,22, 407,19);</p>
<p>	}</p>
<p>	public void controlEvent(ControlEvent theEvent) {<br />
		if(theEvent.isController()){<br />
			if(theEvent.controller() == cOSCRecievePort){<br />
				boolean canParsePort = false;<br />
				try{<br />
					Integer.valueOf(cOSCRecievePort.getText());<br />
					canParsePort = true;<br />
				}catch(NumberFormatException exc){<br />
					System.err.println("Couldn't parse recieve port");<br />
					cOSCRecievePort.setText(Integer.toString(oscRecievePort));<br />
				}<br />
				if(canParsePort)<br />
					changeOSCInputPort(Integer.valueOf(cOSCRecievePort.getText()));<br />
			}<br />
			if(theEvent.controller() == cOSCSendPort){<br />
				boolean canParsePort = false;<br />
				try{<br />
					Integer.valueOf(cOSCSendPort.getText());<br />
					canParsePort = true;<br />
				}catch(NumberFormatException exc){<br />
					System.err.println("Couldn't parse recieve port");<br />
					cOSCSendPort.setText(Integer.toString(oscOuptutAddress.port()));<br />
				}<br />
				if(canParsePort)<br />
					changeOSCOutputPort(Integer.valueOf(cOSCSendPort.getText()));<br />
			}<br />
			if(theEvent.controller() == cOSCIP)<br />
				changeOSCOutputAddress(cOSCIP.getText());<br />
			if(theEvent.controller() == cSendRaw)<br />
				sendRawMidi = cSendRaw.getState();<br />
		}<br />
		if(theEvent.isGroup()){<br />
			if(theEvent.group() == cMIDIIn){<br />
				if(theEvent.group().value() == -1)<br />
					changeMIDIInput(null);<br />
				else<br />
					changeMIDIInput(midiInputs[(int)theEvent.group().value()]);<br />
			}<br />
			if(theEvent.group() == cMIDIOut){<br />
				if(theEvent.group().value() == -1)<br />
					changeMIDIOutput(null);<br />
				else<br />
					changeMIDIOutput(midiOutputs[(int)theEvent.group().value()]);<br />
			}<br />
		}</p>
<p>	}</p>
<p>	public void noteOn(int channel, int pitch, int velocity) {</p>
<p>		OscMessage msg = new OscMessage("/midi/noteon");<br />
		msg.add(channel);<br />
		msg.add(pitch);<br />
		msg.add(velocity);<br />
		try{<br />
			osc.send(msg, oscOuptutAddress);<br />
			osc.send(msg, oscLoopbackAddress);<br />
			osc.send(msg, oscLoopbackAddress2);<br />
			osc.send(msg, oscSend2);<br />
			osc.send(msg, oscSend3);</p>
<p>			println("Sent " + msg + " to " + oscOuptutAddress);<br />
		}catch (Exception e) {<br />
			// TODO: handle exception<br />
		}<br />
	}</p>
<p>	public void noteOff(int channel, int pitch, int velocity) {<br />
		OscMessage msg = new OscMessage("/midi/noteoff");<br />
		msg.add(channel);<br />
		msg.add(pitch);<br />
		msg.add(velocity);<br />
		try{<br />
			osc.send(msg, oscOuptutAddress);<br />
			osc.send(msg, oscLoopbackAddress);<br />
			osc.send(msg, oscLoopbackAddress2);<br />
			osc.send(msg, oscSend2);<br />
			osc.send(msg, oscSend3);<br />
		}catch (Exception e) {<br />
			// TODO: handle exception<br />
		}<br />
	}</p>
<p>	public void controllerChange(int channel, int number, int value) {<br />
		OscMessage msg = new OscMessage("/midi/cc");<br />
		msg.add(channel);<br />
		msg.add(number);<br />
		msg.add(value);<br />
		try{<br />
			osc.send(msg, oscOuptutAddress);<br />
			osc.send(msg, oscLoopbackAddress);<br />
			osc.send(msg, oscLoopbackAddress2);<br />
			osc.send(msg, oscSend2);<br />
			osc.send(msg, oscSend3);<br />
		}catch (Exception e) {<br />
			// TODO: handle exception<br />
		}<br />
	}</p>
<p>	public void midiMessage(MidiMessage message) {<br />
		midiRecieved = true;<br />
		OscMessage oscMessage = new OscMessage("/midi/raw");<br />
		//print ("Sent: " );<br />
		for(int i = 0; i<message.getMessage().length; i++){<br />
			oscMessage.add(message.getMessage()[i]);<br />
			//print(message.getMessage()[i] + " ");<br />
		}<br />
		//println("");<br />
		if(sendRawMidi){<br />
			try{<br />
				osc.send(oscMessage, oscOuptutAddress);<br />
				osc.send(oscMessage, oscLoopbackAddress);<br />
				osc.send(oscMessage, oscLoopbackAddress2);<br />
				osc.send(oscMessage, oscSend2);<br />
				osc.send(oscMessage, oscSend3);<br />
			}catch (Exception e) {<br />
				// TODO: handle exception<br />
			}<br />
		}</p>
<p>	}</p>
<p>	public void oscEvent(OscMessage theOscMessage) {<br />
		  /* print the address pattern and the typetag of the received OscMessage */<br />
		//println(theOscMessage);<br />
		  oscRecieved = true;<br />
			  if(theOscMessage.checkAddrPattern("/midi/raw")){</p>
<p>				 int rawLength = theOscMessage.typetag().length();<br />
				 byte[] midiData = new byte[rawLength];<br />
				 //print("Got:  ");<br />
				 for(int i = 0; i<rawLength; i++){<br />
					 midiData[i] = (byte) theOscMessage.get(i).intValue();<br />
					//print((byte) theOscMessage.get(i).intValue() + " ");<br />
				 }<br />
				 println(" : RAW");</p>
<p>				 midi.sendMessage(midiData);</p>
<p>		  	}</p>
<p>			  if(theOscMessage.checkAddrPattern("/midi/noteon")){<br />
				  println("Sending noteon to "+midi);<br />
				  println(theOscMessage.get(0).intValue() + " "+  theOscMessage.get(1).intValue()+ " " + theOscMessage.get(2).intValue());<br />
				  midi.sendNoteOn(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;<br />
			  }<br />
			  if(theOscMessage.checkAddrPattern("/midi/noteoff")){<br />
				  midi.sendNoteOff(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;<br />
			  }<br />
			  if(theOscMessage.checkAddrPattern("/midi/cc")){<br />
				  midi.sendControllerChange(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue()) ;<br />
			  }<br />
	}</p>
<p>	public static void main(String _args[]) {<br />
		PApplet.main(new String[] { moco.Moco.class.getName() });<br />
	}<br />
}<br />
</code></p>
<p>Your OSC monitor looks cool, I've been building a monitor/recorder too so I'll have to check yours out.<br />
Cheers!</midiinputs></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Mike</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-323</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 24 Oct 2011 03:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-323</guid>
		<description>Hey, I ran across your project last week and I love it. I do have a quick question though- it seems like the raw midi messages I receive are being translated to decimal before being send out via osc. I&#039;ve tried to see if there&#039;s some type of conversion going on, but it&#039;s almost inconsistent.

I&#039;m a programmer so I poked around the class files a bit but couldn&#039;t find anything. Just wondering if you can shed some light on the situation.</description>
		<content:encoded><![CDATA[<p>Hey, I ran across your project last week and I love it. I do have a quick question though- it seems like the raw midi messages I receive are being translated to decimal before being send out via osc. I&#8217;ve tried to see if there&#8217;s some type of conversion going on, but it&#8217;s almost inconsistent.</p>
<p>I&#8217;m a programmer so I poked around the class files a bit but couldn&#8217;t find anything. Just wondering if you can shed some light on the situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Moco: MIDI &#8211; OSC Converter by Kasper</title>
		<link>http://addi.tv/moco/comment-page-1/#comment-322</link>
		<dc:creator>Kasper</dc:creator>
		<pubDate>Fri, 14 Oct 2011 10:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://addi.tv/?p=271#comment-322</guid>
		<description>Hi,

Did you make this with Processing (I seem to recognize ControlP5). Do you mind sharing your code? I&#039;d like to build something similar, so maybe I can build on your code. 

By the way if you need an OSC monitor I build this in Processing:
http://code.google.com/p/osc-tools/

Thank you in advance. 

Kasper</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Did you make this with Processing (I seem to recognize ControlP5). Do you mind sharing your code? I&#8217;d like to build something similar, so maybe I can build on your code. </p>
<p>By the way if you need an OSC monitor I build this in Processing:<br />
<a href="http://code.google.com/p/osc-tools/" rel="nofollow">http://code.google.com/p/osc-tools/</a></p>
<p>Thank you in advance. </p>
<p>Kasper</p>
]]></content:encoded>
	</item>
</channel>
</rss>
