That said, I'd like to see squirrel with ADPCM and/or Timer interrupt sample support - if you guys ever get around to it.
Me, too. IMHO, any PCE sound engine needs to support at-least-one sample-playback channel.
Why? I don't understand......?
You can use the 5-bit stuff (re-loading the waveforms) to do some neat things. If you play with it a bit...
I just don't understand how changing the sound engine helps anything. The point behind squirrel (which, once again, is the MML compiler and *not* the assembler playback engine) was to make it possible to create sound that was system card compatible. You can swap your program to cd, and have it play the same. So you can develop your music (or whatever) on a card image (in an emulator) and drop it into a cd-image.
If I have to use system card memory to hold a player -that's already in the bios-, I'd use a custom engine, too.
For me, it's because samples have always been part of that staple PCE sound. They were used in a
lot of games. Devil's Crush uses up to three sample streams at a time for some parts. Batman on the PCE has a really nice punch to the bass guitar because of samples (as well as the orchestra hit). Bonk's drumskit, Blazing Lazers drumkits, etc.
You guys obviously know a lot more about the BIOS player than I do. But I do remember looking at games that did ADPCM drumkits/etc and IIRC they used kind of a hacked way going about it. As in another engine running at the same time (in sync), just for the sample side of things. Does this sound familiar? It's possible other ADPCM+PSG usage in CD games made their sound engine, bypassing the BIOS player. Either way, sounds like a pain - running a hack/hook mini engine to run along side of it, or making a new but compatible sound engine with TIMER and/or ADPCM support.
So when will it be available for general use, bonknuts?
I'm working on a few different audio projects, so I'm going to assume you mean the MOD-ish type player. And the first engine at that (not the 8 channel PCM player with higher bit depth).
Just to be clear, it's sound driver
not a music engine. The driver is finished, and that includes the interfacing support for it as well; all the calls needed to load, stop, start, resume, set frequency, etc. The driver package itself will be public this month (I need to comb over the source remove any unnecessary stuff). I plan to write a
tiny music engine to show it off (how to use it, etc). And that's planned for this month. But the simple example music engine is not the point and not really for distribution (though I don't care what people do with it).
And what kind of resources does it us? (we already know about the cpu time.) How is it on memory? especially the zp space?
It uses 3 bytes of ZP space. I guess I should reduce that to 1 byte, and just push $00/$01 on the stack for the interface calls. So.. 1 byte of ZP space. CPU resource is light for the interfacing code. All changes are buffered and applied during a vblank call (the user calls this, not an automatic thing unless the user puts the call inside the vblank routine). This is needed because the TIMER routine is constantly using the PSG regs and you would have a conflict if code outside of the interrupt routine tried to update other PSG regs. Thus the need for buffering. Though that's the issue with any music engine and using the TIMER interrupt for DDA playback.
As far as cpu resource, disabling a channel for PCM output (making it free for normal use) reduces the cpu resource from 5.7% down to 0.4%. The last two channels, of the 6 total PCM streaming, take up 3.4% for PCM streaming per channel because they are fixed frequency, and they're also at a state of 0.4% cpu resource when not used. The TIMER interrupt overhead itself takes up 6.8% cpu resource regardless if any channels are playing or not. The TIMER interrupt routine
immediately enables interrupts so as not to stall the VDC interrupt service. Depending on the length of the VDC interrupt routine, as well as the number of instances, will result in jitter in PCM playback. A tight VDC routine is preferred, but not required. The PCM driver sets a flag during its call to prevent multiple instances from happening if for some reason it didn't finish the routine in time. Also, no banks needs to be permanently mapped for this routine to run. I figured flexibility was worth more than saving a handful few cycles per call.
It uses ~660bytes of system/ram memory and that includes the driver that needs to sit in ram. It needs 768bytes for the frequency look up table (sits in rom). And about 2k for the interfacing library (rom).
It's not extreme or drastic, or convoluted/complex in its interface into an another design/layout (game/etc). It's flexible in the number of channels a user can allocate/configure for PCM streaming, gaining back cpu resource for less channel usage. It's simple and realistic. It's not going to break down doors or win sound innovation of the year for retro systems, and it
does have some limitations in relation to quality (low bitrate, low frequency output), but it does allow some expansion on the PCE's sound capabilities. For me, that's exciting.
[ Don't take that the wrong way. It's -not- a dig; it's a serious question. I'd like to see what it can do, especially the adpcm stuff....]
No worries
I already have the ADPCM routine adapted to the VDC interrupt call (it runs out of there), and I think it was something like 50% cpu resource for decompressing to 10bit output (clipped from 13bit) @ 15.3khz (bound at 256 samples per 1/60 frame to keep things fast
). The interesting part will be preping the audio stream, before compression, to see what kind of quality can be achieved. Anything above 7khz with PCE audio circuit, and filter effects starts to kick in. So it should sound a little smoother than the hardware ADPCM in the CD unit (which is pretty
sharp sounding), even though they both output to a 10bit DAC. I've already have a clear idea of how to show it off. It'll be interesting to see how it works out.