Submind YouTube summaries
Thumbnail for The Machine That Says No: 1-Bit Music on the ZX Spectrum - EMF 2026

The Machine That Says No: 1-Bit Music on the ZX Spectrum - EMF 2026

Watch on YouTube

Video summary

The speaker presents a whistle-stop tour of creating music on the original 1982 ZX Spectrum, a machine famously lacking any dedicated sound chip or Digital-to-Analog Converter (DAC). Instead of relying on standard audio hardware like the Commodore 64, this bare-bones computer utilizes an Uncommitted Logic Array (ULA) to generate sound by vibrating its internal speaker. By toggling pin 28 of the ULA between high and low states at specific intervals, the system produces square waves that create audible frequencies; however, doing so consumes nearly all processor power, effectively halting other tasks like running games or reading keyboard input unless cleverly interleaved with short pauses. The presentation demonstrates how even simple beep commands in BASIC can form rudimentary melodies, though these often sound harsh and piercing due to the limited frequency range of the tiny speaker inside the console's casing. To overcome the limitations of a single square wave generator, the talk delves into Z80 assembly language techniques that allow for more complex audio manipulation through precise control of pulse width modulation (PWM). By varying the duty cycle—the ratio of time the signal is high versus low—programmers can alter the tonal quality to sound less like a harsh beeper and more like a synthesizer. The speaker explains how mathematical calculations regarding T-states, or clock cycles per instruction, are used to determine exact frequencies, such as generating a 668 Hz tone. Furthermore, by rapidly switching between two different pulse widths in quick succession, the system creates an interleaved effect where human ears perceive two distinct notes playing simultaneously, effectively simulating polyphony on hardware capable of only one bit of audio data at any given moment. The presentation highlights significant advancements made by community figures like Wham and Tim Follin, who pushed these constraints to create sophisticated music boxes with percussion rhythms and duophony. The speaker builds upon their work by hacking existing routines to integrate keyboard input for real-time performance, allowing users to play tunes while managing the processor's limited resources through careful timing loops. Advanced demonstrations include using two connected ZX Spectrums to achieve "two-bit" stereo sound, where each machine handles a separate audio channel, resulting in richer and fuller musical arrangements that exploit the hardware's inability to reproduce low-frequency artifacts due to its small speaker design. Ultimately, the video concludes by celebrating the ingenuity required to turn a simple computer beeper into an instrument capable of playing jazz-like melodies and complex compositions without modern sound chips. The speaker acknowledges the contributions of pioneers in this niche scene who turned technical limitations into creative opportunities, proving that with enough mathematical precision and clever programming tricks, one can produce surprisingly good music on 1982 technology. Through a combination of assembly language loops, pulse width manipulation, and multi-machine setups, the talk illustrates how enthusiasts transformed a machine designed merely to beep for error messages into a versatile musical tool capable of surprising auditory results.
Read the full video transcript
[applause] >> Thank you. Hello. I'm on the back. So, this talk is a whistle-stop tour. So, I'm going to go dead quick through this cuz I've got quite a lot of notes that I want to get through. Um I'm My journey My journey is of trying to to make my ZX Spectrums I don't want to pluralize it to spectra. It feels weird. And my ZX Spectrums make nice noises. ZX Spectrums do not make nice noises. This gives me massive anxiety this in the background if anyone has had one. For I'm expecting this any moment. Um which is a classic thing. I'm using I'm using two Spectrums proper and a recreation of one using Chris Smith's recreation of the ULA. But, for all intents and purposes, it's three 48K ZX Spectrums 1982. >> [cough] [clears throat] >> The Spectrum itself, he says shouting, can make noise. But, it's it's not very good and most importantly, this happens. It doesn't do anything. While it makes the noise, it completely uses all of the processor power to use the noise. And that's a bit of a pain if you want to do something what musical for instance or indeed fun with it. So, it's a cheaper machine 1982. It's cheap at the time. It's competing with things like the Commodore 64 that has a dedicated sound chip. This has no sound chip. This has no no DAC, darling. This is just a bare-bones machine. The technology itself dates back to 1950s really where you've just got a beeper. The idea is the beeper will beep to tell you the computer has done something. It's not for making music. So, anything beyond that is a little perverse. If you want to leave now, that's fine. >> [laughter] >> I'm cheating and using flash loading. Watch. No tapes. >> [music] >> I DON'T WANT TO SHOW OFF, BUT I QUITE LIKE THIS piece of music that I wrote. But, it is just using beeping. It's in basic and it's just the beepy bit. I see you nodding your head. Like you're you're bopping to this. Um I think we should stop there. Um It's a really It's a really simple program. Hm. And it uses a lot of beep commands stored in data statements. It's a little bit reductionist as a way of making music, but it is possible. In 1985, Sinclair introduced the 128K Spectrum. This does not exist in my life. This had a AY-3-8190 series audio chip in it, which was a legacy thing from We don't include that. I'm not interested in that. I'm interested in the idea of how we can make it on the original machine. Lesson time. I wrote this in basic as well. I'm going to tell you about the ULA. That's the uncommitted logic array that Ferranti built to go within the ZX Spectrum. This is Sorry. This is >> [laughter] >> I can't move out of everybody's way. It's where it is. Hello. The Z80 processor, a really common processor at the time. The ULA was built and it did lots of the input and output. Now, it has a load of pins. It's got 40 pins, and this one pin 28 is the one we're interested in. It's directly connected to the buzzer speaker. We can move that speaker into one of two states, high or low. A little bit of physics. We can move it high and low, so we can move the speaker both forwards and backwards. If we do that at a regular interval, we get sound of a particular wavelength and thus a particular frequency. Now, there's going to be a question later. David, I'm going to ask you say pulse width, okay? >> [laughter] >> The first thing is a square wave. The second one is a pulse wave of a different width. This has a different tonal quality. This will become important later in the talk. Different duty cycle different pulse width. Okay. Physics. Vibrating the air rhythmically, that's what sound is. We can vibrate the air rhythmically. I'll turn that up. >> [music] >> Right, faster is higher and beyond about 20 times per second we're hearing it as a note. When we're up into this frequency, it's a pretty piercing note. At some point it becomes beyond the frequency of our hearing and dogs can play and young people. >> [laughter] >> Um But we can also do the thing where we change the we don't we can change the the the pulse width each time. So, we could shorten it, which I'm about to do. So, it will it will get quicker, which does this. Which is good, isn't it? Yeah, okay. So, we can make sound effects like that. That's really what this was being used for most of the time anyway. Um and it's quite good fun to do. I had to put a note to myself how to get out of that when I'm doing that. We can also make those kind of things by sort of effectively randomly cycling when this is going up and down. This is what we'd expect. >> [laughter] >> I'm going to talk about Z80 assembly. I'm really sorry if this goes over people's head. It won't uh it won't last too long, I promise you. I'm going to teach you four instructions in Z80 and we're going to make a uh we're going to make a musical loop. The people at the front are well trapped, so Right, here it is. Here's my sound loop. This is the most simple sound loop I could think of writing in Z80 assembly, which I have done. The uh things on the left, sound loop, wait, high are just labels. The section in blue is basically repeated the section in red. Uh sorry, the section in black. So, I can take you through the section in black. I load B with a counter, which is 200. I do a DJNZ, not Z. Uh decrease B and then jump when it's not zero. So, that'll be B will go to 199, 198, 100, and so on and so forth. So, it repeats that cycle jumping back over and over. Then, I load the A register with a binary number. Anyone? No, rubbish. Uh and then I send that to the output port 254, which in turn sets pin 28 high on the ULA. Woo. I then do the exact the same again, but I set the pin low. This is why this completely hangs up the processor because it just gets caught in a loop. I'm going to do this now. Oh, no. No, I'm not going TO DO IT. MATHS. I BEG YOUR PARDON. T states. Let me tell you about T states. T states are how how long each instruction takes. Seven, then the maths, 13 * 199, 13 T states, but it does it 199 times. Eight to jump out of the cycle, seven, 11. So, if we can add them all up. I know what you're thinking, sir. It's what about that jump back to the start? That's an extra eight T states, but we're not going to worry about that for this. It gives us this many T states. How many How long is that? Well, in music, given the clock speed of the Spectrum, a whopping just under 3. 5 MHz, 3.4 something something MHz, we get a beautiful 668 Hz tone. I was so pleased when this actually worked out and I then used my app on my phone to check the frequency. Of course, [bell] it's stuck and I need to reset the Spectrum. What we can do though is use the fact that we've got if like persistence of vision, we have that idea of we kind of hear things and we remember them for a little time, so we can do this kind of thing. Right, okay. So, you're all I'm playing this. Um Matthew Smith It's got sound effects, but it also has a tune in game. 1983 AND WHAT IT'S DOING WE CAN hear it actually. It's jumping to the sound routine, making a little bleep, and then jumping back to the game. And it's doing it repeatedly and we're getting Hall of the Mountain King. Very nice. Um it actually runs slightly quicker if you turn the music off. >> [laughter] >> If you speed running the game, that's what you want to do. If you speed running Manic Miner in 2026, what are you doing with your life? I wanted to make nice music and I thought I could probably steal that idea. I can write something in that 8T so I can in that interleave time, I can read the keyboard. Reading the keyboard is a really frustrating on a Spectrum. Um but there it is. So, I've done this. Ignore that. Right, and I'm going to do that. Look, I have >> [music] >> Yeah, that went wrong in the end. >> [laughter] >> Thank you for clapping early. Um It's not very nice sounding, is it, though? >> [applause] >> In my journey to try and make better sound, yes, I did do that. Thank you. That's what I've been doing this week. Writing Z80 bloody thing. I designed a font for this. I hope you're all happy. David coming back to [clears throat] you. What makes things sound nicer? PULSE WIDTH. YES, WELL REMEMBERED. SO, BY CHANGING the pulse width, we could probably do something so we don't end up with square waves all the time, so it might sound more interesting. Um I'm not the first person to to think of this. Joffa Smith, uh Jonathan Smith did some excellent programming in the 1980s with some stuff I'm not going to demo his work. It's far too good. I'm going to play with mine instead. Um so Sorry. Sorry to all of you. Um we can hopefully hear during this piece of music that the beeping is not so square wave. It's a little bit more synthy, if you will. Um thanks. It just runs because obviously no keyboard routine. So, uh we're going to have to wait. Putting the pause in right at the end. >> [music] [music] >> That pause not worth the effort. I put that in this week, as well. Um Back to here. Um I was going, right, okay, if I'm clever with my fancy pants Z80, I can read the keyboard and work out how long each reading of the keyboard God, it's annoying. Reading the keys on the outside of the keyboard are quicker than reading the ones to more at the middle. That's a frustration. I know. So, um having having done that, I just like, "Well, well, we can probably play something. I can probably do that. Probably." So, I will go to this one. >> [clears throat] >> Thank you. [laughter] So, this though I'm doing the same thing and I'm using that if I go lower we can hear the more sort of like the pulse width changing slowly. Woo, woo, woo, woo, woo. Very good. Well done me. I was proud of that. We now have to come to the most important contribution to the Spectrum music scene, two gentlemen. Um Wham. Um so, uh Uh fantastic programmers. They released Wham the music box. Melbourne House, God knows, Australian software company, 1985. [laughter] Goodness knows how they got that license and why they thought this would be a good idea. Um but it's a good piece of software. It's Careless [laughter] Whisper. Uh but notice we have two often it. We have two notes at the same time. We also have percussion built into it. Well, I can't do percussion at the same time as the music. So, uh careful. It's coming up, so I'm going to let it happen. Oh, where's the next one? Oh, there's two in it. Yeah. Okay, fine. Let's have a go at it. Has the music just stopped for a reason? We'll find that out. Yeah, okay, that's fine. Try try try try. So, I was like, I can I can hack out the routine. Actually, I didn't have to do do the work. Some other people other nerds had hacked out the hacked out the routines in in advance. Built on the shoulders of giants and all that. So, I've hacked out the routine from that. >> How are we doing for time? Uh 15 minutes. >> Brilliant. Okay, so again, I've sort of like built this into something I play with the keyboard. We can hear now the same kind of repetition that we had before when it was hopping between notes, but also we've got duophony. This is quite hard. Not this goes hard, like the kids would say. This is quite tricky. Yeah, absolutely terrible. >> [laughter] >> But, you saw what I was going for. Um >> [applause] >> Other people's routines were hacked and doing very similar things. Exactly the same thing where we can have two notes at the same time, but it's doing that. How is two notes at the same time happening? It's magic. It's just magic. NO, IT'S WE'RE BACK TO ANDY'S physics lessons. Right, so here is a very narrow pulse width thing at a particular wavelength at a particular frequency. Here is another thing at a different frequency. Here are the two interleaved, known as an interleaved pulse train or similar. People use different words to describe that. But, in decoding this is as our ears, we hear this as two different tones happening at the same time. So, if we're clever enough with the mathematics of how long each instruction is doing and we're doing two separate counters, we can kind of create this fake polyphony. Polyphony. >> [laughter] >> That was rubbish, wasn't it? I bring you to Tim Follin. Tim Follin was about 16 when he started programming in the '80s and he did horrifically clever things with this. I'm in awe of this gentleman. He So, here he is taking that to the extreme where he's playing with lots of pin pulses in chains pin pulse streams that play together. The music sounds distinctively one bit fizzy, which is an effect of it being the way it's being done, but also it becomes quite quiet because of the fact that the speaker is spending most of its time in one position. It's just hopping up and down, but it's really impressive. >> [music] >> Amazing. Note the uh percussion rhythm, ISN'T IT? YOU CAN'T PLAY THE GAME WHILE YOU'RE DOING IT THOUGH BECAUSE OBVIOUSLY IT'S taking it up all the processor. The game's uh terrible. I went polite there. The game's terrible, but flipping heck, the music's good. Um Notably, it doesn't matter it doesn't matter that there's absolutely nothing in the low end and stuff going on. The speaker built inside the spec There was no way of getting the sound out of the Spectrum unless you were to generally It wasn't coming through your TV. It's coming out of a speaker inside the body of the Spectrum. It's tiny. So, if there's any artifacts in the low frequencies, it really did not matter because they would just not be able to reproduce it by the speaker. So, uh exploiting that. But, crikey, this is good. Um so, I uh take you to another piece of music. This is going to uh so, this is using the same kind of pimples thing. I'm going to play it by hand. It's a bit weird. Uh again, just give me time. >> Uh 12 minutes. >> Okay. Uh I want >> [bell] [bell] [music] >> Right. That'll do with that. Um so, we can hear THAT PIMPLES THING. >> [applause and cheering] >> I'M BASICALLY INTO DEMOING DIFFERENT things here. So, uh this is Yeah, okay, this gets a bit weird. Uh so, that was kind of pimplesy stuff and sounds like this. The next thing is again a new the lifted engine. Um I So, I wrote this software. You might notice the border changes at the same time as I do stuff sometimes. That's because writing to the speaker also writes to the border. If you choose to Yeah, I know. If you choose to go, I want to leave the border black, you're masking out the particular bits to do that. So, um sometimes I just quite like it. Apologies for the epileptic in the audience that are going, "Oh, yes, that's triggering for me." Um so, hm um it should come with warning. Yeah, uh right. Uh, this is using the sandwich engine that's known because it was from a particular game. And then I'm going to move to something with two spectrums, so hence I've got those set up. I'll just do this quickly cuz it's got percussion and it's quite nice. >> [clears throat] [music] >> There we go. So, that was that. But, hopefully you can hear there's some quite fun playing with the way the pulse width is changing, but also the way there's interleave percussion and I'm controlling it kind of segment by segment by hand. Right, I'm going to do something on two spectrums. Obvi- Not obviously. I can't Pardon? Two-bit music, yes, two. One bit is never enough, so two two spectrums is Let's get out of that and do this. I mean, I might not be doing anything, but I No, I am, I promise. Right. >> [music] [music] >> GOD DAMN >> [cheering] [applause] >> RIGHT. UM, I'M GOING TO I'M GOING TO CONCLUDE HANG ON. I'M GOING TO CONCLUDE HERE, but acknowledgements where acknowledgements are due. Nothing could be done without these people's contribution to the Spectrum one-bit music scene, particularly George Michael. Um Uh, some of those people I believe are not their given names at birth, but there we go. Uh, I made some flashy things to make it pretty. And then I left you with a gentle piece of music I've written. IT'S IT'S [music] QUITE JAZZY. >> [applause] [applause] >> THAT WAS ANDY JENKINSON AND THE surprise second bit. Give him another big hand, folks, because that was incredible. Thank you. >> [cheering] [applause]