any update on the .mtx to wav question

Include new and ported/converted games, and old games/tools. Subjects about CP/M software goes in the CP/M Forum.
Post Reply
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

any update on the .mtx to wav question

Post by Potholepete »

I saw the post back in 21 about this and wondered if there was a solution in place now that can take a .mtx file saved in Memu and then convert it to a wav file that can then be loaded into an MTX the old fashioned way for those who do not have a CFX/MFX handy?

I saw a ref to Appmake but no links and no followup that I could see to how well that worked and where to get it from?

Jim
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: any update on the .mtx to wav question

Post by Bill B »

In general it is not possible to convert an MTX file to WAV format.

WAV files are divided into a number of blocks, each with its own lead-in. The MTX file format does not record the start and end of these blocks.

However a standard BASIC file typically consists of four blocks:
  • A short block giving the saved file name.
  • A block containing saved system variables.
  • A block containing the program. For a large program this may be more than one block.
  • A block containing program variable names and non-array values.
Edit: Added the program variables block.

For this case it should be possible to do the conversion, since the file name block is a fixed size, and the system variables give the size of the program.

My version of MEMU is able to save programs in WAV format. If you can load the MTX file and it does not auto-run, then go into the MEMU configuration window, select "Audio Tapes: Yes", and specify a file name with a ".wav" extension. "Apply" the configuration, then save the program.
Configuration to save a WAV file.
Configuration to save a WAV file.
Save_WAV.png (11.8 KiB) Viewed 14911 times
It should be possible to hack out the code from MEMU to make a stand-alone program to convert standard MTX files into WAV format.

As an aside, my program TapeView does the opposite, WAV to MTX.
Last edited by Bill B on 28 Jun 2023 16:48, edited 1 time in total.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: any update on the .mtx to wav question

Post by Potholepete »

Hi Bill,

thanks for getting back. I clicked on your link and it took me to you uploads(?) page but I am not sure what I should be downloading to be able to get it running. Any chance of a link to the exact file(s?) I will need and then I will give it a go. I have the program I would like to try as a wav file and its non autorun. I can FTP it across to the MFX equipped MTX and run it fine but I need it to run on a machine that has just tape access as Memu cannot handle the interrupts what this program requires and the sound effects do not play as they should.

Cheers,
Jim
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: any update on the .mtx to wav question

Post by Bill B »

You would need to download the source and compile my version of MEMU, I haven't currently posted compiled versions, there are too many options: Windows, Linux 32-bit & 64-bit, Raspberry Pi, Raspberry Pico...

If you can FTP the program to an MXT & MFX why not just save it to tape from there:
  • To a cassette recorder if you still have one.
  • To the audio in of a PC and record the sound using Audacity or similar.
  • Direct from one MTX to another - a lead from the "Mic" socket on the MTX with MFX to the "Ear" socket on the second MTX.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: any update on the .mtx to wav question

Post by Potholepete »

you know sometimes no matter how long you stare something and no matter how obvious it is some things are clearly just beyond me :roll: I simply did not think of using the MTX ear to see if I could record a good enough quality sample to use.

Next step, find that recorder and have a go ;-)

Thanks Bill,
ps If/when you do get a compiled option that I could test out pls let me know. :-)
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: any update on the .mtx to wav question

Post by Bill B »

Your welcome :)

What OS do you use? Windows?
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: any update on the .mtx to wav question

Post by Potholepete »

I do (Win10)

Following on from this: After a lot of messing about and eventually getting an old tape deck and an unused cassette I managed to save it to tape, then use my USB tape deck that allows me to easily sample it from there. So on this issue we have success :-)

I have another issue but will create a new post in case others need to solve this issue as well.

Thanks again Bill
J
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: any update on the .mtx to wav question

Post by Bill B »

Attached is compiled versions of my MEMU. The ZIP file contains:
  • memu-win.exe - For 64-bit Windows
  • memu-x - For Intel 64-bit Linux
plus (hopefully) all the necessary support files.

It should be noted that one of the areas where my version of MEMU differs significantly from Andy's is interrupt handling. In order to make loading and saving WAV files work, interrupts have to be nearly cycle-accurate.
Attachments
MEMU.zip
MEMU x86-64 runtimes for Windows & Linux
(1.07 MiB) Downloaded 379 times
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: any update on the .mtx to wav question

Post by Bill B »

The attached is a simple program to convert MTX files to WAV format.

As noted above, it will only work with standard BASIC format files. Most game files start with a BASIC stub, which then loads additional machine code. The program will give a warning of additional bytes at the end of the file in these cases.

The WAV file is optimised for minimum size. I have tested the resulting WAV file with MEMU (using Toado), but not with a real MTX.
mtx2wav.zip
MTX to WAV conversion - Source code & Windows Executable
(72.77 KiB) Downloaded 404 times
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: any update on the .mtx to wav question

Post by Potholepete »

Many thanks Bill,

using your original suggesting, an old dusty tape recorder, a new 90 min TDK tape and some cotton buds to clean the heads I finally managed to get a reloadable version of the program on tape. Then using my USB cassette device I played that back into the PC and recorded it in Audacity and it seems good now.

I have downloaded your links and will have a play :-)

Thanks again.
J
Post Reply