EightyOne emulator may have bug with WAV generating

Emulator and emulator development specific topics
bwinkel67
Posts: 147
Joined: Mon Mar 23, 2020 2:38 am

Re: EightyOne emulator may have bug with WAV generating

Post by bwinkel67 »

Fruitcake wrote: Wed Aug 05, 2020 5:11 pm
bwinkel67 wrote: Wed Aug 05, 2020 8:51 am I can create a .wav file but it cannot be loaded into a real TS1000 or a real ZX81. All other .wav files that were created by EightyOne (about 8 of them) work with no problem. When I convert this particular one (the one for madn.bas) using an old 1999 tool, ZXC.EXE (which created a .RAW and then Audacity created the .WAV) it works. Since it's creating a digitally clean analog signal I was surprised by that. I would have figured it should work for all of them.
I'd like to try and replicate the error so I can investigate its cause.

Are you creating the .wav file from EightyOne as follows?
- Copy the BASIC listing text from your original post above
- Paste it into a new blank text file and save it with name MADN.b81
- Run EightyOne
- Open the Tape Manager window
- Open the Wave Loader window
- Drag/drop the MADN.b81 file into the EightyOne main window or the Tape Manager window
- At the dialog that appears, leave all load options unchecked and click OK
- The program loads into EightyOne and the Tape Manager shows the program
- In the Tape Manager window, right click on the MADN program and select "Convert Tape to Wave"
- In the Wave Loader window, click the Save icon, type the filename "MADN.wav" and click Save

And then the generated .wav file will fail to load into a real ZX81?

If you create the .wav file via another method in EightyOne, could you list the steps you use.
So that method actually does work for me...I had been given different instructions on how to do so, which did work...listed below. I don't think loading the program as .p via Open Tape is the issue but doing a SAVE seems to be:
  • Take BASIC listing and convert to .p file using zxtext2p.exe
  • Load .p file into EightyOne (v1.16) via File->Open Tape (in ZX81 mode, though I have tired TS1000 as well see *** below)
  • Run game to make sure it works (it does...I put it in 1 player mode and it just auto-plays to completion)
  • Open Tape Manager window
  • Open Wave Loader window
  • Set Options->Tape->Destination to Wave Loader
  • (optional, if not empty, in Wave window hit new to set to 0)
  • Type SAVE "MADN" in ZX81 window
  • In Wave window hit "record" (right after hitting enter, maybe half second when screen is blank)
  • In Wave window hit disk icon to save tape as .wav file once it finishes
I just tried this method again, after doing it the way you described (which worked) and it again failed. However, the way I had been doing it had always worked before. So doing a SAVE "MADN" and hitting record in Wave window seems to fail. Note that there is no noise on the .wav file before it starts and it has a normal blank time before it makes noise. I have attached the bad .wav file for you to see.
madn.zip
(286.19 KiB) Downloaded 282 times
*** When I'm in TS1000 mode and open a tape file it immediately goes to the K cursor and doesn't load anything. If you type LOAD "" and hit enter it loads the program. That has been happening for me since I started using TS1000 mode.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: EightyOne emulator may have bug with WAV generating

Post by Moggy »

Fruitcake wrote: Wed Aug 05, 2020 5:16 pm
Moggy wrote: Tue Aug 04, 2020 11:36 pm Found it here.

http://archive.sundby.com/mirror/www.wo ... ities.html
This later version also supports the ZX80:
winTZX0.9d.zip
Thanks Paul very much appreciated. :D
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: EightyOne emulator may have bug with WAV generating

Post by Fruitcake »

I created wav files using 3 methods:
- MADN_A = Type SAVE "MADN" and record using the Wave Manager
- MADN_B = Auto-convert from the Tape Manager
- MADN_C = Create using the WinTZX utility

The main difference seems to be the spacing between bit encodings.

The first few bit encodings of each wav file:
MADN_COMPARISON#1.png

When zoomed out the difference the spacing makes to total length becomes clear:
MADN_COMPARISON#2.png

I then loaded each wave file into EightyOne's Wave Manager and it could convert then all to tape files, which all loaded in. So all wav files appear to encode the correct bits, and only really differ by the spacing between bits encodings.

bwinkel67 wrote: Thu Aug 06, 2020 4:28 am I just tried this method again, after doing it the way you described (which worked) and it again failed.
MADN_A is your method (which you say did not work) and MADN_B was my method (which you say did work). Looking at the waveforms I might have guessed my method would not have worked since it's bits are more closely spaced, yet you found the opposite. The output from WinTZX has an even longer bit spacing, so it would be interesting to know whether it works for you. Have you tried using a wav file created from this utility?
bwinkel67 wrote: Thu Aug 06, 2020 4:28 am However, the way I had been doing it had always worked before.
When you try to convert MADN using your approach, does it always fail? Or just now and again?

Once you have a .wav file, what do you do / use to play it into a real ZX81?
bwinkel67
Posts: 147
Joined: Mon Mar 23, 2020 2:38 am

Re: EightyOne emulator may have bug with WAV generating

Post by bwinkel67 »

Fruitcake wrote: Fri Aug 07, 2020 1:51 am Have you tried using a wav file created from this utility?
I have not. I used the ZXC.EXE utility to convert the .p file to a RAW file and then Audacity to convert the RAW to a WAV file (Audacityjust needed to convert it from 22,050 to 44,000) and that loaded each time. The output, if I remember correctly, was just over 7MB (whereas the example I sent you that didn't work was 6.75MB). I can attach the ZXC.EXE/Audacity WAV file for you to see how that differs (unfortunately not until Saturday since I'm not home now) and I can try to create the WAV file using WinTZX utility.
Fruitcake wrote: Fri Aug 07, 2020 1:51 am When you try to convert MADN using your approach, does it always fail? Or just now and again?
Yes, it always fails.
Fruitcake wrote: Fri Aug 07, 2020 1:51 am Once you have a .wav file, what do you do / use to play it into a real ZX81?
Yes, I play the file at about 85% volume and have a splitter on the headphone out to only get one channel. It has worked well for the other 6 or 7 programs I have created the same way. MADN_bas was the first one it failed with.
bwinkel67
Posts: 147
Joined: Mon Mar 23, 2020 2:38 am

Re: EightyOne emulator may have bug with WAV generating

Post by bwinkel67 »

bwinkel67 wrote: Fri Aug 07, 2020 5:16 am
Fruitcake wrote: Fri Aug 07, 2020 1:51 am Have you tried using a wav file created from this utility?
I have not. I used the ZXC.EXE utility to convert the .p file to a RAW file and then Audacity to convert the RAW to a WAV file (Audacity just needed to convert it from 22,050 to 44,000) and that loaded each time. The output, if I remember correctly, was just over 7MB (whereas the example I sent you that didn't work was 6.75MB). I can attach the ZXC.EXE/Audacity WAV file for you to see how that differs (unfortunately not until Saturday since I'm not home now) and I can try to create the WAV file using WinTZX utility.
I haven't given up on debugging this but with school starting in a week or so I haven't had 100% time for this. When I get some time I will try using the WinTZX utility to generate the WAV file to see if I get it to load on my TS1000 (maybe Friday if things go well). Unfortunately (and fortunately) we are going online for all classes so the modality is adding a bit of overhead that usually doesn't exist (college not high school).

Attached is the audio file that worked for me that I created using ZXC.EXE and converted to 44100 in Audacity as that may be helpful in seeing what is different.
madn.zip
(1.59 MiB) Downloaded 276 times
Post Reply