How Did They Get Sampled Sounds From An SN76489 8-bit Sound Chip?

If you were lucky and had well-off parents in the early 1980s, your home computer had a sound chip on board and could make music. There were a variety of chips on the market that combined in some form the tone generators and noise sources of a synthesiser, but without the digital-to-analogue converters of later sound chips designed for sampled audio. They gave birth to chiptune music, but that was all they were made to do. The essence of a hack lies in making something perform in a way it was never intended to, and some game developers for the Acorn BBC Micro had its SN76489 producing sampled audio when it should never have been possible. How did they do it? It’s a topic [Chris Evans] has investigated thoroughly, and his write-up makes for a fascinating explanation.

So, how can a set of audio tone generators be turned into a sampled audio player, and how can it be done when the CPU is a relatively puny 6502? There’s no processor bandwidth for clever Fourier transform tricks, and 1980s tech isn’t set up for high data bandwidths. The answer lies in making best use of the controls the chip does offer, namely frequency and volume of a tone. A single cycle of a tone can be given a volume, and thus can be treated as a single sample of an unintended DAC. By using a tone frequency well above the audio range a suitable sample frequency can be found, and thus an audio stream can be played. The write-up has links to some examples in an emulator, and while they’re hardly hi-fi they’re better than you might expect for the hardware involved. Still, even at that they don’t approach this amazing 48kHz playback on a Commodore 64.

Header: SN76489, on a Colecovision console motherboard. Evan-Amos / Public domain.

23 thoughts on “How Did They Get Sampled Sounds From An SN76489 8-bit Sound Chip?

  1. “The essence of a hack lies in making something perform in a way it was never intended to,”

    Well, it you are hacking your oscilloscope (e.g. Rigol) to release the functions intended for higher paying customers…
    B^)

    1. I remember, back in the days of DOS, a TSR that allowed the PC speaker (intended for nothing more than a BEEP! when the machine powered up) to “reproduce” audio files without the expense of a sound card.

      1. yes, and similarly there was a Windows 3.1 driver that would do the same to provide wav output device. The machine was locked while playing, so you didn’t really want to use it for much more than the system sounds, but it was more fun than the beeps.

        1. What I would REALLY like to know, is how to fool Spectrum Holobyte’s (DOS) version of Tetris (with or without the “Matthias Rust” option) into thinking it has a sound card, so I could once again hear the sweet melodious tones of Russian folk tunes in all their 8-bit glory. I remember there was a TSR that would fool it into thinking it had the right sound card, but DOSbox’s emulated sound cards don’t do the trick…

          1. Having just searched for and disassembled “TTETRIS.EXE” from what the internet claims is Spectrum Holobyte’s Tetris … there’s definitely no sound code inside.

          2. Is it possible that there isn’t a pc speaker, or that it is disabled on the system you tried it on. Because as I remember it, it played on a machine that only had a PC speaker (Amstrad PC-1512) unless that also had some Tandy 1000 or PC-Jr sound emulation.

          3. It was still bugging me, so I went digging, apparently the music runs on an Adlib card and the emulation built into Soundblaster (emulation) on DOSbox isn’t good enough. YT comment…
            https://www.youtube.com/watch?v=NOQPrGfYuqk&lc=UgwQcuBA_PdBV8PJc014AaABAg

            Now I’m wondering how the heck I thought I heard it out of that PC-1512 …

            Also note that there are two Spectrum Holobyte releases, one in 84 and one in 87, probably after it got really popular on NES etc.

  2. “V8 – return to base immediately” (Mastertronic’s ‘The Last V8’, C64 SID)

    “If you were lucky and had well-off parents…”
    How does this envy/class warfare angle help to develop the content?

    1. And SeaDragon on the Apple 2 certainly played a recognizable “SeeeeaaaaDragon”.

      A firetruck game I had provided the address as a voice playback. You did have to strain to understand it.

  3. About 15 years ago I got a 2600 to do DTMF tones. The 2600’s sound chip had an “always high” mode, which let the volume registers work as two 4-bit PCM channels. I think only Pitfall II ever used this audio mode back in the day for its background music, and it had a custom chip to automatically provide the next sample. It took 70% of the CPU time just to generate the next sample. Cycles were so precious that the sound code was inserted as a macro dozens of times.

  4. seriously?

    “relatively puny 6502”

    umm

    1 bit audio?

    so many examples of how to sample really crappy audio on an AppleII through the cassette interface

    I’ll dig through my notes, I did some “sampling” with my SYM 1

    I wrote a “Dalek/Beserker” for my SYM and KTM 2

    I wanted the “INTRUDER ALERT! INTRUDER ALERT!”

    I “captured” me saying “intruder alert” into a fan (don’t judge, we have all done it) through the SYM cassette port (that never worked)

    it was crackly, sounded horrible, but really added “something” to the game!

    while getting it to work I was messing around with a 74LS154 on a port with 16 LED’s

    I had a timer interrupt going
    the main loop was looking at the cassette pin
    every time it went high I incremented a counter
    when the interrupt went off I put the upper 4 bits on the 74154

    it ended up being a simple spectrum analyzer

    some of the Apple II games REALLY pushed the envelope with what could be done with 1Mhz, 8 bits and 48k

    think Star Blazer by Tony Suzuki

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.