MIDI support (was: Autoconf working yet?)

Ryan C. Gordon icculus at clutteredmind.org
Mon Oct 1 05:05:12 EDT 2001

> I have a rough, proof-of-concept version of this, but it doesn't quite
> work yet. I think it's ignoring the sample frequency I tell it to use,
> but I don't know why. Is this approach worth pursuing?

Actually? Yes, but not specific to Timidity.

If we're going to fork off and read from a pipe, we might as well make it
generic enough to read from any process that's willing to send waveform
data over stdio...sox comes to mind here.

I think SDL_mixer does something like this (the music_cmd file?) but I'm
not sure. Still, it's not a bad idea to have, Timidity or otherwise.

In reality, it's a flexible little hack, but it has drawbacks. First, you
can't say you support MIDI decoding when in fact the Timidity binary is
magically missing from the system. The way around this is the init()
method in the DecoderFunctions, but that's awkward. Second, if we make it
a general read-from-another-process "decoder", how do we specify what file
formats are supported, when it might be any number of things? How do we
tell this general interface where to read from and what binary to run?

These are not impossible questions, but they will need answers.

Ultimately, I'd like the MIDI support to be built in, or be optionally
compiled in to call a MIDI specific API (timidity or otherwise), but
again, I like the idea of having a generic read-from-another-process
decoder module.

Let's talk about this some more.


More information about the sdlsound mailing list