Open source utility to perform WAV->P conversion for ZX81

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
mcleod_ideafix
Posts: 10
Joined: Tue Aug 06, 2013 11:31 am

Open source utility to perform WAV->P conversion for ZX81

Post by mcleod_ideafix » Tue Aug 06, 2013 12:28 pm

Hi all!

My name is Miguel Angel. I'm also known as mcleod_ideafix at WOS and other forums. I've found this forum while in search for ZX81 demos.

Some time ago, I was lent a ZX81 program that its owner had from the 80's and I wanted to preserve it. I recorded the sound at my office and went home with a huge WAV.

Later, I tried to use any program that could convert the information stored in the WAV to a .P file. I found two:
- One of them is JAVA ZX81 Tape Converter. Last updated 2007. Not even capable of loading the WAV's I provided. It raises an I/O exception about something wrong with mark/space (??). I tried with both WAV's and AIFF's files, which this converter claims to support but no luck. Already have the last version of the JRE.
- The other one is from Stephen McDonald, and belongs to a group of MS-DOS programs named Steven McDonald's ZX81<=>PC Converters [Version 3.0], last updated in 1999. I can actually get the audio read with it, after converting it to 22050Hz, 8 bits, but the conversion is very slow and the resulting .P is wrong.
- Besides, I tried to load the WAV with the Wave Loader option of EightyOne, but after the loading, the emulator (not the emulated machine) hung.

So, as neither of these two utilities had the source code available for me to fix them, and as they seem to be abandonware, I decided that, if I want to preserve this ZX81 program, I would have to read by my own devices. I found a very valuable piece of information in a plain text file from Martin Korth (No$Cash) that really helped me on interpreting what's in the audio signal, and later on, interpret the contents of the .P file to give a BASIC listing of the saved program, contents of screen, etc.

Details about the preserved program (basically, a spanish release of ZXAS and ZXDB) are here: http://foro.speccy.org/viewtopic.php?f=11&t=3261

About the converter program:

The last version is available at the following address:
http://www.zxprojects.com/images/storie ... 1putil.zip

As of version 1.0.3, zx81putil can perform the following operations:
- Read a sound file, WAV format, with the loading noise of a ZX81 program and convert it (with a litte luck) to a .P file (I'm preparing a Youtube video showing how this utility can help you to restore damaged recordings)
- Read a .P file and converting it back to a nice and clean WAV file for further reproduction.
- Read a .P file and convert it to a TZX 1.20 compliant file that can be played with any external utility (such as some players available for smartphones).
- Play out loud a .P file to load it directly from your PC to the ZX81, without intermediate WAV conversion.

Please, check the README file for details on how to use the program. There are some advanced options present but not yet well documented.

Win32 executable included. Source code is included. You should be able to compile on Linux or OSX without any fuss. If you want support for direct playing of .P files in your executable, make sure you have the SDL devel package and include this when compiling: -DSUPPORT_PLAY_CMD

sirmorris
Posts: 2813
Joined: Thu May 08, 2008 5:45 pm

Re: Open source utility to perform WAV->P conversion for ZX8

Post by sirmorris » Tue Aug 06, 2013 5:18 pm

Fantastic stuff! Thanks for sharing your hard work :D

User avatar
iturbez
Posts: 146
Joined: Fri Dec 25, 2009 1:06 pm
Location: Spain

Re: Open source utility to perform WAV->P conversion for ZX8

Post by iturbez » Tue Aug 06, 2013 10:15 pm

Hola, Miguel Ángel. Sólo unas palabras en español para darte la bienvenida a este, tu foro.

Muchas gracias por compartir tus programas y experiencias. He descargado tu programa, y lo probaré en cuanto tenga un momento.

Hi, Miguel Ángel. Only a few words in Spanish: Welcome aboard.

Thanks for this fantastic stuff.

User avatar
yerzmyey
Posts: 1239
Joined: Thu May 15, 2008 10:11 am
Location: Rubber Planet
Contact:

Re: Open source utility to perform WAV->P conversion for ZX8

Post by yerzmyey » Wed Aug 07, 2013 12:30 am

I wrote about the utility in the newest MONOCHROME ZX81 magazine too.
IN NIHILUM REVERTERIS - a big text-adventure game for ZX81: http://tiny.pl/g2m6m
"MONOCHROME" issue 5 - (Spring 2014) free paper/PDF magazine about ZX81: http://tiny.pl/q2m44
ZX81 COMPETITIONS 2007/2009: http://zx81.republika.pl/

User avatar
mcleod_ideafix
Posts: 10
Joined: Tue Aug 06, 2013 11:31 am

Re: Open source utility to perform WAV->P conversion for ZX8

Post by mcleod_ideafix » Wed Aug 07, 2013 12:46 am

Yay! Thanks! :)

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Open source utility to perform WAV->P conversion for ZX8

