I&#39;d be interested in taking a look at your code, It should help get my brain working. I&#39;d also be interested in feedback from you if your interested to critique my approach.<br><br>Nathanael<br><br>&gt;About ten years ago (on Atari/MiNT) I wrote a C program similar to this, but<br>
&gt;for baroque lute tabulature... I wanted it to help me transform any midifile<br>&gt;I was interested in, be it classical orchestral or chamber works, piano works<br>&gt;or pieces for classical guitar, in a semi-automatic way, to Wayne Cripp&#39;s<br>
&gt;lutetab code, and it worked out surprisingly good, given that I was a<br>&gt;lousy DIY hacker ;) (I don&#39;t really code anymore).<br>&gt;<br>&gt;I didn&#39;t care much about 2) and 3) but for 1) I came up with an algorithm like<br>
&gt;this:<br>&gt; - determine the string on which the pitch can be played at the lowest fret<br>&gt;  possible<br>&gt; - check if this string is used already, and if yes move this note to the next<br>&gt;  (lower) string<br>
&gt;<br>&gt;For notes lower than the instrument range (13 course lute goes down to A, a 5th<br>&gt;lower than guitar) I chose to just place a comment in the tab output, so that I<br>&gt;would be able to decide afterwards what to do with that note (transpose up an<br>
&gt;octave, skip it, whatever).<br>&gt;<br>&gt;Since it&#39;s been a long time now I can&#39;t remember how I dealt with files<br>&gt;containing more than one track, but I somehow managed to merge them into a<br>&gt;single tabulature, I have for example produced nice tabulatures of the<br>
&gt;accompaniment of the first three movements of Pergolesi&#39;s Stabat Mater.<br>&gt;For these of course I had to prepare the midifiles, remove the voice tracks<br>&gt;and transpose to a key suitable to the lute.<br>&gt;<br>
&gt;Other problems I&#39;ve encountered and I&#39;m not sure if or how I solved them:<br>&gt; - the bar/beat counting got screwed up sometimes, especially with grace notes<br>&gt; - of course, I had to remove double notes when boiling down ensemble works<br>
&gt; - there are different lute tunings, I only dealt with standard baroque<br>&gt;  d-minor tuning<br>&gt; - on the lute, the diatonic basses (lower than the 6th course) are tuned to<br>&gt;  the key of the piece<br>&gt;<br>
&gt;The thing is based on the ancient midifile(3) lib by Tim Thompson et al. which<br>&gt;is a little gem IMHO. The library parses the midifile, all you have to do is<br>&gt;to write a few callback functions for the events you&#39;re interested in. Some<br>
&gt;example code is in the archive, and it took me just a few days to come up with<br>&gt;something useful.<br>&gt;<br>&gt;I never seriously thought about releasing it, even after I compared it&#39;s<br>&gt;output&#39;s quality to what Django can do (an impressive M$ tabulature editor,<br>
&gt;mainly for historic fretted instruments, the demo from<br>&gt;<a href="http://musickshandmade.com/lute/pages/django">http://musickshandmade.com/lute/pages/django</a> runs quite well in wine) and<br>&gt;found that I was doing pretty well. :)<br>
&gt;<br>&gt;I&#39;m sure there are stupid things in there and it&#39;s not at all in a releasable<br>&gt;state, but if you are interested I&#39;ll share the code...<br>&gt;<br>