Jot down that melody

Have you ever conjured up a simple tune in your head but felt like big hammers were a bit inappropriate to jot the melodic thought down? There exists a wonderful thing called LilyPond which takes a TeX-like syntax for music composition and not only renders a neat little PDF or postscript of the score, but can also create a MIDI file of the tune that you can play very easily with a program like Timidity (this program allows you to avoid the sometimes tedious configuring of hardware and software to do MIDI synthesis that comes second nature to more seasoned PC audio folks). Here’s a simple example of how easy it is:

Write a super-sophisticated melody to some file called

score {
{ c’ e’ g’ e’ }

Now, just run:

$ lilypond

and it will produce a test.pdf (and postscript) file that looks something like:

Now to create a MIDI file simply add a directive to your file:

score {
{ c’ e’ g’ e’ }
midi {}

and rerun the command above. It will produce a MIDI file. If you’d like to hear it with software-synthesized goodness:

$ timidity test.midi

Timidity can, of course, output to WAV or OGG and whatnot for you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s