<?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>Wouter Hisschemöller &#187; MIDI</title>
	<atom:link href="http://www.hisschemoller.com/category/midi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hisschemoller.com</link>
	<description>Flash actionscript and audio programming. And Java.</description>
	<lastBuildDate>Sun, 25 Sep 2011 19:53:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Euclidean Pattern Generator 1.1 &#8211; OSC support</title>
		<link>http://www.hisschemoller.com/2011/euclidean-pattern-generator-1-1-osc-support/</link>
		<comments>http://www.hisschemoller.com/2011/euclidean-pattern-generator-1-1-osc-support/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 19:53:29 +0000</pubDate>
		<dc:creator>Wouter</dc:creator>
				<category><![CDATA[Euclidean rhythms]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MIDI]]></category>
		<category><![CDATA[OSC]]></category>

		<guid isPermaLink="false">http://www.hisschemoller.com/?p=770</guid>
		<description><![CDATA[Summer is at it’s end and it’s time to do some programming again. The Euclidean rhythms application I made earlier this year still has a lot of potential for new functionality, so here is the new version 1.1. The main new feature in this version is support for Open Sound Control (OSC). After the last [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_771" class="wp-caption alignright" style="width: 268px"><img class="size-full wp-image-771" title="Pure Data OSC patch" src="http://www.hisschemoller.com/wp-content/uploads/2011/09/puredatapatch.gif" alt="Pure Data OSC patch" width="268" height="214" /><p class="wp-caption-text">Pure Data OSC test patch</p></div>Summer is at it’s end and it’s time to do some programming again. The Euclidean rhythms application I made earlier this year still has a lot of potential for new functionality, so here is the new version 1.1.</p>
<p>The main new feature in this version is support for <a href="http://opensoundcontrol.org">Open Sound Control</a> (OSC). After the last version a great offer came from programmer Michael Heuer to collaborate and add OSC support to the application. So this part of the program is very much his work. You can view more of his <a href="http://github.com/heuermh">projects on GitHub</a>.</p>
<p><span id="more-770"></span></p>
<h2>The application</h2>
<p><div id="attachment_772" class="wp-caption aligncenter" style="width: 540px"><img class="size-full wp-image-772" title="Euclidean Pattern Generator v1.1" src="http://www.hisschemoller.com/wp-content/uploads/2011/09/app_whole.jpg" alt="Euclidean Pattern Generator v1.1" width="540" height="371" /><p class="wp-caption-text">Euclidean Pattern Generator v1.1</p></div>
<p>As usual here are some download links for the app and the source files. Note that the application is now released under the GPL v3 license. If you’re a developer you might find it easiest to visit the GitHub repository.</p>
<p><a href="http://www.hisschemoller.com/projects/v022_epg_1_1/epg_1_1_jar.zip">Download Java JAR file.</a><br />
<a href="http://www.hisschemoller.com/projects/v022_epg_1_1/epg_1_1_app.zip">Download Mac OS X APP file.</a><br />
<a href="http://www.hisschemoller.com/projects/v022_epg_1_1/epg_1_1_project.zip">Download Java source files (Eclipse project), JAR and APP, all in one ZIP file.</a><br />
<a href="https://github.com/WouterHisschemoller/Euclidean-Pattern-Generator/tree/v1.1">GitHub repository for the Euclidean Pattern Generator.</a></p>
<h2>The OSC implementation</h2>
<p>All OSC messages are sent to ‘localhost’ on a port number you can specify yourself. In the top part of the application I added a text input labelled ‘OSC Port’. Here you can enter the port number of the receiving OSC server you want to send the OSC messages to.</p>
<p>Because there is a choice now between MIDI and OSC I added checkboxes ‘Send OSC’ and ‘Send MIDI’. Only when these are checked OSC and / or MIDI messages will actually be sent.</p>
<p>The receiving OSC application is able to identify which pattern sent the message if an address for the pattern is entered.<br />
In the pattern’s MIDI / OSC Settings panel there is a new text input field labelled ‘OSC Address’. This field is automatically filled with a default address ‘/eu/patternX’ where ‘X’ is a number that is auto-increased with each new created pattern. Of course you can use your own preferred address naming scheme as well.</p>
<p>Here is a video that demonstrates sending OSC messages from the application to a Pure Data patch.</p>
<p><iframe class="youtube-player" type="text/html" width="540" height="335" src="http://www.youtube.com/embed/5x_FaPc8grU" frameborder="0"><br />
</iframe></p>
<h2>Other new features</h2>
<p>Next to the Open Sound Control support there are a number of other new features, some of which were requested by users in comments on the previous version.</p>
<ul>
<li>Step duration (quantization) from 4 beats (one 4/4 measure) to 1/8 beat (1/32 note).</li>
<li>Tempo maximum increased to 300 BPM.</li>
<li>Pattern length up to 64 steps. The pattern grows in size to accommodate the number of step circles.</li>
<li>Patterns can be named. New text input <em>Pattern name</em> in the pattern’s <em>Other Settings</em> panel. Whatever is typed here appears under the pattern graphic. When there are a lot of patterns in a project it’s easy to lose track of which pattern does what, so now you can name them ‘kick’, ‘snare’ etc.</li>
<li>‘All Notes Off’ button to kill hanging notes. This sends an ‘All Notes Off’ MIDI Channel Mode Message  to each channel. All Notes Off is actually MIDI CC #123 with value 0 (see the <a href="http://www.midi.org/techspecs/midimessages.php">MIDI specification</a>).</li>
<li>New patterns start with velocity 10 (handy in live situations where you don’t want a new pattern to come in at full volume).</li>
<li>Preferences: Several settings are automatically stored and recalled the next time you open the application.
<ul>
<li>Window size and position.</li>
<li>MIDI enabled and MIDI Out port.</li>
<li>OSC enabled and OSC port number.</li>
<li>Last used directory to open or save a project.</li>
</ul>
</li>
</ul>
<p>And lastly, not really a new feature, but ‘behind the scenes’ the user interface now uses <a href="http://www.swixml.org">SwiXML</a>, a layout engine that uses XML files to define an interface built with Java Swing components. This makes the interface much more flexible and easier to maintain for future changes.</p>
<h2>Next version</h2>
<p>In the next version I’ll add MIDI input and I hope it will be possible to get the app to synchronize to external MIDI clock. That would be cool.</p>
<p>And I’d like to add triplets to the quantization options. For even more unusual polyrhythms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hisschemoller.com/2011/euclidean-pattern-generator-1-1-osc-support/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Euclidean MIDI Patterns</title>
		<link>http://www.hisschemoller.com/2011/euclidean-midi-patterns/</link>
		<comments>http://www.hisschemoller.com/2011/euclidean-midi-patterns/#comments</comments>
		<pubDate>Sun, 22 May 2011 13:48:55 +0000</pubDate>
		<dc:creator>Wouter</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[MIDI]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[euclidean]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[midi]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[polyrhythms]]></category>
		<category><![CDATA[rhythm]]></category>

		<guid isPermaLink="false">http://www.hisschemoller.com/?p=645</guid>
		<description><![CDATA[In January I posted a Euclidean rhythm generator in Flash. Polyrhythms generated by a mathematical algorithm. I wanted the next version to be able to send MIDI, so I could use it with software like Ableton Live and hardware music machines like my Elektron Machinedrum. Since Flash doesn’t do MIDI I spent the last few [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_646" class="wp-caption alignright" style="width: 270px"><a href="http://www.hisschemoller.com/2011/euclidean-midi-patterns/java_euclid_1/" rel="attachment wp-att-646"><img src="http://www.hisschemoller.com/wp-content/uploads/2011/05/java_euclid_1.jpg" alt="Euclidean MIDI patterns screenshot" title="Screenshot" width="270" height="200" class="size-full wp-image-646" /></a><p class="wp-caption-text">Screenshot</p></div>In January I <a href="http://www.hisschemoller.com/2011/euclidean-rhythms/">posted</a> a Euclidean rhythm generator in Flash. Polyrhythms generated by a mathematical algorithm. I wanted the next version to be able to send MIDI, so I could use it with software like <a href="http://www.ableton.com/live">Ableton Live</a> and hardware music machines like my <a href="http://www.vintagesynth.com/misc/machinedrum.php">Elektron Machinedrum</a>.</p>
<p>Since Flash doesn’t do MIDI I spent the last few months learning Java and rebuilt the pattern generator to add MIDI capabilities. </p>
<p><span id="more-645"></span></p>
<h1>Running the application</h1>
<p>The Java app doesn’t run in the browser, so I can’t show it embedded on the web page like I’m used to with Flash projects. Instead you’ll have to download the Java .jar file and run it on your computer like you would any regular desktop application. For Mac users there’s a OS X .app file as well.<br />
I haven’t looked into creating an .exe file for Windows users yet, but double clicking the .jar file should start up the program just like an .exe.</p>
<p><a href="http://www.hisschemoller.com/projects/v021_euclid_midi_java/euclidean_midi_patterns_jar.zip">Download Java JAR file.</a> *<br />
<a href="http://www.hisschemoller.com/projects/v021_euclid_midi_java/euclidean_midi_patterns_app.zip">Download Mac OS X APP file.</a><br />
<a href="http://www.hisschemoller.com/projects/v021_euclid_midi_java/euclidean_midi_patterns_project.zip">Download Java source files (Eclipse project), JAR and APP, all in one ZIP file.</a></p>
<p>* The JAR file needs the runtime for Java v1.6 (also known as Java SE 6) to be installed. On Mac this version is automatically installed with OS X 10.6 (Snow Leopard), but OS X 10.5 (Leopard) has the older Java v1.5 (or J2SE 5.0). I tested on Windows XP with Java v1.6 and that runs fine. You can test your Java version by opening Command Prompt (Windows) or Terminal (OS X) and typing &#8220;java -version&#8221; (without the quatation marks and press return after typing).</p>
<p>To compensate for the lack of an embedded app here’s a video with a short overview of what the Euclidean Pattern Sequencer does:</p>
<p><iframe class="youtube-player" type="text/html" width="540" height="335" src="http://www.youtube.com/embed/KKbYdExy3jQ" frameborder="0"><br />
</iframe><br />
</p>
<h1>Features</h1>
<p>The features are basic in this first version:</p>
<ul>
<li>Double click anywhere in the lower panel to generate a new pattern. A new pattern is 16 steps with 4 notes by default.</li>
<li>Click a pattern’s center circle to select the pattern. A selected pattern shows a double center ring and it’s settings are displayed on the panel at the right.</li>
<li>Drag a pattern’s center circle to move the pattern. So you can visually reorganize your screen when there’s a lot of patterns.</li>
<li>All patterns with their settings and location can be saved in a file. This is a regular XML text file. The File menu has the familiar New, Open, Save and Save As options. The project tempo is saved in the file as well.</li>
</ul>
<p><div id="attachment_706" class="wp-caption aligncenter" style="width: 512px"><img src="http://www.hisschemoller.com/wp-content/uploads/2011/05/euclidean_java_controls2.jpg" alt="Pattern generator control bar" title="euclidean_java_controls2" width="512" height="111" class="size-full wp-image-706" /><p class="wp-caption-text">Pattern generator control bar</p></div>
<p><div id="attachment_709" class="wp-caption alignright" style="width: 282px"><img src="http://www.hisschemoller.com/wp-content/uploads/2011/05/euclidean_java_settings.jpg" alt="Pattern and MIDI Settings" title="euclidean_java_settings" width="282" height="402" class="size-full wp-image-709" /><p class="wp-caption-text">Pattern Settings Panel</p></div>On top are the main controls: Start / stop playback, a slider and input field to set the tempo in BPM and a combobox to choose a MIDI out port. The MIDI In port is not used at the moment.</p>
<p>Once a pattern is selected it’s settings can be edited:</p>
<ul>
<li>The <strong>Steps</strong> and <strong>Fills</strong> sliders determine the pattern. Each time one of them changes the algorithm is recalculated.</li>
<li><strong>Rotate</strong> rotates the pattern. As you’ll note when you play with the <strong>Steps</strong> and <strong>Fills</strong> sliders, a pattern always starts with a note on the first step. To overcome this limitation you can rotate the pattern with this slider.</li>
<li>MIDI settings <strong>Channel</strong>, <strong>Pitch</strong> and <strong>Velocity</strong> are parts of the MIDI Note On and Note Off messages that the pattern sends to the MIDI port.</li>
<li><strong>Length</strong> is the duration of the note. Once the end of a note is reached a MIDI Note Off message is sent to the MIDI port. The length of a note can be 16 steps maximum. At the moment length is measured in the internal sequencer resolution, which is 24 PPQN. Because one step is seen as a 16th note, the maximum slider value is ( 16 steps / 4 ) * 24 PPQN = 96. Not very intuitive, I know. I’ll think of something better in an update.</li>
<li><strong>Mute</strong>, <strong>Solo</strong> and <strong>Delete</strong> do what you’d expect them to do.</li>
</ul>
<h1>Examples</h1>
<p>Here are two pieces of music I’ve already made with the app. I tried to get them to be a bit more like finished track than just demos of layered polyrhythms.</p>
<p>The first one is the same setup as in the video above but with more patterns. About sixteen of them sending MIDI to sixteen tracks in Ableton Live with mainly samples being played. I recorded the MIDI patterns in Live, did some arranging and automation and exported the result as audio.</p>
<p><object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F15718546"></param><param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F15718546" type="application/x-shockwave-flash" width="100%"></embed></object>  <span><a href="http://soundcloud.com/hisschemoller/euclidean-patterns-demo-1">Euclidean Patterns Demo 1</a> by <a href="http://soundcloud.com/hisschemoller">Wouter Hisschemöller</a></span></p>
<p>The second one are patterns sending MIDI notes to a hardware drum machine via the soundcard’s MIDI output. This is my new Machinedrum UW that plays samples as well as synthesizing drum sounds. All sounds are the Machinedrum’s sixteen tracks playing and recorded on the computer.</p>
<p><object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F15718843"></param><param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F15718843" type="application/x-shockwave-flash" width="100%"></embed></object>  <span><a href="http://soundcloud.com/hisschemoller/euclidean-patterns-demo-2">Euclidean Patterns Demo 2</a> by <a href="http://soundcloud.com/hisschemoller">Wouter Hisschemöller</a></span> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hisschemoller.com/2011/euclidean-midi-patterns/feed/</wfw:commentRss>
		<slash:comments>114</slash:comments>
		</item>
		<item>
		<title>MIDI and XML for a drum machine</title>
		<link>http://www.hisschemoller.com/2009/midi-and-xml/</link>
		<comments>http://www.hisschemoller.com/2009/midi-and-xml/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 12:50:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MIDI]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.hisschemoller.com/?p=78</guid>
		<description><![CDATA[As a next project I want to make a simple drum machine. Several tracks that each play a different drum sample and each track has sixteen steps. Just like a Roland 808 or the main step sequencer in FruityLoops. It&#8217;s nothing complicated but it made me think about how to store the patterns the drum [...]]]></description>
			<content:encoded><![CDATA[<p>As a next project I want to make a simple drum machine. Several tracks that each play a different drum sample and each track has sixteen steps. Just like a Roland 808 or the main step sequencer in FruityLoops. It&#8217;s nothing complicated but it made me think about how to store the patterns the drum machine plays.</p>
<div class="wp-caption alignright" style="width: 300px"><img title="MIDI" src="http://www.hisschemoller.com/images/midi_setup2.gif" alt="MIDI" width="300" height="128" /><p class="wp-caption-text">MIDI</p></div>
<p>I&#8217;d like to put in an XML file all the information about how many patterns there are, how many tracks, which sound plays when and so on. But I want to keep the file as flexible as possible. It must be easy to later change the length of a pattern to 32 tracks, to add melodic patterns, notes of different length, filter settings&#8230; Whatever I need I want to be able to include in the file.</p>
<p>Then it occurred to me that such a file already exist: MIDI!</p>
<p>MIDI has been around since 1982, and today still is one of the main formats for music. Besides channels, notes and timing it can hold all kinds of extra settings as &#8220;Control Change&#8221; values or &#8220;System Exclusive&#8221; messages. Very general and flexible and just what I need. Only, MIDI is no XML. And Flash can&#8217;t read MIDI files. So I googled MIDI and XML and found I&#8217;m not the first to need MIDI in an XML form.</p>
<p>As far as I&#8217;ve been able to find two standards exist to format MIDI as XML:</p>
<p><span id="more-78"></span></p>
<p><strong>MIDI XML</strong></p>
<p>The first one is MIDI XML. The good thing is that it&#8217;s been developed by the <a href="http://www.midi.org">MIDI Manufacturers Organization</a> which is the organization that made the original MIDI specification. But the bad thing is that it seems to be incomplete and their only <a href="http://www.midi.org/dtds/midi_xml.php">page about MIDI XML</a> was last updated in July 2003.</p>
<p>A few <a href="http://www.midi.org/dtds/">DTD pages</a> exist to show how the XML should be formatted, but that&#8217;s about it. Not a lot of information. The most interesting DTD file is <a href="http://www.midi.org/dtds/MIDIEvents10.dtd">MIDIEvents10.dtd</a>, which shows how to represent MIDI events. This is what the XML should look like according to the file:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p78code4'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p784"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p78code4"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;NoteOn</span> <span style="color: #000066;">Channel</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Note</span>=<span style="color: #ff0000;">&quot;60&quot;</span> <span style="color: #000066;">Velocity</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;NoteOn</span> <span style="color: #000066;">Channel</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Note</span>=<span style="color: #ff0000;">&quot;62&quot;</span> <span style="color: #000066;">Velocity</span>=<span style="color: #ff0000;">&quot;127&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ControlChange</span> <span style="color: #000066;">Channel</span>=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #000066;">Control</span>=<span style="color: #ff0000;">&quot;7&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ProgramChange</span> <span style="color: #000066;">Channel</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Number</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>Clear enough, but this is only useful for a direct stream of MIDI events. Not to represent a MIDI file with a complete song. If only because there is no time information. You&#8217;d never know how much time it takes from one note to the next.</p>
<p><strong>MusicXML</strong></p>
<p>The second one is <a href="http://www.recordare.com/xml.html">MusicXML</a>. A much more complete standard made by <a href="http://www.recordare.com">Recordare</a>, a music and software company I had never heard of before. It seems to build on the MIDI XML standard, but goes much further. This is how an event would be represented in MusicXML:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p78code5'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p785"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p78code5"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Delta<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Delta<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;NoteOn</span> <span style="color: #000066;">Channel</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Note</span>=<span style="color: #ff0000;">&quot;60&quot;</span> <span style="color: #000066;">Velocity</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The main new thing is the <b>&lt;Delta&gt;</b> tag. It&#8217;s value is the time it takes from this event to the next, measured in &#8220;Ticks Per Beat&#8221;. How many ticks per beat there are can be found in the first section of the XML file. This is from the XML file I use for my drum machine:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p78code6'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p786"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p78code6"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE MIDIFile PUBLIC</span>
<span style="color: #00bbdd;">  &quot;-//Recordare//DTD MusicXML 0.9 MIDI//EN&quot;</span>
<span style="color: #00bbdd;">  &quot;http://www.musicxml.org/dtds/midixml.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MIDIFile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TrackCount<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TrackCount<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TicksPerBeat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TicksPerBeat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TimestampType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Delta<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TimestampType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>This means:</p>
<ul>
<li>&lt;Format&gt; holds the MIDI file type (0 or 1. 2 is not supported by MusicXML)</li>
<li>&lt;TrackCount&gt; the number of tracks (which is one because a type zero MIDI file can only have one track)</li>
<li>&lt;TicksPerBeat&gt; is the finest timing precision of the file. I used four because my drum machine has sixteen steps for a pattern of one bar, which is four steps for one beat. I don&#8217;t need more precision here.</li>
<li>&lt;TimeStampType&gt; is the way time is notated. It can be <em>Delta</em> or <em>Absolute</em>. <em>Delta</em> means  time is the amount of time between the current event and the next event, <em>Absolute</em> means the total time between the start of the song and the current event. I used <em>Delta</em> because real Standard MIDI files (.MID) only use Delta time.</li>
</ul>
<p>Much more information is available at the Recordare <a href="http://www.recordare.com/xml.html">MusicXML pages</a>, including DTD and XSD files, FAQ, tutorials and alphabetical index.</p>
<p>Another very helpful page is <a href="http://staff.dasdeck.de/valentin/midi">http://staff.dasdeck.de/valentin/midi</a>. It&#8217;s a collection of PHP scripts to work with MIDI. Especially useful is <a href="http://staff.dasdeck.de/valentin/midi/mid2xml.php">Midi2Xml</a> where you can upload a standard MIDI file which it translates into MusicXML format. It helped me a lot to discover how MusicXML works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hisschemoller.com/2009/midi-and-xml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

