A 48Khz digital music player for the Commodore 64

Article from 2018. I am impressed 8-bit 48kHz audio can sound so good from a SID.

Mission

To build a C64 software player that can play a whole song at 48Khz (higher frequency than CDs’ 44.1Khz) using a stock Commodore 64 and a regular ROM cartridge, which is your typical 80s setup.

Now, there are all kinds of devilish pieces of hardware available for your Commodore 64 nowadays, such as 16Mb RAM Expansion Units, or even mp3 hardware players. Of course, this stuff was not around in the 80s, and it therefore does not appeal to purists. In other words, any reliance on these monstrosities would get me disqualified. You might as well run a marathon riding a motorbike.

The largest “legitimate” ROM Cartridges are those that Ocean used for their games. You can store a whopping one megabyte of data onto them. We are going to need all of it!

In Numbers

So, we are playing 8-bit samples at 48Khz from one megabyte of storage, minus few Kbytes for the actual player code. This leaves us with 48Kb to encode one second of uncompressed audio, and means that the whole cartridge can barely contain 20 seconds of audio. Which means that we must implement some form of compression, ideally at least 4:1 to get close to 1m30 sec of audio.####

Commodore 64’s CPU runs at roughly 1Mhz. This means that, if we want to play 48000 samples per second, we only have about 100000/48000 = 21 CPU clock cycles per sample.

3 Likes

Wow. This is incredible. The fact that 8 bit samples are possible is amazing to me. I mean … a basic understanding of the SID makes it obvious 4 bit should be possible - the volume register is 4 bit. But 8 bit?

1 Like

I remember downloading some Van Halen sample from Q-Link in 1986 on my C128 in C64 mode and being amazed, and it sounded like crap. This is pretty amazing.

I’m very impressed!

(So, “stay here” doesn’t “stay for ever”. It sounds rather puny in comparison. :wink: )

BTW, the audiovisual sequence from the game “Planet Golf”, linked in the article, is impressive as well: