<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: How should my program collect MIDI messages?</title>
	<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages/</link>
	<description>Comments on Ask MetaFilter post How should my program collect MIDI messages?</description>
	<pubDate>Sat, 13 Oct 2007 18:38:26 -0800</pubDate>
	<lastBuildDate>Sat, 13 Oct 2007 18:38:26 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: How should my program collect MIDI messages?</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages</link>	
		<description>Where can I find enough info on Windows&apos; MIDI API to start using it?

 &lt;br /&gt;&lt;br /&gt; I have a Behringer controller with a &quot;USB MIDI&quot; interface (a USB cable goes straight from the box to the computer). I want to catch the messages sent from this unit in a Matlab program. There should be built-in support for this in Windows, but I don&apos;t find much documentation about it. Can someone please explain to me what DLL or ActiveX element to load, how to create a session, what functions to call and all the other details needed to see some MIDI messages on the screen?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.73756</guid>
		<pubDate>Sat, 13 Oct 2007 18:11:31 -0800</pubDate>
		<dc:creator>springload</dc:creator>
		
			<category>midi</category>
		
			<category>api</category>
		
			<category>matlab</category>
		
			<category>windows</category>
		
	</item> <item>
		<title>By: teraflop</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097113</link>	
		<description>If you want to access the MIDI API directly, &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms712733.aspx&quot;&gt;the MSDN documentation&lt;/a&gt; is probably the best place to start. It looks like most of the functions you&apos;ll need are in winmm.dll. &lt;br&gt;
&lt;br&gt;
I don&apos;t know how easy that will be to interface with Matlab, though; does it even support event-driven programming?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097113</guid>
		<pubDate>Sat, 13 Oct 2007 18:38:26 -0800</pubDate>
		<dc:creator>teraflop</dc:creator>
	</item><item>
		<title>By: springload</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097288</link>	
		<description>teraflop: With the basic DLL support, a native Matlab callback would likely be at least very hard to implement. The easiest thing for me would be a dll function that returns with the message as soon as it has arrived. Any recommendations for a wrapper that can do something like this?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097288</guid>
		<pubDate>Sun, 14 Oct 2007 04:21:29 -0800</pubDate>
		<dc:creator>springload</dc:creator>
	</item><item>
		<title>By: moonmilk</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097305</link>	
		<description>Do you need to do this in realtime?  If not, you could use any freeware midi-recording software to capture a .mid file.  Then you can either parse the file in Matlab, or use a utility like &lt;a href=&quot;http://www.fourmilab.ch/webtools/midicsv/&quot;&gt;MIDICSV&lt;/a&gt; or &lt;a href=&quot;http://interglacial.com/~sburke/midi-perl/&quot;&gt;MIDI-Perl&lt;/a&gt; to convert the data to something easier for Matlab to read.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097305</guid>
		<pubDate>Sun, 14 Oct 2007 07:07:59 -0800</pubDate>
		<dc:creator>moonmilk</dc:creator>
	</item><item>
		<title>By: cmicali</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097306</link>	
		<description>A quick googling for matlab midi brough up the &lt;a href=&quot;http://www.jyu.fi/musica/miditoolbox/&quot;&gt;Matlab Midi Toolbox&lt;/a&gt; .. might be worth looking into.&lt;br&gt;
&lt;br&gt;
I&apos;m not too familiar with matlab and what it supports, but C#/.NET is probably the easiest way to get started.  &lt;a href=&quot;http://www.codeproject.com/cs/media/MIDIToolkit.asp&quot;&gt; seems fairly robust.&lt;br&gt;
&lt;br&gt;
If you are ever working with MIDI, &lt;a href=&quot;http://www.borg.com/%7Ejglatt/&quot;&gt;jglatt&apos;s resource center&lt;/a&gt; should be your #1 bookmark.&lt;/a&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097306</guid>
		<pubDate>Sun, 14 Oct 2007 07:08:04 -0800</pubDate>
		<dc:creator>cmicali</dc:creator>
	</item><item>
		<title>By: springload</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097331</link>	
		<description>moonmilk: Unfortunately, this has to be done in realtime, message by message.&lt;br&gt;
&lt;br&gt;
cmicali: I&apos;ve snoped around jglatt&apos;s site, and it contains some nice information. .NET components can be accessed from Matlab, though I&apos;m not sure how to go about it. A solution like that is one option, accessing winmm.dll from a MEX file (Matlab&apos;s C interface) is another one. Again, details and alternatives are most welcome - I&apos;m very inexperienced with API interfacing.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097331</guid>
		<pubDate>Sun, 14 Oct 2007 08:13:55 -0800</pubDate>
		<dc:creator>springload</dc:creator>
	</item><item>
		<title>By: springload</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1097551</link>	
		<description>Another possibility: Matlab can quite easily use Java classes. JavaSound seems to have useful MIDI functions, but I don&apos;t know where to find it. I tried to install a recent Java SDK, but I still can&apos;t find it. Should I look for a jar file with a different name?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1097551</guid>
		<pubDate>Sun, 14 Oct 2007 14:32:48 -0800</pubDate>
		<dc:creator>springload</dc:creator>
	</item><item>
		<title>By: plinth</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1098060</link>	
		<description>I wrote some code 8 years ago to made the MIDI APIs available to Java on the PC.  If you want, I&apos;ll dig out the source code for you.  I never did any code for input, but if I recall correctly, the input routines are in the same family/region as the output routines.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1098060</guid>
		<pubDate>Mon, 15 Oct 2007 06:32:03 -0800</pubDate>
		<dc:creator>plinth</dc:creator>
	</item><item>
		<title>By: springload</title>
		<link>http://ask.metafilter.com/73756/How-should-my-program-collect-MIDI-messages#1099969</link>	
		<description>For the record: I ended up using the COM interface of MIXI-OX. Thanks for the advice, everybody.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.73756-1099969</guid>
		<pubDate>Tue, 16 Oct 2007 14:31:16 -0800</pubDate>
		<dc:creator>springload</dc:creator>
	</item>
	</channel>
</rss>