Post by PokeMon » Wed Aug 07, 2013 2:33 am

mcleod_ideafix wrote:As of version 1.0.3, zx81putil can perform the following operations:
- Read a sound file, WAV format, with the loading noise of a ZX81 program and convert it (with a litte luck) to a .P file (I'm preparing a Youtube video showing how this utility can help you to restore damaged recordings)
Thanks for your work. I will give it a try, soon. ;)

I developed the ZX-IDE which now transfers programs from PC to ZX81 and want to implement the back direction to SAVE data from ZX80 or ZX81 to the PC.
So do you support both targets as there is no big difference ?
The load/save data is nearly the same except that the ZX80 omits the file name transmitted by ZX81 before data (memory contents) is following. :?:
And the charset is a little bit different ...
But saw already your tables for chars and token in the source, which could be doubled and then changed.

User avatar
1024MAK
Posts: 2154
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Open source utility to perform WAV->P conversion for ZX8

Post by 1024MAK » Thu Aug 08, 2013 1:31 am

Welcome Miguel!

:D :D :D

Nice work :mrgreen:

Mark

User avatar
mcleod_ideafix
Posts: 10
Joined: Tue Aug 06, 2013 11:31 am

Re: Open source utility to perform WAV->P conversion for ZX8

Post by mcleod_ideafix » Thu Aug 08, 2013 2:30 am

Thank you all for the welcome! :)

BTW: I assume this is old and known by all you, but in case anyone is afraid to upgrade internally his/her ZX81, I've prepared a graphic tutorial about how to do it that I posted yesterday. Text is in spanish, so I will link you to a google translated version.
http://translate.google.es/translate?sl ... 02&act=url

Rishi
Posts: 107
Joined: Mon Jun 08, 2015 6:57 pm
Location: Amsterdam

Re: Open source utility to perform WAV->P conversion for ZX8

Post by Rishi » Fri Aug 07, 2015 9:11 pm

mcleod_ideafix wrote:
So, as neither of these two utilities had the source code available for me to fix them, and as they seem to be abandonware, I decided that, if I want to preserve this ZX81 program, I would have to read by my own devices. I found a very valuable piece of information in a plain text file from Martin Korth (No$Cash) that really helped me on interpreting what's in the audio signal, and later on, interpret the contents of the .P file to give a BASIC listing of the saved program, contents of screen, etc.
Since the text file being referred to here is no longer available at this link, could someone provide the info, i was thinking about loading a program into extended memory, and leave it there for retrieval after the power has been out (or that would make a real back-up area) but i'm fairly sure not all system variables are stored as part of the program, and then i thought may as well use the normal program storing convention, well anyway i'd like to know what it is. And i am having some plans and ideas :D
32K SRAM WRX compatible, 32Bit IO-Port, ROM Ghost, ZX-Printer.

IanB
Posts: 59
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Open source utility to perform WAV->P conversion for ZX8

Post by IanB » Fri Aug 07, 2015 10:02 pm

Welcome Miguel!

Post Reply