On 7 Oct 2008, at 22:42, Thomas Harte wrote:
Roughly how much code (in kilobytes) is the part of an average end-
of-display interrupt driven music player that actually resides in
the interrupt handler?
Hi,
That depends what you mean...
The code you would write in an interrupt handler would need to:
1. page in the music player (if necessary)
2. call the player routine (often at 32774)
3. page back the previous memory state (if you changed it in step 1)
and is just a few bytes.
The music player itself is much larger, and depends on which music
system you use. A compiled E-Tracker tune is a few k depending on its
size - all of that needs to be paged in when you use it. The first
1202 bytes of this are a player code routine which is the same for all
tunes, the rest is data specific to each tune.
A compiled ProTracker tune is larger (partly because the effects are
more complicated, but mostly because I was concentrating on execution
speed, rather than code size, when I wrote the compiler). The player
routine is about 12k including some tables of sine waves and things;
the data for a particular tune is usually somewhere between 8k and 16k.
Both systems expect the whole music player code to be played once per
frame. There isn't support for, say, filling up a buffer of a few
seconds worth of music, and just playing from the buffer at interrupt
time. (That said, if you have a particular need for this, it might be
relatively easy to hack up the ProTracker player to support doing
that. Bear in mind it is decade-old code, though...)
Cheers,
Andrew
--
--- Andrew Collier ----
---- http://www.intensity.org.uk/ ---
--