Using Audacity as a virtual tape deck

I’ve enjoyed playing with the old speccy again, but whilst I can easily load up games using an Android app called PlayZX, what I couldn’t do was save anything – either a games progress, or more specifically, any BASIC program I had written.

That was until I had a brainwave and thought about Audacity, and whilst I did record the tones, they wouldn’t load back into the device

I even installed a second sound card and connected that directly to the MIC and EAR jacks on the back of my 48K – but had the same issue

After a bit of research I found a reference stating that the signal that my PC was receiving was way too low for the spectrum to “hear” when played back. I had a look around Audacity and found that there was an “Amplify” function that, when I applied, certainly increased the tones.
Playing it back this time, I noticed a change straight away, in that I could now hear the squawks and squeals of data being loaded in, and sure enough the program was found and loaded in

So, for those who want to know how I did it – then read on.

What you’ll need:

  • A ZX Spectrum – duh!
  • Preferably the Ear & Mic leads that came with a spectrum – but suitable alternatives should be fine
  • A suitable PC (Running Windows or Linux) or a Mac
  • A Sound Card that has either a “Line In” or “Microphone” port
  • A copy of Audacity – (Download here)

Wiring the Spectrum up for audio

This is fairly simple

Plug each cable into the back of the spectrum and into the sound card, making sure the cable in the “EAR” socket goes into the headphone socket on the sound card, and the “Mic” lead into either the Line In or Microphone jack on the soundcard

In this case the green (yes it is green) cable will go to the headphone socket on the soundcard, and the black one to the Line In / Mic socket

And that is all there is to it – just like you would have done way back then but to a tape cassette

Configuring Audacity

Now that we’re all setup on the hardware side, it’s time to get Audacity ready.

Firstly install it if you haven’t already then, once done, come back here

Ready? Good

With Audacity open, we need to ensure we have the Device toolbar showing – this can be found under the View> Toolbars menu and selecting the “Device Toolbar” option.

Now, your options may be different to mine, but essentially the 4 drop down boxes should look something like this:

  1. Windows DirectSound
  2. The Line In or Microphone from your soundcard
  3. 1 (Mono) Recording Channel – Not Stereo as the ZX Spectrum is Mono only
  4. The appropriate speaker for your soundcard

And that should be it – you may find you need to play with the volume sliders above but that will vary for everyone

Our Test Program

For this test I am just going to use a the basic BASIC program that has only 2 lines

This is all we need to be able to send some data

Saving

Now, for the interesting bit.

On the Spectrum type SAVE (by pressing S) then in double quotes (SYMBOL SHIFT + P) the name of the program, eg SAVE “test1”

And press enter, you should now get this prompt:

Don’t press anything yet!
First go back to Audacity and press the Record button THEN you can press any key on the spectrum

All being well, you should see the familiar CYAN and RED bars scrolling in the border, and a brief YELLOW and BLUE before returning with this message:

In Audacity you should now see what looks like a straight line – but all being well – that line should contain some data… For now, just click the STOP button to stop the recording

Editing

In order for the Speccy to read the data that we have just recorded in Audacity we will need to amplify the recording.

To do this we need to select the recording by clicking the “Select” button to the left of the recording

Then use the menu at the top to select “Effect” > “Volume and Compression” > “Amplify…”

Which should then open a small dialog box. Simply click “Apply” here

Now in Audacity, our line should look something like this:

All that’s left to do is to trim the end off – so just use your mouse and, just after the end of the recording left click and drag to the end – then press delete to delete that “tail” to leave something like this

You can do the same at the start if you have a line that is longer than, say 0.5 seconds – it should look similar to the image above

And that is it! All being well, then this should be ready to load back into the spectrum.

Loading

So, to load it, reset the spectrum by either turning it off then on – or pressing the “N” key to display “NEW” then pressing enter

Once done, press the J key for “LOAD” and then SYMBOL SHIFT+P twice for two quotes

Then press enter – the screen will go white as it is waiting for you to press play – so in Audacity – press the play button

And now the moment of truth – all being well it should do this

Now, if you press K for LIST – your program should be back on screen and ready to RUN:

Enjoy and have fun!

The Story of a lost Spectrum

Today, the excellent More Fun Making It posted his latest video on YouTube, and this one caught my eye in particular

In his video he explains about how a custom, hand built and bespoke (his words, not mine)  ZX Spectrum that he had auctioned off on Ebay and then got lost.

The ZX Spectrum had been built specifically for a charity event, with all the proceeds going towards The Befriending Scheme – a UK organisation whose aim is to have a positive impact on the lives of vulnerable people.

The Spectrum was fairly unique: it had a transparent case, with a white cover and keyboard with a purple board inside. It was also included a cassette deck and a ZX-HD adapter – all bundled together into a custom flight case to keep it all together.

