REALLY technical details about the Spectrum loading signal
REALLY technical details about the Spectrum loading signal
In an attempt to unlock the arcane secrets of the SAM Coupé blocks on the Enigma tapes, I will need to know more about the way the Spectrum (and, presumably, the SAM Coupé) actually records data to tape.
All I know is, there are three frequencies used: 800 Hz for the pilot tone, and 1 kHz and 2 kHz to generate the 1s and 0s.
But there I was also thinking that 1s and 0s were an equal number of cycles. That was, until I wrote this program:
10 POKE 65368,255
20 POKE 65369,0
30 POKE 65370,170
RUN it, SAVE "bob" CODE 65368,3 then run that through TZX2WAV, open it in Audacity and it should confirm what I thought 1s and 0s looked like, as a waveform.
It doesn't.
After the pilot tone there is a single cycle at 2 kHz.
Then there are SIXTEEN cycles at 1 kHz, representing 11111111.
Then there are EIGHT cycles at 2 kHz, representing 00000000.
Fair enough, I thought: a 1 is two cycles at 1 kHz, a 0 is one cycle at 2 kHz, hence a 1 is four times as long as a 0, when I'd thought it was twice as long.
But now the plot thickens... ONE cycle at 1 kHz, then ONE cycle at 2 kHz, repeated EIGHT times, makes 10101010... somehow. That doesn't tally with what I'd observed for 11111111.
The Spectrum manual doesn't go into this kind of ridiculously technical detail about what 1s and 0s look like when they're recorded to tape. Why would they, at the time - who bought a Spectrum and then viewed the content of their tapes with an oscilloscope? I know I didn't, not least because I was still in single digits until the +2B was released.
Is there someone out there, possibly someone who has written a tape manipulation utility, who has an accurate explanation of what constitutes a 1 and a 0?
All I know is, there are three frequencies used: 800 Hz for the pilot tone, and 1 kHz and 2 kHz to generate the 1s and 0s.
But there I was also thinking that 1s and 0s were an equal number of cycles. That was, until I wrote this program:
10 POKE 65368,255
20 POKE 65369,0
30 POKE 65370,170
RUN it, SAVE "bob" CODE 65368,3 then run that through TZX2WAV, open it in Audacity and it should confirm what I thought 1s and 0s looked like, as a waveform.
It doesn't.
After the pilot tone there is a single cycle at 2 kHz.
Then there are SIXTEEN cycles at 1 kHz, representing 11111111.
Then there are EIGHT cycles at 2 kHz, representing 00000000.
Fair enough, I thought: a 1 is two cycles at 1 kHz, a 0 is one cycle at 2 kHz, hence a 1 is four times as long as a 0, when I'd thought it was twice as long.
But now the plot thickens... ONE cycle at 1 kHz, then ONE cycle at 2 kHz, repeated EIGHT times, makes 10101010... somehow. That doesn't tally with what I'd observed for 11111111.
The Spectrum manual doesn't go into this kind of ridiculously technical detail about what 1s and 0s look like when they're recorded to tape. Why would they, at the time - who bought a Spectrum and then viewed the content of their tapes with an oscilloscope? I know I didn't, not least because I was still in single digits until the +2B was released.
Is there someone out there, possibly someone who has written a tape manipulation utility, who has an accurate explanation of what constitutes a 1 and a 0?
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Re: REALLY technical details about the Spectrum loading signal
The spectrum doesn't really care about audio waves. All it's interested in is edges, and the number of clock cycles that pass between them.
https://sinclair.wiki.zxnet.co.uk/wiki/ ... _interface
The reason you see 16 1 bits at the start is because the data block starts with FF to indicate it's a data block
https://sinclair.wiki.zxnet.co.uk/wiki/ ... _interface
The reason you see 16 1 bits at the start is because the data block starts with FF to indicate it's a data block
Re: REALLY technical details about the Spectrum loading signal
...and now I see there's a checksum byte at the end, which... doesn't quite explain the extra 10101010. If it's supposed to all the data bytes XORed together, that'd be 01010101 - unless that initial 11111111 counts as well, in which case it'd be right.Guesser wrote: ↑Thu Jul 27, 2023 12:55 am The spectrum doesn't really care about audio waves. All it's interested in is edges, and the number of clock cycles that pass between them.
https://sinclair.wiki.zxnet.co.uk/wiki/ ... _interface
The reason you see 16 1 bits at the start is because the data block starts with FF to indicate it's a data block
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
- WhatHoSnorkers
- Manic Miner
- Posts: 256
- Joined: Tue Dec 10, 2019 3:22 pm
Re: REALLY technical details about the Spectrum loading signal
I had a "clever" idea of trying to get the loading noises to make a tune, so I produced a file of every single byte value and tried to find what the notes were. It was interesting at least with this dodgy app on my phone.
I couldn't work out the logic of what noise was what though.
I couldn't work out the logic of what noise was what though.
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
Re: REALLY technical details about the Spectrum loading signal
So it wasn't you who wrote the Imperial March as a loading signal, then...
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Re: REALLY technical details about the Spectrum loading signal
There is a demo that plays tune from loading noise, but I can't find it right now...
edit:
I think I found it, although there may be others:
https://easyupload.io/kt3ws2
edit:
I think I found it, although there may be others:
https://easyupload.io/kt3ws2
Re: REALLY technical details about the Spectrum loading signal
As @Guesser said, the Spectrum only cares about edges, i.e. the boundaries between pulses, where a pulse is created by either MIC on or MIC off lasting for a certain number of T-states.
Everything you could possibly need know about the standard Spectrum loading signal can be found in the disassembly of the ROM's SA-BYTES routine. It's a fairly short and simple routine.
Everything you could possibly need know about the standard Spectrum loading signal can be found in the disassembly of the ROM's SA-BYTES routine. It's a fairly short and simple routine.
- WhatHoSnorkers
- Manic Miner
- Posts: 256
- Joined: Tue Dec 10, 2019 3:22 pm
Re: REALLY technical details about the Spectrum loading signal
I was inspired by that! I tried to do my "theme tune" in a similar way and then got fed up/distracted.
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
Re: REALLY technical details about the Spectrum loading signal
Pegaz wrote: ↑Thu Jul 27, 2023 11:36 am There is a demo that plays tune from loading noise, but I can't find it right now...
edit:
I think I found it, although there may be others:
https://easyupload.io/kt3ws2
I played around and did some tunes years back. It was only when I uploaded one to youtube, and it started showing me related videos, that I found out I had just re-invented the wheel with this. There were some Russian coders who had gone as far as making loading noise trackers, complete with arpeggios, drum tracks and more harmonious signals than I managed to produce.
This was my attempt:
Re: REALLY technical details about the Spectrum loading signal
Colour me impressed, any by colour I mean with attribute clash...
But still impressed nonetheless
Nice work!
But still impressed nonetheless
Nice work!
- 1024MAK
- Bugaboo
- Posts: 3172
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: REALLY technical details about the Spectrum loading signal
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer being good this year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer being good this year.