67

One of my favorite videos ever is a tribute to Radiohead "Nude" by James Houston. I have never seen the program in the video available to download, so I've just made an attempt to extract it myself. Here are the steps I tried:

  • Grabbed the audio using youtube-dl by specifying the "best audio" mode, not downloading the video.
  • Trimmed the audio file to the ZX-Spectrum blocks using Audacity.
  • Mixed the stereo channel into a mono (Audacity).
  • Resampled the audio file to 44100 using sox (I probably did something wrong but I couldn't save the resampled audio with Audacity).
  • Normalized the audio to 0dB (Audacity; there's a click in the audio so the normalization effect gained not really much -- is it a blocker?).
  • Converted the result audio to a TZX file using tzxwave from the tzxtools toolkit.

The program in the extracted TZX file does not produce the exact tune that can be heard in the video, so I definitely did some mistakes in the middle (no "R Tape loading error" though). Here is what I was able to extract (gzipped and in base64):

begin-base64 644 nude.tzx.gz
H4sIAAAAAAAAA+1azYtcWRU/7737bteHTxrKCd0idE8SmyGTQYxMphjQRmoR
pBAbfBBLRAhTQcxCn4IObspGqKXQq15nWbuB2rgQ0exqdoL1B9TChZvggJtI
ero9n/fdV9U9xCgaZbII3ff97vk+5557T3/3O+WD6uHrn08+t/2XrAcA7z34
6Q8e7NO/m9CBm/A9XD+AC+jsw8dfufPO3Xc+C3DxS3j3r9evf/Du3/9AS31c
gmMovi0ksh/9bPxw/+c//uF7D397E9eP/4jrv7t58bcvA7x+cX73tRt3j792
/vTe0+8/3zm/de948pv9nRuT84s39s/P33gt+fji6S9uTPzv8f+dP1+/d/zV
959/eOMG/vD8ww/+dL5z/o1j2OpDC6ANsI2MS0gAWh1IH0GGix1wv4YcoNMp
YAbpCtoe3Bl0fJKegZuhTjtQQTolZKfjXYUrPdeFPEFMAY8grcBNhUI7ncne
L8girshew89hAq0CENYuwC14V3EAQ5ZnxcI8Y2S75z6CPCv4Vw99SA/BlcLl
wE2QlHcD/DlJB8C/pjCAdMLCK4V2OmSCE97lM+SiAKKMgCwtY0CClmkCctrS
xDRZ5Pp1wF9bHiVEkZAOydbq4nZeyfjXNkloK6liMrZSIuZ1J0K2C4eAetGK
GjZrAj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LcmKFm1O
lFD59V23KvT+O2OakghchzX1toDjHzpbzVIs+bgO4/5nEyPnZqduhBqkhGmn
iQxVPTzyHJkpdIp3ipdQtCd1rUeIPNVQ9NEV0uJHqcmLkC7m+sY7Ml5o2yoK
uUMegVX6SKIjuTBqkWogoYVWHYWNbSKy4GQZgMJeiDsH+RTqt5cqKozh1XRg
cyV5UiDB0kgwJxwbZIfeRNKxpsz7dNzmCcyTyoQEKOXRIycYR0XdB1bW9mBo
hXn02E7Vyk7VmSlb780NUxBeiqoatkUwm03rYf2JjMgsISmsJNaxpPj1TlUa
ldDdQUVHtr6wVZyD9mCOIrlp1422XZVxDCRutuPKjhuF1G5LYETRktXeVL22
gh9tJYvxUWgldVCVhqwdmumQt7Q47CeuzPitnsyiowHJ64VN+kpzQRnN/cuo
Mb5l4cQj77VLdAgMKizEOqGRdLg5miTRrHyr/ksGVLxxx2Qbhrb5jt436zkL
YdrQbxa0WNS+uVieZEuUmX0nruzzRNvb/N03xvdhDtWgo0N8oyMx0FdlqQ4P
aKxM2tE5m+vUpm/zmrGshxVGEiZvrjPyjuUsdbNF3TPY3zxo66tm2RZf2PnO
LpM2WAGp4ksvE/+IlDYJpJFsMX1rpqWUNTkvDsKfN7CQRW2WcRHqMLaClEfy
qSoUP+vxite/f9ALl6+fryVPV2v3U0bK1ThceOVxL4xINOt/Qn+BMzngP7Ox
n9+G9B6KN6Q4/9aQf+6pcz8D7l6BK0qkvJ0OD2iXSPu2PhLSp0d7II/tuf2l
EMi7YoFZpmdHGR1J+aH8iVEH4AK++Q/XMM5VJyUAAA==
====

What were my mistakes trying to extract the program in 100% accuracy?


I forgot to mention that I only converted the "best audio" youtube-dl was able to download from OPUS to WAV in order to process that WAV file, not the OPUS one. I'm still not sure about the entire audio "pipeline" configuration before decoding the audio into a TZX file. So, I'm thinking of two ways:

  • either my audio processing "pipeline" is wrong so that tzxwave extracts what it actually can (+ there are some more options in tzxwave that I didn't experiment with);
  • or the video features a perfect (despite lossy back to the early YouTube days) audio that may provide a real 100% working program, but the featured program generates a tune that slightly differs from what can be heard in the video by design (no intention to share a program track source by the author, copyright grounds, whatever). Why? No idea. tzxwave might do some corrections fixing "R Tape loading error" itself in certain cases, but I'm not sure about this too because I had tape loading errors multiple times before getting an audible result I shared with PasteBin.
5
  • 12
    I just wanted to say how much I appreciate your question. It is questions similar to yours that make me want to come to Retrocomputing at Stack Exchange.
    – introspec
    Apr 16, 2020 at 10:23
  • Cool project. Are you sure it is the/a real program at all and at full length? The Video is obvious created by cuting and editing various shots. It might be an idea to ask the creator if the loading section is really a complete recording. Not to request the program, but to learn if the task to take it from the video solvable at all.
    – Raffzahn
    Apr 16, 2020 at 11:25
  • @introspec the strange thing is that I never wondered what program is "aired" in the video for ten years. Yesterday I suddenly just tried to google for a TAP or a TZX, and found nothing to download. This led me to some experiments, but since ZX-Spectrum is only a part of my gaming childhood that still keeps sweet memories, and I'm not a sound engineer, my inaccurate attempt led me here. Apr 16, 2020 at 12:34
  • @Raffzahn well, it sounds so and the stuff I was able to extract seems to be loaded without errors but the running result sounds slightly distorted (wrong notes, tempo, etc -- it makes me think that I might use wrong audio adjustments). Regarding the creator: I'll try to ask him. Thank you for the idea! Apr 16, 2020 at 12:35
  • 2
    Well, in that case (distortion, wrong notes) it might as well be a filming of a previous version than the one used in the later video. It's worth to keep in mind that the desired result was a cool remix video. Here elements get mixed for their audio-visual effects, not transport the exact same code as used for the song. We're extreme nerdy here, aren't we? And I definitely like it
    – Raffzahn
    Apr 16, 2020 at 13:14

1 Answer 1

56

First, many thanks for the great question. This may well be my favourite retrocomputing video of them all, so I contemplated having a look at the executable for a while myself. So, this is what I did:

  1. To download the audio, I went to the same YouTube video and used 4K Video Downloader (mainly because it clearly shows which audio is the original one, so that I can avoid an extra re-recompression stage).

  2. I trimmed the relevant audio using Audacity, just like you did. The contents of the right channel has a large DC offset, so I assumed that the left channel must be closer to the original signal: enter image description here

  3. The quality of the signal is pretty low, but to a significant extent this is due to its very low amplitude. In the areas of pilot tone the signal is quite clean: enter image description here

  4. At the same time, where the actual data is recorded, the quality of signal is pretty poor, with rectangular shapes strongly distorted, I'd guess mostly due to the .mp3 compression: enter image description here

  5. Having said that, I think it is also clear that signals are distinguishable, with the bits in my screenshot being 0, 1, 0, 0, 1, 1, ... etc. This gives us hope that something can be recovered here.

  6. There are many programs created for recovery of tape data from audio files. One of the more recent ones is called TapeRecover, written by Andrei Titov (use Chrome to translate the page from Russian). I used this specific program because several people mentioned to me that it works well. It requires a very particular kind of input file: 48 kHz mono .wav file. Transcoding from one discretization frequency to another is not a particularly great step to make, but I had no choice here.

  7. As we might have expected, the program struggled to recover the data from our original file. So, I prepared another one, with +40 dB amplification and hard clipping, to get closer to the shape these signals were supposed to have originally. This is what the resulting data looked like: enter image description here

  8. This turned out to be sufficient to recover the original data, which you can download here: http://introspec.retropc.ru/other/james%20houston%20-%20big%20ideas.tap. I verified it and can see that the binary is 100% the same as the one you recovered, so this is reassuring.

Of course, I couldn't just stop here and had a look at what it does. It turns out that the file plays music on AY8912 chip that was installed into every variation of ZX Spectrum with 128K of memory. The actual driver that plays music is extremely primitive; technically, it is a simple .psg-like player. .psg file format describes the values that have to be written into the sound chip during each interrupt cycle (which happen at a frequency close to 50 Hz). Since the information is stored as register values, the original editable file cannot be easily recovered. This is the disassembly of the player in case you are interested:

; this player is, effectively, the v-blank interrupt handler.
; it is automatically called approximately 50 times per second

    ld hl,(CurPos)      ; current position in the track

FrameLoop:
    ld a,(hl) : or a : jr nz,SkipFrame

        inc hl : ld a,(hl)
        cp #FF : jr z,CommandFF     ; end-of-track marker
        cp #FE : jr z,CommandFE

        ; the actual data is a pair of two numbers:
        ; a register number...
        ld bc,#FFFD : out (c),a
        ; ...followed by the register value
        inc hl : ld a,(hl)
        ld b,#BF : out (c),a : inc hl
        jr FrameLoop

SkipFrame:  ; non-zero bytes are decremented until we get to zero,
    ; i.e. they define a wait time in frames.
    ; this means in particular, that the data gets destroyed
    ; during playback (repeated playback is not possible!)
    ld (CurPos),hl
    dec a : ld (hl),a
    ei : ret

CommandFE:  ; the purpose of this command is not clear
    ; (it simply silently skips some bytes)
    ; luckily, it is never actually used
    inc hl : inc hl : ld (CurPos),hl
    ei : ret

CommandFF:  ; at the end of the track colour
    ; the border black and freeze
    xor a : out (254),a
    jr $

CurPos:     dw MusicPSG     ; current position in the track

MusicPSG:   ; music data follows here
    ; (32841-42169,9329)

However, listening to the tune it is clear that not only the main "voice" of the melody is coming out. I know that your assumption has been that it must mean that your capture has been somehow incorrect. However, I do not think that the chances for this are all that high. We used two different methods and recovered identical results. In addition, somewhat tuneless sounds you can hear – they may well be tuneless because they may be driving devices that introduce further distortions (i.e. detuning may be necessary to get them in tune).

In my opinion, all voices you can hear in the video – rhythm section on the printer, base line on the scanner (with the only exception of vocals) – are originally driven by ZX Spectrum's sound chip. My guess is that sound channels which would normally be joined together and outputted onto the speaker have been separated and used to drive other devices.

Last but not least, do not forget that the video itself has been edited and processed. Just as a somewhat relevant anecdote, I was the main coder for the MMCM's chiptune album: The Blossoming Years. Track 24 of this album is an electronic version of the album, effectively, tape recording of the demo program for 48K ZX Spectrum with an external AY interface. The album was released on the same day as the accompanying demo. However, the demo was not fully ready at the time when the album was being mastered, so as the result, the version of the demo that you will find by recovering Track 24 is not the same as the demo that was actually released.

UPDATE (18/04/2020)

Well, I really liked the theory that ZX Spectrum's AY chip was driving all these devices in the video, but sadly it is not the case. My checks of the music data seemed to indicate that instruments "jump" from channel to channel. This tends to happen when the track is not hand-made, but auto-generated from another format, most likely MIDI. Hence, I did a search for MIDI converters for playing tunes back on ZX Spectrum and found this thread on World of Spectrum: midi2ay 0.1. (The program is no longer available from Geocities, but Archive.org still has it.) The converter takes a .mid file and generates a corresponding .tap image automatically. In fact, the source of the assembly re-player there is also included with the program, from which you can immediately see that it is 100% identical to the re-player we downloaded.

Overall, then, my conclusion is as follows: the music was made elsewhere. The converted MIDI file loaded into ZX Spectrum and apparently playing in the video is highly unlikely to actually participate in the final mix.

15
  • 5
    The author is looking for the original, and mentions that the program needs at least a Spectrum+. Apr 17, 2020 at 9:09
  • 2
    @Spektre, the disassembled code above is literally 95% of code. It definitely does not do anything beyond playing what it is playing. Sadly, the incorrect model of ZX Spectrum in the video seems to be not the only unauthentic thing about the video :)
    – introspec
    Apr 18, 2020 at 8:37
  • 3
    @introspec Sure, it'S a different machine, but it's also the version more people will recognize. Films/Videos/etc. like this are not documentations. They want to transfer a story / message. That works way better using a common model average people can easy identify.
    – Raffzahn
    Apr 18, 2020 at 21:41
  • 2
    @Raffzahn, yes, I fully agree. However, don't you think that if in addition to looking fully authentic, it actually was fully authentic too, it would have been more satisfying? I know that this is a minor complaint and I love the video anyway. However, as a demomaker, I do care about technical authenticity as much as I care about story/message etc. In fact, the medium is the message, so my complaint is not completely baseless.
    – introspec
    Apr 18, 2020 at 21:54
  • 3
    @introspec True, for a demo, it's essential to do all effects live, as it's all about that. But this is entertainment. Asking here for 100% accuracy in pictures is over the edge and feels like criticising George Lukas for adding spaceship sounds. True, Space is silent, but without these goofy, wobbling sounds Star Wars wouldn't be Star Wars. Come on, just think about what length Fluffy and you had to go to even come close to finding the difference. For entertainment this is an awesome amount of authenticity. I for one am astonished and have never assumed it at all.
    – Raffzahn
    Apr 18, 2020 at 22:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .