ZX Spectrum: Experimenting with 1-Bit Sound

70 pointsposted 5 hours ago
by ibobev

21 Comments

mdp2021

4 hours ago

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)

thatmf

3 hours ago

Wow, that Chronos track is like early My Bloody Valentine!

khedoros1

an hour ago

> My previous work with PWM relied on being able to set a hardware timer to control when the speaker turns on and off.

I've got an Arduino project where I did that. The output is on a single digital pin, audio encoded as PWM. It turns the output off at the beginning of an audio frame, and sets a timer to trigger an interrupt when it's time to turn the output on.

I've got a memory block of event structs, each event representing a write to NES sound hardware. I emulate enough of the features to support everything that the Legend of Zelda title theme uses. 16MHz is more than enough to decide on the sample for 2 square channels, 1 triangle, and 1 noise, outputting a 6-bit output sample at a 31250Hz sample rate. The output is only slightly scratchy; the polyphony is actually surprisingly smooth.

feintruled

5 hours ago

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

gxd

4 hours ago

I created a program like that back in the day. In my case, I recorded my voice through the "MIC" input and played it back through the TV. A few seconds of sampled audio required the entire available memory. While I fully understood what was going on, I thought it was magical that the Spectrum could "speak with my voice".

louprado

4 hours ago

More mind blowing, that entry took _second_ place! First place would probably break my brain for the day so I won't look it up.

Release party: DiHalt 2026 summer Compo: Demo Platform: zx spectrum Ranked: 2nd

MichaelRo

2 hours ago

I gotta try this on real hardware, reading the original article it seems it's barely audible without an amplifier, unlike on an emulator.

Will post an update after I get back to my parent's home, where I have these beauties that launched me into computer science: https://imgur.com/a/GKrA0vX

codazoda

5 hours ago

Sounds pretty good. Reminds me of the Demo Scene and the types of music they were able to create.

asdefghyk

3 hours ago

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

gwbas1c

3 hours ago

> multichannel sound through the 1-bit speaker—basically, playing chords.

Ahem, that's polyphonic sound, not multichannel sound. Multichannel sound is playback through multiple speakers.

ssl-3

34 minutes ago

Perhaps. I think these words have somewhat flexible definitions, and that thought process leads me to some rhetorical questions.

Questions like: How many channels can a mod file[1] have? Does that number of channels this file has change depending on whether it is being played back with monophonic or stereophonic (or some other arrangement of) speakers? What happens to the count when one or more individual samples within that mod file contain polyphonic data (chords!), themselves?

It also leads to rhetorical statements, such as: When I play a film that has a soundtrack with 8 (ie 7.1) discrete audio channels on a stereophonic pair of speakers with a sane playback chain, I'm definitely still hearing all 8 of those channels. The same happens if I extend that stereophonic system to greater number of output channels, by adding surround speakers (quadraphonic!) or whatever.

Or maybe I take one earbud out and put it back in its charging case, and through the magic of active electronics, good software, and wireless comms, the output deliberately collapses to being monophonic.

However it happens, I've still got an 8 channel of film soundtrack in my ear(s).

And of course, it also works the other way: If the electronic musical keyboard in front of me is said to support 10-voice polyphony, then that's a hard limit on the number of notes it can produce at once regardless of the number of audio output channels.

Multichannel and polyphonic are pretty bendy terms, I think. Maybe that flexibility was wrong at some point, but they've been flexible in this way for so many decades that it definitely seems right to accept the overlapping uses as being correct.

[1]: https://en.wikipedia.org/wiki/MOD_(file_format)

geori

4 hours ago

Reminds me of an experiment that we did with TI calculators in the late 90s. Someone found that you can put an AM radio next to the calculator and it would beep based on what instructions were run on the Z80. There were some demos that played songs via 1 bit beeps like this, but since games actually have to run instructions, you couldnt reliably play background music during gameplay.

bezko

4 hours ago

Turns out 1-Bit encoding is the most efficient solution, even for the highest end of audio quality: https://en.wikipedia.org/wiki/Delta-sigma_modulation

adrian_b

3 hours ago

Depends on what you mean by "efficient".

Delta-sigma modulation generates an inefficient encoding of the audio signal, with much more bits than necessary.

Converting a delta-sigma encoded bit stream to a PCM (pulse-code modulation) stream (e.g. with 24-bit or 16-bit samples at a sampling frequency of 48 kHz or 44.1 kHz) is a method of data compression.

On the other hand, delta-sigma modulation is more efficient for both analog-to-digital and digital-to-analog conversions, in the sense that for a given quality of the conversion it is much easier and much cheaper to make ADCs and DACs with delta-sigma modulation than with pulse-code modulation.

Because of this, for audio signals, normally delta-sigma ADCs and DACs are used at the analog inputs and outputs, but the delta-sigma bit stream is converted by digital filtering to PCM for data storage or for audio processing.

alienbaby

4 hours ago

Some apparent links don't appear to work at the start of the page, and I couldn't see any links to listen to the output?