Page 1 of 1

AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Wed Sep 23, 2020 10:05 am
by Nienn Heskil

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Wed Sep 23, 2020 11:08 am
by Ast A. Moore
Awesome. This could be perfect for moderately animated menus and such.

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Wed Sep 23, 2020 11:10 am
by uglifruit
This is great.

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Wed Sep 23, 2020 7:39 pm
by Nienn Heskil
Ast A. Moore wrote: Wed Sep 23, 2020 11:08 am Awesome. This could be perfect for moderately animated menus and such.
Cheers. Normally I'd prefer to leave the border alone when it comes to it... However, the inner loop of the original AMP was exactly 7T slower than necessary for this purpose, which meant one AND opcode was definitely out. :P

Because of memory issues, I don't think such an engine is practical in a 16K game, at least currently. Although the song data format is more optimal than e.g. that of Tritone, it's still 4 bytes per row in the best case, so the song data grows fairly fast. I thought of giving compression a try sometime - I suppose we'll see about that. (Of course there's always the option to use less channels and everything).

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Sun Sep 27, 2020 1:02 pm
by Nienn Heskil
At the moment, I've changed the pattern row format a little, and it seems quite effective. Even without compression, I was able to save about 2,5K of row data on "Na Zare". The new format is:
+0: %nnnn dddd, - Note map, Drum (if present; codes 2~15). Note map is 4 bits saying if there's a note for the corresponding channel on this row.
+1..+N: Channel note/volume data (if present). One byte each. If bit 7 of a note is set, it means a volume byte follows.

Speaking of compression, I'm not really sure which one would work well here. I've tried DTE previously with the old format, which resulted in similar savings, but I'm not too keen on unpacking it in realtime in this context. And row-based dictionary compression didn't seem too effective. Who knows, it might just be fine as is. :)

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Mon Sep 28, 2020 7:47 pm
by utz
Congratulations on reaching this milestone! Excellent work.

I think your current data layout would indeed be fine as is, provided you use an order list with it (not just one single long pattern).

Any chance for releasing the source code? Preferably under a permissive license (MIT, BSD, WTFPL), would like to include this in Bintracker.

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Tue Sep 29, 2020 7:45 pm
by Nienn Heskil
Thanks, and sure enough, we do use pattern lists here. :)

Re: source code, no problem. Once I consider it sufficiently finished, I'll release the proper package with documentation, a standalone XM converter and everything. Most of that is already done, so it shouldn't take too long.

Re: AMP16K: Multichannel beeper sound on the ZX Spectrum 16K

Posted: Thu Oct 01, 2020 3:48 pm
by Nienn Heskil
And done. Post updated with the full archive.