ZX Spectrum had "Click", but did simulated 3 channel sound. We can too!

(Sarah Cartwright) #1

I was thinking of some of the awesome ways limitations were worked around in the past with limited hardware.

One memory I have is back in the ZX Spectrum days - it had a single port 254, that when a bit was flipped there a “click” was emitted from the speaker.

The BASIC “BEEP” command could be given a pitch, and duration, and with a little bit of maths, and with the programmers of the ZX Spectrum knowing how fast the assembly loop was running on the 3.5 MHz machine, it was possible for them to make it play the note to the BASIC programmers specifications.

Here’s the manual info for it:
http://www.worldofspectrum.org/ZXBasicManual/zxmanchap19.html

For years, this was all the Spectrum did in games, even ones written in assembly - until someone realised they could build a program that simulated 3 channel sound with actual instruments!

This was on a 3.5 MHz machine, so the overhead of managing those sounds through the simple PORT(254) click made the sound very scratchy - but it was music!

Here’s the main menu music demonstrating the effect in "Trantor The Last Stromtrooper."

Here’s a link I found to the ZX Spectrum also running something like the same audio engine for other music in game intros (Star Wars is near the end if you want to head a tune you know. My favourite is after it - Twin Turbo V8… it wasn’t a bad game either!):

Remember - this is the simple ZX Spectrum having it’s “click” PORT(254) being manipulated to make these sounds.

It’s worth noting that it could not be used in game on the ZX Spectrum, because of the massive demand on the 3.5MHz Z80 CPU. On a 16MHz Arduboy - it may be possible.

Sadly - I am unable to find the code for this awesome audio engine - if it could be found, the job would be converting the Z80 assembly to a flowchart - then from there to C.
EDIT:
I’m making progress - there’s a “1 Bit Beep audio” group online, and one of their number has made a ZX Spectrum audio emulator (not the spectrum itself, but a Windows program that lets you compose 3 channel sound) called Beepola, I’m hoping to find more about the algorithms on Forums that talk about this software:
http://freestuff.grok.co.uk/beepola/

Here’a a forum I just found for emulator programs (and their code! Woo! Getting closer!)
http://randomflux.info/1bit/viewforum.php?id=2

A list of Beep programs…
http://randomflux.info/1bit/viewtopic.php?id=25

I keep seeing “Special FX (Fuzz Click)” appearing again and again - I think this is the program I need to find that produces the audio of the games above.

Ok, just found this page that lists A LOT of music engines - many where contracted out to game developers like Code Masters… wow I didn’t realise programming was so “businessy” back then when making ZX Spectrum software. I always figured the lead programmer coded everything, and there was a data inputter, artist, and musician at most:
http://garvalf.online.fr/index.php?page=musiques_zx.en

So SpecialFX is by Jonathan Smith) and has 2 channel Pulse Frequency Modulation, envelopes, and click drums.

We need to contact him, and ask him very politely how we can go about implementing it in C for the Arduboy!

Does anyone know him? Could you ask him about algorithms, flowcharts or something similar?

EDIT2:
Oh. He died in 2010. Damn I’m getting old - I never thought the programmers I grew up playing the games of would ever pass away. So there won’t be any interesting discussion about his algorithms. =(
I wonder what we can find online?

Finally - here’s a music demo that starts as the simple “BEEP” notes, and then morphs into something more:

1 Like

(Marco) #2

@JO3RI made a usefull 4 channel traker.

Marco

1 Like

#3

Well we did and we also created an editor for creating music :slight_smile:

http://teamarg.github.io/trackerEditor/

and even an online player you use to play those song.h files

https://teamarg.github.io/ATMwebplayer/

AND if you want to know how it sounds, we’ve put the titleScreen music for Arduventure online too:

2 Likes

(Pharap) #4

In fairness, he was only 43.

He was from Widnes in Chesire (next to Greater Manchester) and aparently died because of some undisclosed illness.

0 Likes