Using TiMidity++ to Render MIDI Files

Rendering MIDI to audio is actually pretty easy using TiMidity++. Here’s how I render using the chorium soundfont on my Ubuntu machine:

  • Download a nice soundfont collection. I found chorium by openwrld on the Piston Software website.
  • Install TiMidity++ if it’s not already installed. In ubuntu, just type “timidity” in a terminal window and you can find out if and how you need to install it.
  • Make (a) timidity configuration file(s) that refer(s) to your nice ensemble soundfont(s). I have a few such soundfont collections. Each one of these has the full General Midi instrument set:

    So, I made 3 config files, each with a name that corresponds to one of the soundfonts:

    The contents of each config file needs only contain one line that specifies the location of the .SF2 file. Here mine to use when rendering using chorium:
    # timidity-chorium.cfg
    # timidity config file using chorium soundfont
    soundfont /home/dan/soundfonts/chorium.sf2
  • preview the sound: (this is a single command line)
    $ timidity -c ~/soundfonts/timidity-chorium.cfg latin5soph.mid
  • render to wav: (this is a single command line)
    $ timidity -Ow1s -c ~/soundfonts/timidity-chorium.cfg -o latin5soph-chorium.wav latin5soph.mid
    Or to ogg: (this is a single command line)
    $ timidity -Ov1s -c ~/soundfonts/timidity-chorium.cfg -o latin5soph-chorium.ogg latin5soph.mid
  • Finally, you can encode to mp3 if you really need to do that:
    $ lame latin5soph-chorium.wav latin5soph-chorium.mp3

    Seriously, spend some time and use more lame options.

Here is the result
in MP3 format:
latin5soph-chorium.mp3 …and
in (the superior) Ogg Vorbis format:

The original MIDI was created a long time back using some free Microsoft product. As I remember there were a couple things referred to as “Microsoft Music Producer” This was created with the one that had a fairly dumbed-down user interface. You could pick the style and shape of the generated piece as well as select an orchestra from a few different possible ensembles. (Rich Rosen has blogged about this program.)

UPDATE: the other program was “Microsoft Direct Music Producer” and was a powerful tool for creating interactive music.

Wolfram Tones and MIDI through Browser Plugins

I have just spent the majority of ¬†my evening’s free time struggling with playing MIDI data through a browser on this Ubuntu box. Why? Well, I started out collecting some Wikipedia articles for a “book” (I mean the “book” feature in Wikipedia, I’m not writing a book…at least not right now.) One of the articles referenced Wolfram Tones and that was it: the start of another chain of despair. I could not get firefox to do the right thing with MIDI files. No matter what I did, ¬†firefox kept trying to send the streamed data to gecko plugin. Yes, I did read the help page on the Wolfram site and yes, I did install Timidity++ and the mozplugger thingy. but, no luck.

To hear what I was doing, I ran firefox in debug mode and then, I could at least see where the MIDI data was being cached. Once I had that, I just manualy played the file with TiMidity++. I’ve rendered some of my creations to MP3 using (which I wrote of previously.) Go ahead, and listen, they are each only 30 seconds.

Wolfram Tones Example KOK

Wolfram Tones Example FG

Wolfram Tones Example IPDO

Wolfram Tones Example HKH

My results are on the Wolfram site. Pick one out and have it sent to your smart phone and you’ll have a very unique ring tone!