<?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>Points of Interest &#187; Coding</title>
	<atom:link href="http://www.christeck.de/wp/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christeck.de/wp</link>
	<description>IT, software, gadgets, openstreetmap, synthesizers, and anything else that matters</description>
	<lastBuildDate>Fri, 30 Jul 2010 21:36:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Routino Frontend published</title>
		<link>http://www.christeck.de/wp/2010/06/27/routino-frontend-published/</link>
		<comments>http://www.christeck.de/wp/2010/06/27/routino-frontend-published/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 07:25:47 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Neogeography]]></category>
		<category><![CDATA[Openstreetmap]]></category>
		<category><![CDATA[Products]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=2347</guid>
		<description><![CDATA[I&#8217;ve just released Routino Frontend to the world wild web. The current code needs manual installation. A proper installer will be created only in case I see there&#8217;s some interest in this application.
Routino Frontend will start the GPS subsystem and allow you to get the current GPS location as departure or destination. Additionally, up to [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2339" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/RoutinoFrontend.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/RoutinoFrontend-300x180.png" alt="RoutinoFrontend" title="RoutinoFrontend" width="300" height="180" class="size-medium wp-image-2339" /></a><p class="wp-caption-text">RoutinoFrontend</p></div>
<p>I&#8217;ve just released <a href="http://www.christeck.de/wp/?page_id=2338">Routino Frontend</a> to the world wild web. The current code needs manual installation. A proper installer will be created only in case I see there&#8217;s some interest in this application.</p>
<p>Routino Frontend will start the GPS subsystem and allow you to get the current GPS location as departure or destination. Additionally, up to three via points are accepted.</p>
<p>To get the coordinates for via or destination points, go to Mappero, point the map to the desired location, press the left uppermost on-screen button, choose »Show Position« and copy it to the device&#8217;s clipboard.</p>
<p>After a route is calculated, the resulting file will be placed in the documents folder of the device, ready to be loaded into Mappero or Maep.</p>
<p>The code is in its early stages and needs refactoring. Please note that the current frontend will invoke routino in blocking mode. As soon as you process a route, Routino Frontend will not return before it finished. In case you calculate a long route, this means that Routino will eat all your CPU, memory, swap memory and battery power until it has done its job (which means that you probably need to remove the battery to quit it).</p>
<p>If you are more familiar with Python (and especially its subprocess module) as I am and you can help to add a nice cancel button which reliably kills Routino please drop me a line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/06/27/routino-frontend-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Osmarender rules changed to render forest parcel names</title>
		<link>http://www.christeck.de/wp/2010/05/09/changing-osmarender-rules-to-render-forest-parcel-names/</link>
		<comments>http://www.christeck.de/wp/2010/05/09/changing-osmarender-rules-to-render-forest-parcel-names/#comments</comments>
		<pubDate>Sun, 09 May 2010 21:34:00 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Openstreetmap]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=2243</guid>
		<description><![CDATA[At crossings of tracks in the woods, you often can find up to four name plates displaying the names of the adjacent wooden parcels. I usually placed a node tagged as place=locality and added the names. Of course this leads to a situation where the names will overlap each other, and after collecting some of [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2244" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/forest-parcels-osmarender-z17.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/forest-parcels-osmarender-z17-300x162.png" alt="Forest parcel name rendered in osmarender, zoom 17" title="Forest parcel name rendered in osmarender, zoom 17" width="300" height="162" class="size-medium wp-image-2244" /></a><p class="wp-caption-text">Forest parcel name rendered in osmarender, zoom 17</p></div>
<p>At crossings of tracks in the woods, you often can find up to four name plates displaying the names of the adjacent wooden parcels. I usually placed a node tagged as <code>place=locality</code> and added the names. Of course this leads to a situation where the names will overlap each other, and after collecting some of those plates, it was desirable to draw the parcels as areas with the name rendered at the center, not as individual nodes at the vertices. I currently add a polygon tagged as <code>landuse=forest</code>.</p>
<p>While Mapnik renders the names of <code>natural</code> and <code>landuse</code> features in zoom levels 14 through 17, Osmarender only rendered them visibly at zoom level 17.  It rendered <code>natural</code> names at zoom levels 16 and 15, but subsequently the caption was hidden by the rather huge surrounding wood polygon. <code>landuse</code> was missing in those levels.</p>
<p>I&#8217;ve thus adjusted the render rules so the names of natural and landuse features also get displayed at zoom levels <a href="http://trac.openstreetmap.org/changeset/21196">16</a> and <a href="http://trac.openstreetmap.org/changeset/21197">15</a>. I hope this won&#8217;t mess up the map in densely populated areas. If so, please drop me a line and I&#8217;ll change the additional <code>k="landuse" v="*"</code> to something like <code>k="landuse" v="forest|wood"</code>.</p>
<p>As soon as the changes are slurped by the tiles@home clients, I&#8217;ll start to convert the locality-nodes to something like <code>amenity=nameplate</code> or similar to finally clean up the map.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/05/09/changing-osmarender-rules-to-render-forest-parcel-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Waypointcatcher resurrected for Maemo 5</title>
		<link>http://www.christeck.de/wp/2010/04/12/waypointcatcher-resurrected-for-maemo-5/</link>
		<comments>http://www.christeck.de/wp/2010/04/12/waypointcatcher-resurrected-for-maemo-5/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:54:50 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Neogeography]]></category>
		<category><![CDATA[Openstreetmap]]></category>
		<category><![CDATA[Products]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=2130</guid>
		<description><![CDATA[As the location API has changed in Fremantle from libgpsbt to liblocation, the previously released version of waypointcatcher won&#8217;t do the job on the N900.
I&#8217;ve thus updated the python code, which despite its C&#038;P nature just »works for me«. I&#8217;ll share the application on request, until I find the time to do the necessary cleanup [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2131" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/WaypointCatcherMaemo5.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/WaypointCatcherMaemo5-300x180.png" alt="Waypointcatcher on Maemo 5 (aka Fremantle)" title="Waypointcatcher on Maemo 5 (aka Fremantle)" width="300" height="180" class="size-medium wp-image-2131" /></a><p class="wp-caption-text">Waypointcatcher on Maemo 5 (aka Fremantle)</p></div>
<p>As the location API has changed in Fremantle from libgpsbt to liblocation, the <a href="http://www.christeck.de/wp/2009/09/25/waypoint-catcher-publicly-available/">previously released version</a> of waypointcatcher won&#8217;t do the job on the N900.</p>
<p>I&#8217;ve thus updated the python code, which despite its C&#038;P nature just »works for me«. I&#8217;ll share the application on request, until I find the time to do the necessary cleanup and to offer a proper point and click installation link.</p>
<p>Its main purpose is to collect waypoints for openstreetmap, as Mapper <a href="https://garage.maemo.org/tracker/index.php?func=detail&#038;aid=4591&#038;group_id=29&#038;atid=185">does not record marks reliably</a> ATM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/04/12/waypointcatcher-resurrected-for-maemo-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Sysexxer: »Eat your own dogfood!«</title>
		<link>http://www.christeck.de/wp/2010/02/03/simple-sysexxer-%c2%bbeat-your-own-dogfood%c2%ab/</link>
		<comments>http://www.christeck.de/wp/2010/02/03/simple-sysexxer-%c2%bbeat-your-own-dogfood%c2%ab/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:28:38 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Products]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1924</guid>
		<description><![CDATA[During the last days and weeks, I missed some minor features in Simple Sysexxer, so guess what I was doing&#8230;

The current SVN hosts some minor new features. When loading or receiving data, the annoying dialog to confirm data loss now offers to remember the confirmation. This is not done persistently, but on a per-session basis:
When [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1925" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-receiving.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-receiving-300x203.png" alt="Simple Sysexxer receiving data" title="Simple Sysexxer receiving data" width="300" height="203" class="size-medium wp-image-1925" /></a><p class="wp-caption-text">Simple Sysexxer receiving data</p></div>
<p>During the last days and weeks, I missed some minor features in Simple Sysexxer, so guess what I was doing&#8230;</p>
<p><span id="more-1924"></span></p>
<p>The current SVN hosts some minor new features. When loading or receiving data, the annoying dialog to confirm data loss now offers to remember the confirmation. This is not done persistently, but on a per-session basis:</p>
<div id="attachment_1926" class="wp-caption aligncenter" style="width: 395px"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-confirmlossofdata.png" alt="Simple Sysexxer - confirm data loss" title="Simple Sysexxer - confirm data loss" width="385" height="140" class="size-full wp-image-1926" /><p class="wp-caption-text">Simple Sysexxer - confirm data loss</p></div>
<p>When loading a file, the data can now be sent automatically to the device:</p>
<div id="attachment_1927" class="wp-caption aligncenter" style="width: 331px"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-autosend.png" alt="Simple Sysexxer - autosend option" title="Simple Sysexxer - autosend option" width="321" height="262" class="size-full wp-image-1927" /><p class="wp-caption-text">Simple Sysexxer - autosend option</p></div>
<p>The option to request data from a device is now back in all its glory &#8211; including some ugly icon :) :</p>
<p><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-request.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-request-300x185.png" alt="Simple Sysexxer - request data from a device" title="Simple Sysexxer - request data from a device" width="300" height="185" class="aligncenter size-medium wp-image-1931" /></a></p>
<p>The current code offers to split the loaded data into single SysEx files. This feature mainly is useful for single program banks of the Access Virus C synthesizer. The file names will be built according to the sound&#8217;s name, while special characters (like forward slashes, ooops) will be filtered out.</p>
<p>The split files will be altered, so sending them back to the device will load the files into the current edit buffer instead of writing them back to the original destination:</p>
<div id="attachment_1932" class="wp-caption aligncenter" style="width: 331px"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxer2010-savesplit.png" alt="Simple Sysexxer - split file" title="Simple Sysexxer - split file" width="321" height="262" class="size-full wp-image-1932" /><p class="wp-caption-text">Simple Sysexxer - split file</p></div>
<p>The code which does the splitting is quite ugly (heck, I just needed the task to be done!). As I deny to do the necessary refactoring, it will be removed before the next release. Use it at your own risk and responsibility. If you brick your Virus, accuse yourself. If you still cannot resist, check out revision 28 from the subversion repository.</p>
<p>Just in case that you wonder what this is all about, here&#8217;s the use case. There are tons of soundbanks for the Virus spread all over the web. You can of course load them into the Virus completely, overwriting your RAM banks. But there&#8217;s no tool for Linux to audition individual sounds. Thus the splitting option:</p>
<ul>
<li>Load the sound bank (either in syx or smf format) in Simple Sysexxer.</li>
<li>Save the individual sounds into an empty directory.</li>
<li>Connect the MIDI output of Simple Sysexxer to your MIDI device using aconnect, qjackcontrol or patchage.</li>
<li>Enable the autosend option.</li>
<li>Drag and drop individual sound files onto Simple Sysexxer.</li>
<li>Play the sound.</li>
<li>Keep or drop the file, using your file manager.</li>
</ul>
<p>What I really miss for Linux is a universal synth editor and librarian (<a href="http://jsynthlib.org">JSynthLib</a> seems to be rather dead). And yes, I deny to master such a tool as OSS in my spare time :) .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/02/03/simple-sysexxer-%c2%bbeat-your-own-dogfood%c2%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JOSM Presets updated</title>
		<link>http://www.christeck.de/wp/2010/01/17/josm-presets-updated/</link>
		<comments>http://www.christeck.de/wp/2010/01/17/josm-presets-updated/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 17:21:31 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Openstreetmap]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1884</guid>
		<description><![CDATA[I rearranged the presets in JOSM and am prepared for the usual bashing :) .
Tracks and paths have been reunified into one menu entry only, so the convenience menu shortcuts to the various types of tracks and paths are past. OTOH, I have introduced dedicated menu entries for combined foot and cycleways:
The types have been [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1885" class="wp-caption aligncenter" style="width: 138px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-logo.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-logo.png" alt="JOSM Logo" title="JOSM Logo" width="128" height="128" class="size-full wp-image-1885" /></a><p class="wp-caption-text">JOSM Logo</p></div>
<p>I rearranged the presets in JOSM and am prepared for the usual bashing :) .</p>
<p>Tracks and paths have been reunified into one menu entry only, so the convenience menu shortcuts to the various types of tracks and paths are past. OTOH, I have introduced dedicated menu entries for combined foot and cycleways:</p>
<div id="attachment_1892" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-presets-foot-and-cycleways1.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-presets-foot-and-cycleways1-300x154.png" alt="JOSM presets - cleanup and additions" title="JOSM presets - cleanup and additions" width="300" height="154" class="size-medium wp-image-1892" /></a><p class="wp-caption-text">JOSM presets - cleanup and additions</p></div>
<p>The types have been included as popup menus into the dialogs. Besides tracktypes and hiking scales, I also included <a href="http://josm.openstreetmap.de/ticket/3896">mountainbike scales</a>, while more special tags for mountain bikers can be used by including an existing set of <a href="http://www.christeck.de/wp/2010/01/17/external-presets-in-josm/">externally maintained presets</a>:</p>
<div id="attachment_1887" class="wp-caption aligncenter" style="width: 202px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-presets-path.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-presets-path-192x300.png" alt="JOSM - Path Preset" title="JOSM - Path Preset" width="192" height="300" class="size-medium wp-image-1887" /></a><p class="wp-caption-text">JOSM - Path Preset</p></div>
<p>Obviously, the dialogs are completely overcrowded. We will not be able to stuff any and all tags that will develop in the future into JOSM. Be prepared that I will do some major cleanup work some day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/01/17/josm-presets-updated/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>External Presets in JOSM</title>
		<link>http://www.christeck.de/wp/2010/01/17/external-presets-in-josm/</link>
		<comments>http://www.christeck.de/wp/2010/01/17/external-presets-in-josm/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 16:52:37 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Openstreetmap]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1888</guid>
		<description><![CDATA[JOSM provides the capability to include presets from external sources. It is the perfect mechanism for a group of mappers to maintain a specialized set of presets. This way, »Special Interest« mappers like skiers, mountain bikers or seamen can feed menu entries they need directly into JOSM without polluting the default menu space of JOSM.
Some [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1885" class="wp-caption aligncenter" style="width: 138px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-logo.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/josm-logo.png" alt="JOSM Logo" title="JOSM Logo" width="128" height="128" class="size-full wp-image-1885" /></a><p class="wp-caption-text">JOSM Logo</p></div>
<p><a href="http://josm.openstreetmap.de">JOSM</a> provides the capability to include presets from external sources. It is the perfect mechanism for a group of mappers to maintain a specialized set of presets. This way, »Special Interest« mappers like skiers, mountain bikers or seamen can feed menu entries they need directly into JOSM without polluting the default menu space of JOSM.</p>
<p>Some <a href="http://josm.openstreetmap.de/wiki/Presets">examples</a> are available via JOSM&#8217;s wiki pages. There&#8217;s also a page <a href="http://josm.openstreetmap.de/wiki/TaggingPresets">how to create and use</a> such presets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2010/01/17/external-presets-in-josm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sorting Sound Files using Ruby</title>
		<link>http://www.christeck.de/wp/2009/11/25/sorting-sound-files-using-ruby/</link>
		<comments>http://www.christeck.de/wp/2009/11/25/sorting-sound-files-using-ruby/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 21:27:06 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Musical Instruments]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1565</guid>
		<description><![CDATA[
Consider you have 2,248 files in a directory, each containing one single sound program for your favourite Z1 synth. You need to load them into the synth individually, listen to them and to sort them in directories. Painful it would be.
Fortunately, all sounds are set to one of 18 predefined categories like guitar, synth hard, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/ruby-2008.png" title="ruby-2008.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/ruby-2008.png" alt="ruby-2008.png" /></a></p>
<p>Consider you have 2,248 files in a directory, each containing one single sound program for your favourite Z1 synth. You need to load them into the synth individually, listen to them and to sort them in directories. Painful it would be.</p>
<p>Fortunately, all sounds are set to one of 18 predefined categories like guitar, synth hard, synth soft, piano, organ and the like. In the SysEx files, the category is coded into the 26. byte. So it was easy to sort the files into subdirectories using a couple of lines of Ruby code (sorry for the misformatting):</p>
<p><code><br />
<tt><br />
#! /usr/bin/ruby</p>
<p>require 'fileutils.rb'</p>
<p>def determineCategory( filename )<br />
  file = File.open( filename, "rb:binary" )<br />
  fileContents = file.read<br />
  category = fileContents[25] + 1<br />
  # puts filename, category<br />
  unless File.directory?(category.to_s)<br />
    Dir.mkdir( category.to_s )<br />
  end<br />
  FileUtils.mv( filename, category.to_s )<br />
end</p>
<p>Dir.glob( '*.[Ss][Yy][Xx]' ) do |entry|<br />
   determineCategory entry<br />
end<br />
</tt><br />
</code></p>
<p>This language seems to be very powerful. Need to do more with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2009/11/25/sorting-sound-files-using-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XP Days Germany ahead</title>
		<link>http://www.christeck.de/wp/2009/11/25/xp-days-germany-ahead/</link>
		<comments>http://www.christeck.de/wp/2009/11/25/xp-days-germany-ahead/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:31:12 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1543</guid>
		<description><![CDATA[The XP Days are just a couple of hours ahead. I&#8217;m curious what people will attend and expect some illuminative talks. I hope it will be possible to blog directly from the conference, either using the notebook or the N810. I&#8217;ve also set up an &#8220;extra group&#8221; :) in our &#8220;company owned&#8221; messaging system in [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1545" class="wp-caption aligncenter" style="width: 181px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/meeting_point_in_brillant_style_rg1024.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/meeting_point_in_brillant_style_rg1024.png" alt="Meeting Point Symbol (openclipart.org, public domain)" title="Meeting Point Symbol (openclipart.org, public domain)" width="171" height="171" class="size-full wp-image-1545" /></a><p class="wp-caption-text">Meeting Point Symbol (openclipart.org, public domain)</p></div>
<p>The <a href="http://xpdays.de/2009/">XP Days</a> are just a couple of hours ahead. I&#8217;m curious what people will attend and expect some illuminative talks. I hope it will be possible to blog directly from the conference, either using the notebook or the N810. I&#8217;ve also set up an &#8220;extra group&#8221; :) in our &#8220;company owned&#8221; messaging system in advance.</p>
<p>Though it is not for free it was too tempting to attend &#8211; it&#8217;s just a five minutes walk from our office, so there was no excuse :) .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2009/11/25/xp-days-germany-ahead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALSA Sequencer Interface for Simple Sysexxer</title>
		<link>http://www.christeck.de/wp/2009/11/23/alsa-sequencer-interface-for-simple-sysexxer/</link>
		<comments>http://www.christeck.de/wp/2009/11/23/alsa-sequencer-interface-for-simple-sysexxer/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 23:43:13 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Musical Instruments]]></category>
		<category><![CDATA[Products]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1526</guid>
		<description><![CDATA[The last release of Simple Sysexxer used RtMidi for MIDI input. However, some weird things happend when I tried to receive data from my beloved Korg Z1 synth. Today I have rewritten the MIDI input thread using the ALSA sequencer API.

I hear complaints about the sparse ALSA documentation every now and then. Most people use [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1533" class="wp-caption aligncenter" style="width: 138px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxerappicon.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/simplesysexxerappicon.png" alt="Simple Sysexxer Icon" title="Simple Sysexxer Icon" width="128" height="128" class="size-full wp-image-1533" /></a><p class="wp-caption-text">Simple Sysexxer Icon</p></div>
<p>The last release of <a href="http://www.christeck.de/wp/products/simple-sysexxer/">Simple Sysexxer</a> used <a href="http://www.music.mcgill.ca/~gary/rtmidi/">RtMidi</a> for MIDI input. However, some weird things happend when I tried to receive data from my beloved Korg Z1 synth. Today I have rewritten the MIDI input thread using the ALSA sequencer API.</p>
<p><span id="more-1526"></span></p>
<p>I hear complaints about the sparse <a href="http://www.alsa-project.org">ALSA</a> documentation every now and then. Most people use Matthias Nagorni&#8217;s <a href="http://www.suse.de/~mana/alsa090_howto.html">commented example code</a>. I read the code of other ALSA sequencer clients during the last couple of days, and I got the impression that many coders took advantage of the open source principle. Or the other way around: copy and paste is great ;-) . Anyway, I learned some things about C hacking while writing my own code, and I&#8217;m getting better reading other people&#8217;s code day by day.</p>
<p>Here are some snippets of the code which &#8220;works for me&#8221;. I inherit QThread for the MIDI in class. From it&#8217;s constructor, I invoke the init method to create the client for the ALSA sequencer (sorry for the formatting, Wordpress doesn&#8217;t do better):</p>
<p><code><br />
<tt><br />
void MidiIn::init()<br />
  {<br />
    sequencerHandle = 0L;<br />
    sequencerEvent = 0L;<br />
    if ( snd_seq_open( &#038;sequencerHandle, "default", SND_SEQ_OPEN_INPUT, 0 ) < 0 )<br />
      {<br />
        emit errorMessage ( tr( "Cannot initialize the MIDI subsystem."), tr( "Please ensure ALSA is accessible." ) );<br />
      }</p>
<p>    snd_seq_set_client_name(sequencerHandle, APPNAME );</p>
<p>    if ( snd_seq_create_simple_port( sequencerHandle, APPNAME, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, SND_SEQ_PORT_TYPE_APPLICATION) < 0 )<br />
      {<br />
        emit errorMessage ( tr( "Cannot create MIDI port."), tr( "Please ensure ALSA is set up properly." ) );<br />
      }<br />
  }<br />
</tt><br />
</code></p>
<p>The run method gets invoked as soon as the thread gets started. The polling code has been stolen from Matthias' examples. Thanks a bunch :) :</p>
<p><code><br />
<tt><br />
void MidiIn::run()<br />
  {<br />
    recordMidi = false;<br />
    int npfd = snd_seq_poll_descriptors_count(sequencerHandle, POLLIN);<br />
    struct pollfd* pfd = (struct pollfd *)alloca(npfd * sizeof(struct pollfd));<br />
    snd_seq_poll_descriptors(sequencerHandle, pfd, npfd, POLLIN);<br />
    while ( true )<br />
      {<br />
        // Avoid too much CPU load. According to the MIDI baud rate, 4 bytes need at least 1024 microseconds to pass the chord.<br />
        usleep( 512 );<br />
        if ( poll( pfd, npfd, 100000) > 0 &#038;&#038; recordMidi == true )<br />
          {<br />
            processInput();<br />
          }<br />
      }<br />
  }<br />
</tt><br />
</code></p>
<p>Here's the code that does "the actual work". The ALSA sequencer gets passed the client's handle and sequencerEvent, which is a pointer of type snd_seq_event_t. ALSA will set this pointer to the memory address where it buffers the current event. As I'm only interested in SysEx data, I leave the body of the loop in any other case. If it is SysEx data, I copy the actual data over to a QByteArray.</p>
<p>ALSA splits (variable length) SysEx data into chunks of 256 bytes. That's why I check whether the data starts with an 0xF0 and ends with an 0xF7. If so, the package is complete and gets send to the main thread via a signal. Otherwise the loop continues collecting data, informing the main (GUI) thread that a chunk of data arrived. This is needed to inform the user that data still is coming in:</p>
<p><code><br />
<tt><br />
void MidiIn::processInput()<br />
  {<br />
    do<br />
      {<br />
        snd_seq_event_input( sequencerHandle, &#038;sequencerEvent );<br />
        if ( sequencerEvent->type != SND_SEQ_EVENT_SYSEX )<br />
          {<br />
            snd_seq_free_event( sequencerEvent );<br />
            continue;<br />
          }<br />
        // Stolen from aseqmm/alsaevent.cpp by Pedro Lopez-Cabanillas<br />
        tempBuffer.append( QByteArray( (char *) sequencerEvent->data.ext.ptr, sequencerEvent->data.ext.len ) );</p>
<p>        // ALSA splits sysex messages into chunks, currently of 256 max bytes in size<br />
        // Therefore the data needs collection before sending it to the master thread<br />
        if ( tempBuffer.startsWith( 0xF0 ) &#038;&#038; tempBuffer.endsWith( 0xF7 ) )<br />
          {<br />
            emit eventArrived( tempBuffer );<br />
            tempBuffer.clear();<br />
          }<br />
        else<br />
          {<br />
            emit chunkArrived();<br />
          }<br />
        snd_seq_free_event( sequencerEvent );<br />
      }<br />
    while ( snd_seq_event_input_pending( sequencerHandle, 0 ) > 0 );<br />
  }<br />
</tt><br />
</code></p>
<p>There are a lot of things that can be improved in this code. Patches are always welcome :) . OTOH it will hopefully give other hackers a good starting point. The code also can be found in <a href="http://sysexxer.svn.sourceforge.net/viewvc/sysexxer/trunk/">SVN</a>. See the files src/MidiIn.h and src/MidiIn.cpp.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2009/11/23/alsa-sequencer-interface-for-simple-sysexxer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching from Linux to Windows</title>
		<link>http://www.christeck.de/wp/2009/11/13/switching-from-linux-to-windows/</link>
		<comments>http://www.christeck.de/wp/2009/11/13/switching-from-linux-to-windows/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 23:11:23 +0000</pubDate>
		<dc:creator>ce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.christeck.de/wp/?p=1462</guid>
		<description><![CDATA[I run a dual boot machine, using both Linux and Windows operating systems. I rarely boot Windows but only use it once a semester or so to try out some application or to compile Gebabbel for my Windows users.

These days I wanted to check out some editors and tools for the Z1. So I was [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1463" class="wp-caption aligncenter" style="width: 243px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/Kirchberg_Fenster_Heiligenstadt_OFr.jpg"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/Kirchberg_Fenster_Heiligenstadt_OFr-233x300.jpg" alt="Broken Windows (wikimedia commons, public domain)" title="Broken Windows (wikimedia commons, public domain)" width="233" height="300" class="size-medium wp-image-1463" /></a><p class="wp-caption-text">Broken Windows</p></div>
<p>I run a dual boot machine, using both Linux and Windows operating systems. I rarely boot Windows but only use it once a semester or so to try out some application or to compile <a href="http://www.christeck.de/wp/products/gebabbel/">Gebabbel</a> for my Windows users.<br />
<span id="more-1462"></span><br />
These days I wanted to check out some editors and tools for the <a href="http://www.christeck.de/wp/2008/09/21/playing-with-the-korg-z1/">Z1</a>. So I was finally back to the infamous world of Windows shareware, freeware and demo software. I immediately felt uncomfortable.</p>
<p>When booting Vista after some time, you will be bothered by almost any bit in your machine that begs for updating it &#8211; Vista itself, Adobe Reader, Java, you name it. The best thing is that Vista will deny to shut down or reboot before the updates aren&#8217;t installed or &#8220;configured&#8221; properly. That&#8217;s pretty annoying if you need to reboot your machine during some driver installation.</p>
<p>Driver installation? True. I use some USB MIDI devices which are class compliant and therefore run without any special driver on Linux and Mac OS X. Vista searched the Web for a driver but failed miserably. So I had to visit the homepage of the manufacturer and to manually download and install a driver¹. After some further fiddling I noticed that something went wrong and the data received from the synth was garbage. Doh!</p>
<p>It&#8217;s great we have the internet, and it&#8217;s great to get free updates for your operating system. As a long time Linux user, I&#8217;m used to it. But I decide when to do updates. Mac OS X notifies me if updates are available and lets me decide whether to install it now or later. Windows notifies me that the machine needs a reboot &#8211; the only option I had was to delay it for a couple of hours.</p>
<p>None of the tools I tried out fulfilled my needs, so I&#8217;m now &#8220;back home&#8221; on my Linux box. There&#8217;s nothing wrong with Windows, but for me it&#8217;s just not the operating system of choice.</p>
<p>¹ Yeah, that&#8217;s how we did it in the last century, in times of Web 1.0</p>
<p>&#8212;-</p>
<p>Update:</p>
<p>Today a colleague of mine tested our software in a virtual machine running Vista. While copying an ISO image (remaining time: 13 minutes and 10 seconds) Vista insisted in a reboot in 4 minutes and 19 seconds. The option to postpone the reboot was disabled. The only way to avoid the reboot was to kill windows update via the task manager:<br />
<div id="attachment_1541" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.christeck.de/wp/wp-content/uploads/christeck.de/VistaUpdate.png"><img src="http://www.christeck.de/wp/wp-content/uploads/christeck.de/VistaUpdate-300x222.png" alt="Vista Update" title="Vista Update" width="300" height="222" class="size-medium wp-image-1541" /></a><p class="wp-caption-text">Vista Update</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christeck.de/wp/2009/11/13/switching-from-linux-to-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
