ZX Spectrum: Turning a 1-Bit Beeper into a Chord Player
ZX Spectrum: Experimenting with 1-Bit Sound
The author experiments with the ZX Spectrum's 1-bit speaker, implementing PCM playback and attempting PWM, but focuses on achieving multichannel sound (chords) through software mixing. They detail cycle-exact timing on the Z80, present a PCM routine with poor audio quality, and explore arpeggiation as a simpler approach. The post candidly records both successes and failures, offering practical insights for retro-computing audio hacking.
My original plan for this week was to replicate some of the advanced PC speaker techniques on the ZX Spectrum. Unfortunately, that didn’t work out as well as I’d hoped, but that’s OK because I ended up getting a bunch of other things working instead.
- mdp2021
I hope everybody knows Tim Follin - or will now come to know his genius.
> Agent X ( https://www.youtube.com/watch?v=T42WuUpBuHE ) or Agent X II ( https://www.youtube.com/watch?v=gNc_xczyGLc ) or Chronos ( https://www.youtube.com/watch?v=u-D24A_N4d4 ) or Raw Recruit ( https://www.youtube.com/watch?v=kl8dAVybwq8 ) or Future Games ( https://www.youtube.com/watch?v=orEXKOBIv_8 )... // A modern attempt, the ON and OFF album by Rich 'Tufty' Hollins ( https://www.youtube.com/watch?v=4nEfO4Yu7Mg )
(Repost originally for submission Furnace - the biggest multi-system chiptune tracker ever made https://news.ycombinator.com/item?id=41609254)
- asdefghyk
I recall, One bit sound was detailed extensively in Byte Magazine starting in mid 70s. A square wave that has its frequency varied.
A google of the words " Generating speech with a square wave wave , Byte magazine " picks up lots links about this technique.
Fourier transform show a square wave consists of odd sine wave harmonics.
[A more advanced technique (more than one bit) would use microprocessor interrups to generate several sqare waves, output them with more than one IO pin and combine them with a resister network]
This mention of one bit sound made me remember the Lis’ner 1000 project of Steve Ciarca , cira 1984 , WHICH WAS speech recognition system of about 30 words. It used a GI SP1000 chip
- feintruled
The article ends to a link to a video that shows off the technique and it blows my mind the Spectrum beeper could produce this: https://www.youtube.com/watch?v=7cOu32m3wvQ
- a1o
Super cool. Anyone recommends an oscilloscope for this day and age? I loved the Tektronix ones, but haven’t touched one in 16 years. I think it would be nice to have one to look into these kinds of signals - I know they are relatively simple enough to imagine, but this looks like something cool to show to kids.
- sehugg
I did a PWM demo on the Apple II using a format similar to the DPCM samples on the NES. Those samples have a pretty simple format: a 1 bit raises the amplitude, a 0 bit lowers it. So you're kinda approximating the waveform with a bunch of triangles.
The NES has a 7-bit DAC, but since we're bit-banging with the CPU we only have enough time between samples for about 13 levels. Each level has its own toggle-wait-toggle-wait routine, and then we shift another bit and decide whether to branch to the next (level+1) routine or the previous (level-1) routine.
https://8bitworkshop.com/v3.12.1/?platform=apple2&file=delta...