The Missing Speccy in it's case
(c) More Fun Making it

It was eventually won at auction and was soon to be sent to a happy new owner in the US. However, it never made it any further than somewhere between Ebay, US Customs and UPS – and not to the one person who was eagerly awaiting it..

For the full story, I highly recommend you watch the video – and if you are into retro computers, especially Speccy’s, then please check out his other videos as well whilst you are there

Spectrum 48K Repair – Part 3

Welcome to part 3 of this series where I try and repair my first ZX Spectrum.

So far, we’ve installed the Composite Mod and replaced the broken keyboard membrane. Unfortunately, the speccy was crashing when keys were being pressed and giving this image:


Lee from the More Fun Making It YouTube channel, kindly pointed me towards transistor TR4 or TR5 being the issue. So off the back of his advise, I ordered the appropriate replacements from Retroleum
ZTX 651 is the TR4 replacement
ZTX 751 is the TR4 replacement

Not knowing which one was at fault I did a quick test – TR5 gave me some connectivity, but TR4 didn’t – so I decided to replace TR4 first

Once desoldered I had a quick look at it

Yep, that is definitely dead – that crack at the top left corner shouldn’t be there!

I put in the replacement transistor, and after checking there were no solder bridges or splashes, I re-attached the keyboard and powered it up…

This is as far as we got the last time, but when I pressed enter the screen went all funky.. what will happen this time

Well that looks promising – I added a 20 GO TO 10 statement and ran the program

Looking good! No sign of any screen corruption and the speccy didn’t lock up

Now it was time for to do a quick RAM test to ensure it was seeing all the RAM.. I was fairly confident that it was seeing at least the 16K of lower ram, but I wanted to ensure it was seeing all of the upper ram as well.
A simple line of BASIC can get the RAM count:
PRINT PEEK 23732+255*PEEK 23733
(Ignore the L at the end – that is the cursor but not inverted!)

Ok – press enter and lets see what we get – we should be seeing 65536 (48K)
If it only shows 32782 then this would indicate that it’s either a 16K spectrum, or the upper ram in a 48K is faulty

Excellent – we have all the RAM!

We now have a working spectrum!

To finish off time to load a game and go back in time to my youth..

And there we go. For this test, I was using a TZX file, that I converted to a WAV file and then with the EAR socket of the speccy connected to my headphone socket on the PC, I could then use Audacity as a Cassette player and load the game.

And there we go – a fully restored speccy that was built in the early 1980s working again in 2024 – over 40 years later…

Spectrum 48K Repair – Part 2

Welcome to part 2 of this series where I try and repair my first ZX Spectrum.

So far, we’ve installed the Composite Mod and managed to get it boot, but not been able to get much else due to a broken keyboard membrane

Well that finally arrived today – and here it is:

(Excuse the dirty mat underneath – I really should clean that some day)

This came from ZX Renew and is about £8 + P&P so not bad really

Installing is a bit tricky – the first task was to remove the face plate – being careful not to bend it too much

Once done, it was time to clean off all the glue and give the rubber key mat a good wash and a scrub to get rid of the 40+ years worth of grime that had built up – lovely!

And whilst they are drying all that was needed was to slide out the old and knackered membrane and put the new one in its place.

Super easy – so easy in fact I forgot to take pictures – ah well!

Anyway with that in place and the mat dried and put back on it was time to stick the faceplate back on – some double sided tape should do the trick here

And here we go – I powered it on and was able to type out the first line of a program

Lovely, ok lets press enter and get the next line in..

Oh dear.. that isn’t supposed to happen..

This doesn’t look good at all – time for some more trouble shooting.

First up the 7805 voltage regulator – this should read 12V on the left leg, and 5V on the right leg
Results: 10.2V on the left and 5 on the right – that looks good to me – next – the voltage pins on the lower ram modules

The pins we are interested in are the 4 corner pins and should read -5V on the top left, 0V on the Top Right, 5V on the bottom right and 12V on the bottom left

And here we have a couple of problems
I was reading 0V on the -5V pins, and 9.5V on the 12V pins

I reached out on the MFMI Discord server and was told that the chances are that TR4 or TR5 are a goner

So, I’ve ordered one of each and will probably just replace both of them and report back when done
Thanks to Royal Mail – this will take a few days so see you then!

Spectrum 48K Repair – Part 1

So after purchasing a faulty ZX Spectrum 48k, it’s time to start trying to get it up and running.

Task 1 – Composite Mod

From my previous post, we know that it needs at least a composite mod so we’ll do that first. This is actually fairly simple to do and there are a ton of videos on YouTube that walk you through the process 

I would recommend heading over to the likes of More Fun Making It or Happy Little Diodes who both have a great selection of videos on speccy’s and the composite mod. 

