January 29th, 2007

beartato phd

(no subject)

So, I never really got into windows programming much during my youth — by the time I actually knew how to program, I was mostly using Linux — so it's an amusing exercise to mess around with little corners of the Windows API, like for instance MIDI I/O. It's far less scary than I thought.

The following C program just dumps MIDI messages to stdout:
Collapse )
and using some (sigh) perl module that someone wrote years ago, it is disgustingly convenient to transform this into a standard midi file:
Collapse )

The only tricky things were finding out that I needed to link to libwinmm to compile the C program under msys, and understanding the crazy midi "ticks" field and what I needed to set it to in order to make ticks = milliseconds.

Clearly the thing to do is wrap this all in some saner language...

Anyway, here is a quick recording of the head of "Blue Monk".