RPi Python Library Has Retro Chiptunes And Speech Covered

Breadboard containing speech synthesis chip

The classic SP0256-AL2 speech chip has featured a few times on these pages, and if you’ve not seen the actual part before, you almost certainly have heard the resulting audio output. The latest Python library from prolific retrocomputing enthusiast [Nick Bild] brings the joy of the old chip to the Raspberry Pi platform, with an added extra trick; support for the venerable AY-3-8910 sound generator as well.

The SP0256-AL2 chip generates vaguely recognisable speech using the allophone system. Allophones are kind of like small chunks of speech audio which when reproduced sequentially, result in intelligible phonemes that form the basis of speech. The chip requires an external device to feed it the allophones at a regular rate, which is the job of his Gi-Pi library.

This speech synthesis technology is based on Linear-predictive coding, which is used to implement a human vocal tract model. This is the same coding method utilized by the first generation of GSM digital mobile phones, implementing a system known as Full-Rate. Both an LPC encoder and an LPC decoder are present on the handset. The LPC encoder takes audio in from the user, breaks it into the tiny constituent parts of speech, and then simply sends a code representing the audio block, but not the actual audio. Obviously there are a few more parameters sent as well to adjust the model at the receiving side. The actual decoding side is therefore not all that dissimilar to what the AY-3-8910 and related devices are doing, except you the user have to create the list of audio blocks up-front and feed the chip at the rate it demands.

Hardware-wise, [Nick] doesn’t document his breadboard build, but the SP0256-AL2 is fairly easy to drive. It is simply a matter of level-shifting the 3.3V logic of the Pi into the 5V domain of the chip, then bit-banging it with a few parallel GPIOs. The PCM audio output is then low-pass filtered and fed into an audio mixer and power amplifier.

The AY-3-8910 can be similarly treated, except it contains its own DAC blocks, so the output is already analog, and you could simply feed the analog outputs directly into the shared mixer with the above.

We’ve featured the AY-3-8910 sound chip before, with this simple hack, which turns an Arduino into a MIDI device. Check out the sweet chiptunes version of Mozart’s Queen of the Night Aria from his Opera ‘The Magic Flute’ in the earlier article linked.

The video after the break gives a (somewhat short) demo of the resulting speech audio you can expect, as if you didn’t already know.


4 thoughts on “RPi Python Library Has Retro Chiptunes And Speech Covered

  1. In the early 1980’s I purchase the SP0256-AL2 from Radio Shack and connected it to the I/O port on my TRS-80 (stone age Z80 PC). I also created an interrupt routine (hardware driver) to help with text-to-speech conversion; It ran in the background while using TRS-80’s popular Scripsit word processor.

    Now the word processor could provide an easy way to talk — Just type in any allophone based sentences, hit a special key combo, and the robot sounding fellow started talking. This was considered magic in its day.

      1. I love the SP0256-AL2… this chip was all over the place in Speech Synths of the 80s.

        For the Amstrad CPC, we had the Amstrad SSA-1, and the DK’tronics speech synths, both used the SP0256-AL2. I owned a DK’tronics for my CPC 464 in 1985. Recently, I have re-created / re-engineered these classic CPC speech synths here. LambdaSpeak 3 includes a real SP0256-AL2 (hard to get these days!) and is 100% compatible with the SSA-1 and DK’tronics.


        The text-2-allophone conversion was done with a piece of driver software on the CPC. The DK’tronics also came in a more expensive “deluxe” version with had an additional ROM containing the driver. My DK’tronics speech synth was without the ROM and I had to load the driver from tape every time (I didn’t even own a disk drive in 1985… that came 2 years later).

        Did I head TRS-80? Then maybe you guys are in the mood for a modern DECtalk-based Speech Synth for the TRS-80 that also emulates the Votrax (and hence, the TRS Voice Synthesizer and the VS-100):


        Seems I have a passion for speech synths ;-)

  2. Nice! Love the SP0256-Al2. I recreated two Speech Synths for the Amstrad CPC based on the SP0256-AL2:


    The text-2-allophone is done by the CPC driver software. The original 1985 speech synths are from DKtronics and Amstrad (SSA-1). There was also a version of the DKtronics that came with a ROM containing the driver. I owned the ROM-less version of the DKtronics in 1985. Had to load the driver from cassette :-)

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.