All you are really doing is disabling the current RF signal and putting a capacitor in it’s place. It’s well worth doing as most modern tellies don’t usually have the old analogue input anymore. 

Once done it should look something like this

Anyway with the mod in place, it was time to put it all back together and power it up.

And this is what happened: 

Well that was a lot more than I was expecting. 

This is good news, it should mean that the majority of the components are good – specifically, the ULA, the ROM, the Z80 and the lower ram chips.

I won’t know any more until I can replace the keyboard membrane.

My first ZX Spectrum 48K Repair Project

Well, I’ve finally managed to get my hands on a ZX Spectrum 48k with a view to repairing it as it was listed as not outputting any type of display.

It came with the RF lead and the original PSU, as well as a couple of cassettes.

The speccy itself is actually in rather decent condition with only a couple of minor dents on the front of it.
It is dirty, again not unexpected given its age.

Inside, we can see that it is an Issue 3 board and, again, it is in pretty decent condition with no evidence of any prior work being done to it.

Unfortunately, the keyboard membrane didn’t survive me taking it apart so this will need to be replaced in the event we get it up and running.

Now the fun starts as we try and troubleshoot what the issue is. First order of business will be to do a cursory check of all the capacitors and chips to ensure that there is nothing obviously leaking, damaged or missing.

My rough list of objectives will be to:

  1. Test the 7805 to ensure it is supplying the correct voltage, as I understand this is a common issue
  2. Check the ULA – as I don’t have a diagnostic cart, initially this will probably be with a multimeter and oscilloscope
  3. Do a composite mod. That way I don’t need to worry about having a TV that takes the old AV input.

Childhood Memories – My first ever C64 BASIC Program

When I got my C64 back in my early teens, I did what every kid back then must’ve done and put a cassette in the tape drive and typed in LOAD “” and watched the screen mesmerised by the scrolling lines of text as I waited for the game to load.. 

However, eventually I started looking a that blue screen and the blinking cursor and wondered what else it could do. For me I was helped on that journey of discovery from various magazines – one series in particular called INPUT. 

This series didn’t have any fancy games glued to the front cover, but rather contains lines and lines of BASIC. That you had to enter. 

I was hooked and after a month I decided to have a go at creating my own program. It was rather basic (pun intended) and all it did was output all the colours available on the C64, along with its name and, more importantly, that all important POKE code that went with that number…

So here I am, 30 years later – and have recreated that very same program.

For those who don’t know what this does here’s a rough breakdown

  • Line 10 clears the screen
  • Line 20 prints the text at cursor position 13
  • Line 30 uses PETSCII codes to create an underline to create a title
  • Line 40-44 print a brief description
  • Line 50 beings a loop that will run 16 times, starting at 0 and then stopping after the 16th run
  • Line 60 reads some data into variables A and A$ – we’ll come back to that
  • Lines 70 through 80 deal with printing the values of A and A$ as well as a demo of what that colour looked like, before repeating the loop in line 90 and moving to the next colour
  • lines 1000 to 1030 are DATA statements – remember line 60 where we told it to read A and A$? well that is done here – and if you look at the code, you should see a pattern – there is a paring of a number, and a word. Starting with 0 followed by “BLACK”  – then “1” followed by “WHITE”.
  • Each time we increase A, the READ statement on line 60 will find the corresponding number in the data lines, and then assigns the word that follows it to A$ – so on the first loop, A and A$, read “0” and “Black”, on loop 2, “1” and “White”, and so on until it gets to the end of loop with A being 15 and A$ being “Light Grey”

So when we run the program we should see this:

And that was it – that was my first foray into BASIC programming on the C64.. for little ol’ me at the time – this was impressive and I quickly grabbed a spare cassette tape, put it into my datasette, and saved it to that tape.

At that point all I could think of was – Now what do I write?

Need more.. INPUT

Those of us who were but a child back in the 80’s, lived in the UK, and had an 8-bit micro computer like the Speccy, a Commodore 64 or even a BBC Micro, may also have come across a magazine range called INPUT

It was published by Marshall Cavendish and consisted of 52 magazines filled with a variety of BASIC programs that you could type into your computer and run – well after trying to run it and then going through all your code again to find the inevitable bug

I may not have the actual binders anymore, but I have managed to get hold of them in PDF format and you can find them here

Welcome to Gatt’s Retro Blog

Hi, I’m Gatt and welcome to my retro site

I’m hoping that as time goes by, I’ll be able to fill this with interesting odds and sods from a time when computer games game on a cassette tape and would take around 5 minutes to load whilst at the same time your eardrums were bombarded with the screeching squeals of zero’s and one’s being loaded into memory!

I may even show off some of my efforts to start repairing some of this old tech – but we’ll see

Anyway that’s enough of me waffling for a bit.. See you all soon!

The classic rubber keyed ZX Spectrum 48k