Whatever the first computer you used to manipulate digital audio was, the chances are it came with dedicated sound hardware that could play, and probably record, digitized audio. Perhaps it might have been a Commodore Amiga, or maybe a PC with a Sound Blaster. If you happen to be [NICKMANN] though, you can lay claim to the honor of doing so on a machine with no such hardware, because he managed it on an unmodified Sinclair ZX81.
For those of you unfamiliar with the ZX, it embodied Clive Sinclair’s usual blend of inflated promises on minimal hardware and came with the very minimum required to generate a black-and-white TV picture from a Zilog Z80 microprocessor. All it had in the way of built-in expansion was a cassette interface, 1-bit read and write ports exposed as 3.5 mm jacks on its side. It’s these that in an impressive feat of hackery he managed to use as a 1-bit sampler with some Z80 assembler code, capturing a few seconds of exceptionally low quality audio in an ’81 with the plug-in 16k RAM upgrade.
From 2023 of course, it’s about as awful as audio sampling gets, but in 1980s terms it’s pulling off an almost impossible feat that when we tried it with a 1-bit PC speaker a few years later, we didn’t succeed at. We’re impressed.
The ’81 may be one of the simplest of the 8-bit crop, but in its day it set many a future software developer on their career path. It’s still a machine that appears here today, from time to time.
26 thoughts on “Digitizing Sound On An Unmodified Sinclair ZX81”
Nice! Reminds me of my teenage self mid ’80’s when I did something similar but on a ZX Spectrum (the ZX81’s successor). Same 1 bit concept. I think it was from a magazine article. I wouldn’t have been (and wouldn’t be now) smart enough to do something like that myself. It was certainly something to learn from back then. Wow. The sound playback is surprisingly good at 1 bit. I mean raspy and nasty but you’d expect that from 1 bit… The surprise is that it sounds as recognizable as it does! I remember a certain young lady visitor giggling racuously as I tried to record it and even the high tones were very recognizable as her.
I also tried this on my ZX Spectrum, when I had learned some Z80 machine coding. Did not worry about sampling rates, just packed the raw bits into memory as fast as I could and vice versa for the playback, which was slightly faster. Anyway, you could recognize the recorded words.
Me too, but with the ZX Spectrum. I used all the available memory including the screen area and coded it to maximise the sample rate. Quality was still terrible though.
Read same article. had been working for company that was using digital audio and wanted to see how bad it would be. was surprised.
I read the same article. Typed in the code and with some trial and error I managed to sample some music. Such fun!
In the early 80s I owned a Jupiter Ace, the FORTH-powered home computer developed and built by Steven Vickers and Richard Altwasser, who developed the ZX Spectrum for Sinclair. It had an arrangement of input and output jacks like the ZX81. I wrote a painfully basic routine in Z80 to read sound from a plugged-in microphone and store the sampled bits which could then be played back via the Ace’s internal speaker. The sound quality was utterly wretched but speech was just about understandable. Anything more complex was just a mess. As a teen I didn’t really understand about things like low-pass filters; had I done so I might have made a better job of it. But it kind of worked which was enough for me.
My mate Ol’ Barry used to optimise by timing his wait for just the right time for the drum to have spun around again before reading his next instruction. That was back in the 1950’s. These days he just writes -O6. Why the HAD retro obsession these days? It’s interesting for sure, but only in an obtuse way and especially when the effort could be being spent keeping up with being current. Too much IMO.
You should apply for a refund.
Barry? Don’t you mean Mel?
Because when we forget our roots we will never understand the new stuff.
That font. The moment I see it I know exactly what machine it is.
I remember, there was a voice on some games already
There was a machine code routine to do this back in the day. I think it may have been published in Your Computer. Not to say this isn’t good fun also.
1 bit digitisation in 1981 on a TRS-80 model 1 (specification not hugely different from a ZX81):
I remember using a program that allowed you to both record and play such audio on Didaktik M (Czechoslovakian ZX Spectrum clone) back in the day.
It is called “Edit Sampler”, made by Proxima Software in 1990, that “High quality edit sampleeer” default sound with the heavy Czech accent is hard to forget :)
Now doing this on ZX81 with even less RAM is crazy but then one doesn’t have the entire application/UI in memory.
My mom did it on her Apple ][ back in 1978. 1 bit record/playback through the tape interface jacks. Next she did 2, then 3, bit record/playback through the joystick interface (which supported 3 button inputs, 4 outputs (and 4 potentiometer inputs)). For playback, she wired up a R-2R ladder as DA. For 2 bit record, she used 3 op amps as comparitors with CMOS logic chips to encode 2 bits. For 3 bit record, she managed to get a 7-input “priority encoder” chip, feeding it from 7 comparitors.
You have a cool mom! When I got my ZX81 to (slowly) draw a circle on the screen using SIN and COS, she couldn’t understand what a feat of teenage engineering it was.
In 1985 I was a judge in a science fair where one entrant used a ZX-81 to digitize sound and do voice recognition. It could reliably recognize the numbers zero through nine, and ‘yes’ and ‘no’. Impressive at the time.
Another one at the same fair used an Apple ][ to make a 3-D digitizer from images using structured light projected from a slide projector, and did real-time 3-D rotation of the resulting contours. Also impressive.
Neither of those two won, despite my vote. The kids with the smooth delivery and glossy printed graphics won, even if their science was questionable. I’m sure that message was not lost on the other kids. #cynic
“All it had in the way of built-in expansion was a cassette interface, 1-bit read and write ports exposed as 3.5 mm jacks on its side.” Is incorrect. The machine had an expansion port on the back. I added extra RAM, a thermal printer and 300 baud modem. One could have built a sound board.
Read it again. The expansion port is not built-in expansion. “You *added*… “.
This sounds exactly how I imagined a color clash would sound like.
I remember doing this after dipping into The Complete ZX81 ROM Disassembly, a great source of inspiration. I think I managed to record and playback about 8 seconds of crappy sound.
Log long time ago there was a book about using ZX81 as a digital storage oscilloscope. It was a bit more complicated that this, it used a proper ADC connected to the expansion port. I still have it somewhere, I will try to find it.
Found it, title of original is “Mit dem Computer messen und oszilloskopieren” by Hubert Joas. He used ZN-427, 8-bit AD converter.
Interesting. There also was a similar project mentioned in a PC book. It used the analogue IBM gameport has a A/D converter, among other things.
Another project was about building an image scanner using a daisy wheel printer and a photodiode. It had lots of cool projects, similar to those found on home computers.
The book was from the late 80s and called “PC – Bastelbuch”, I think.
There was a ZX81 machine code program which controlled interference enough to play very crude notes if you tuned a nearby radio to the right frequency. On the plus side it worked, on the down side it probably highlighted hardware noncompliance with FCC regs. If it did this with a TV station instead then obviously the last part doesn’t apply, it’s been 40 years and my memory’s not perfect.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)