48Khz HiFi digi player - by Antonio Savona
------------------------------------------
INTRO
As the name suggests, this demo implements a digi player for compressed music at a higher-than-CD sample rate of 48Khz. That is 21 CPU clock cycles per sample, which means fetching data from the cartridge, decompressing it and playing the actual sample.
To the best of my knowledge, the highest sample rate achieved on the Commodore 64 was 44.1Khz for uncompressed samples, therefore this demo should set a world's first with compressed digi (allowing for a whole song to fit onto a cartridge) and a higher sampling frequency. I might be wrong.
RUNNING THE DEMO
You need an Easyflash Cartridge, or a 1541Ultimate to run this demo on Real Hardware. Both SID models are supported, but a SID 8580 is highly recommended. 6581 works too, but quality is pretty miserable compared to 8580 and Digimax.
If you are running the demo on Vice 3.x, make sure you select DIGIMAX emulation at $DF00, and press F3 when the demo starts.
Also, make sure that ReSid emulation is switched on, and, in Vice sound settings, that sample rate is 48Khz.
This setup gives you the best quality!
ABOUT THE ENCODER
Briefly, this codec is purely based on Vector Quantization, and can encode from ~3:1 to ~4:1 with no noticeable difference with respect to the original uncompressed PCM data, and up to 7:1 with minimal (yet perceivable) loss in quality.
The examples included showcase ~3:1 and ~4:1 compression ratio. Keep an eye on my blog for a detailed description of the encoder, coming shortly.
Random thoughts on retroprogramming
www.brokenbytes.blogspot.com
VISUALS
With 21 cycles per sample, including decompression, there's not so much we can do on screen. Good old INC $d020 is already a miracle. I hope you don't mind.
FUTURE DEVELOPMENT
In theory, with this approach it should be possible to store several minutes of hi-quality music (possibly a whole record) on a 16Mb REU or other larger, modern storage devices for the Commodore 64. REUs though, especially those of a ridiculous size, which would have never been possible in the 80s, are just not my thing. Sorry.