27 December 2010

Playing MIDI with Gstreamer

Yay this is cool! I finally understand how to use wildmidi.cfg :lol and playing pachelbel canon midi.

This is GPL Gravis Ultra Sound pats: http://freepats.zenvoid.org/ (download freepats-20060219.zip)
edit: and someone will release CC-BY 3.0 GM set here
for reference the original wildmidi binary can be found here

gstwildmidi (already patched, see update)

Now take a look at ".wildmidirc" inside wildmidi.7z for a while, this is a modified wildmidi.cfg from freepats which contain standard instrument channel assignment with optional tweak (amplification, sound panning etc.) at the top you'll find "dir C:\Users\Public\APPLIC~1\WildMidi" which told wildmidi where you put GUS pat (the freepats). This path by default is "C:\Documents And Settings\All Users\Application Data\WildMidi" in english Windows XP. This file need to be placed in C:\Documents And Settings\[username] a.k.a %USERPROFILE% or %HOME% or what whatever equal in your Windows.

libWildMidi-1.dll need to be placed in your Gstreamer path and also the plugins

The problem:
wildmidi doesn't recognize path variable nor space contained path, so this is a bit pain in the ass to install. Of course it would be simple if you just extract freepats to C:\ but I hate to fill C:\ with folders :)

If you follow my preference:
I will extract this it in shared Application Data (C:\Socuments and Settings\All Users\Application Data), since this is a space contained path I'll need to get it's correct short path by execute the following command in DOS box:

for %P in ("%ALLUSERSPROFILE%\Application Data") do echo %~sP

Enjoy the retro funky experience!

update March 15:
today I decide to patch both gstwildmidi and wildmidi,

First gstwildmidi don't have correct guessing method for whereabout wildmidi.cfg located in Windows so I added generic HModule trick to get root dir then locate etc/wildmidi.cfg (I guess this is the default in linux?)

Second wildmidi itself isn't functional without given parameters (those feed by gstwildmidi). However the dir parameter (the prefix where freepats located) in wildmidi.cfg doesn't accept space as noted above. Therefor I changed it: if after "dir" is left blank then locate [root]/share/wildmidi (don't know if this correct in linux) using the same trick before.

So no need to do crappy stuff above just put freepats and wildmidi.cfg correctly in relative path.
Oh did I promised to make CC BY 3.0 GM guspatch? well I just found free GM/GS (in soundfont) set! one from fluidsynth and the other from CSound (ugly one). But when I convert them, they inflating to more than 100MB this is because in SF an instrument can share its wave file to used in other instrument. Where in GUS every instrument is single independent collection file. Therefor I given up, I will wait OLPC for good news though!

No comments:

Post a Comment