<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mostly a codeBlog &#187; Midipipe</title>
	<atom:link href="http://www.rickigregersen.com/tag/midipipe/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rickigregersen.com</link>
	<description>whatever I am currently programming... and I truly digress</description>
	<lastBuildDate>Mon, 21 Jun 2010 15:40:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>DTXplorer drum kit goes Processing</title>
		<link>http://www.rickigregersen.com/2009/09/09/dtxplorer-drum-kit-goes-processing/</link>
		<comments>http://www.rickigregersen.com/2009/09/09/dtxplorer-drum-kit-goes-processing/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 00:01:27 +0000</pubDate>
		<dc:creator>Ricki</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[drum]]></category>
		<category><![CDATA[DTXplorer]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[MIDI]]></category>
		<category><![CDATA[Midipipe]]></category>
		<category><![CDATA[OSC]]></category>
		<category><![CDATA[Osculator]]></category>

		<guid isPermaLink="false">http://www.rickigregersen.com/?p=199</guid>
		<description><![CDATA[This my DTXplorer drumkit getting feed into MidiPipe onto Osculator and finally ends up in Processing. Now thats beat detection! I have taken some time to get my Yamaha DTXplorer electronic drums to communicate nicely with my Mac, finally it worked out and I can now &#8220;harvest&#8221; the sweet, sweet MIDI coming from the drums. [...]]]></description>
			<content:encoded><![CDATA[<h5>This my DTXplorer drumkit getting feed into MidiPipe onto Osculator and finally ends up in Processing. Now thats beat detection!</h5>
<p><a href="http://www.rickigregersen.com/2009/09/09/dtxplorer-drum-kit-goes-processing/"><em>Click here to view the embedded video.</em></a></p><br />
<p><a href="http://www.rickigregersen.com/2009/09/09/dtxplorer-drum-kit-goes-processing/"><em>Click here to view the embedded video.</em></a></p>
<p>I have taken some time to get my <a href="http://www.yamaha.com/drums/drumproductdetail.html?CNTID=544640&amp;CTID=5040587">Yamaha DTXplorer</a> electronic drums to communicate nicely with my Mac, finally it worked out and I can now &#8220;harvest&#8221; the sweet, sweet MIDI coming from the drums. Im no Moby, so believe me when I say these last one and a half days of frustrations was not to immortalize the sound of my drumming. It was, of course to get the data into <a href="http://www.processing.org">Processing</a>. A friend of mine is a DJ and he wanted us to experiment with playing &#8220;live&#8221; drums along with the turntables. Furthermore, to make some sort of visualization that would be 100% true to the beat. This is very hard I found out, there are a lot of good sound libraries with beat detection out there, but they are never plug n&#8217; play. You need to tweak your code for every single song and even that is no guarantee for a consistent output. I came up with a pretty straight forward solution, if we were to use the electronic drums anyway we could just as well use the MIDI for the beat detection and then have the turntables control the colors.</p>
<p>I found out that I needed a few different applications and a MIDI cable before I got the signal all the way through. First off is the <a href="http://www.esi-audio.com/products/midimate2/">ESI MidiMate</a> cable, I actually had the old model, but I think it was broken and could not handle if the MIDI in was not connected to a ground plane. It was 295 Danish Kroner ( ≈$55 ). Then I needed <a href="http://web.mac.com/nicowald/SubtleSoft/MidiPipe.html">MidiPipe</a>. This a free application developed by Nico Wald and it is brilliant! Should I ever make any money with this setup I will run to a browser and donate some money to Nico.<br />
The idea with MidiPipe is that it &#8220;hijacks&#8221; every single MIDI port it can detect on the system, you then drag the one you need to the pipe(ESI MIDIMATE Port 1 turn up in MidiPipe the second I connected it to the drumkit) you can then drag other stuff into the pipe. I dragged in &#8220;AList&#8221; from the &#8220;Modifier&#8221; and that gave me just what it says, a list of all midi signals passing through MidiPipe.</p>
<div id="attachment_201" class="wp-caption aligncenter" style="width: 506px"><a href="http://www.rickigregersen.com/wp-content/uploads/midipipe.png"><img class="size-full wp-image-201" title="midipipe" src="http://www.rickigregersen.com/wp-content/uploads/midipipe.png" alt="MidiPipe is a life-saver" width="496" height="512" /></a><p class="wp-caption-text">MidiPipe is a life-saver</p></div>
<p>This was a cool way of testing out the drums. Lastly I dragged a &#8220;MIDI out&#8221; into the Pipe, more about that in a second. Then I went out and finally bought that license for <a href="http://www.osculator.net/wp/">OSCulator</a>. Osculator have been running my Wiimote, iPhone, Arduino and Make controller for the last year and I have been to lazy/cheap to just buy the license. Well Osculator is a $15 minimum, but Camille asks people nicely to pay $39, which I did, of course, having used his software for about a year now. What Osculator can do is just to much to explain here&#8230; I needed it to translate my MIDI into OSC (because OSC is the new MIDI <img src='http://www.rickigregersen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) and then relay the rewritten data to a port on localhost using UDP. This was done so I could have some control over the data, also I now get something along the lines of &#8220;snare &#8211; on &#8211; 0.6&#8243; (thats the pad sending the message, that it was &#8220;on&#8221;/hit and the strength it was hit with) into Processing instead of some MIDI byte I have to bitwise shift around to get any data from it, it just makes debugging easier and sending something through Osculator opens a world of other possibilities.</p>
<div id="attachment_204" class="wp-caption aligncenter" style="width: 522px"><a href="http://www.rickigregersen.com/wp-content/uploads/osculator1.png"><img class="size-full wp-image-204" title="osculator" src="http://www.rickigregersen.com/wp-content/uploads/osculator1.png" alt="It is just crazy how many features there can be in such a simple application" width="512" height="484" /></a><p class="wp-caption-text">It is just crazy how many features there can be in such a simple application</p></div>
<p>A note here, when I started Osculator, MidiPipe noticed Osculator was listening on port 8000 and stuffed that piece of information into the &#8220;MIDI out&#8221; I mentioned earlier, now I could just select it there. So now my MIDI came in through MidiPipe, was listed for me to see and then relayed on to Osculator. In Osculator I caught each MIDI event and by selecting the signal and going Osculator &#8211; Edit &#8211; Demux, I could split the signal into its components and rebroadcast them as OSC messages on the network. For handling OSC Protocol stuff in Processing Andreas Schlegel did a really great library, you can get it <a href="http://www.sojamo.de/libraries/oscP5/">here</a> along with some other goodies Andreas made.</p>
<p>I now had 8 different OSC messages, one for each drum pad, cymbal and foot pedal (Im going to do the high hat pedal later on) that I can read out in Processing. I did a small sketch as you see in the video and just started the &#8220;play along&#8221; feature on my DTXplorer kit, with some &#8220;Hard Rock&#8221; <img src='http://www.rickigregersen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  selected and and the computers microphone recording.</p>
<p>And as always if there is some code or help You need just leave a mail or comment.</p>
<p><a href="http://www.rickigregersen.com/wp-content/uploads/midiProcessing.mov">A version not completely compressed by the geniuses over at youtube</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickigregersen.com/2009/09/09/dtxplorer-drum-kit-goes-processing/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
<enclosure url="http://www.rickigregersen.com/wp-content/uploads/midiProcessing.mov" length="1515678" type="video/quicktime" />
		</item>
	</channel>
</rss>
