[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mockingboard
Midi conversion can be kind of painful though, especially when you want
to convert a multi-polyphonic stream down to only 6 oscillators and 1
noise generator. It's possible, sure. Your awesome apple crate
experiments confirm that. But it might be more practical (hah.. that's
funny. my other half constantly tries to persuade me there's nothing
practical about this hobby of mine) to produce a player that uses an
optimized data structure to reduce the amount of logic necessary during
playback. Make the playback interrupt driven and tune it to use less
than 10-20% of the CPU time and you have a music playback engine for a
game!
I think the trick is to reset the interrupt interval on every cycle so
that the timer doesn't start another interrupt until another playback
action is necessary. With midi, you could pull this sort of thing off
by doing a look-ahead but it would be more expensive than, say,
compressing the empty space by representing "nothing happens for 1000
milliseconds" as a command. That way, you know that the next command
in the queue is "wait 1000 milliseconds"
I had sort of started down this path, but got stalled by my test code
failing to produce a tone, and then I got distracted by the raycasting
bit. Shame on me. :-D