ZX Spectrum 128 ripping tutorial

From vgmrips

This is an tutorial focused on ripping music from Sinclair's ZX Spectrum 128 games that has at least one music played on AY-3-8912A soundchip. This tutorial was done by Sonic of 8!

Getting started

What you need to rip musics from Speccy games is:

Emulators:

  • Easy method: NEZplay++ with VGM Logging (if the game has an AY file) or
    • Hard method: A ZX Spectrum 128 emulator with VGM Logging (for now, only MAME / MESS) for games that doesn't have an AY file (you also need BIOS files for it);
  • A emulator with screenshot capture (MAME / MESS or Fuse).

Keep in mind that neither NEZplay++ and / or MAME / MESS logs music played on the Beeper soundchip into VGM, as there's no Beep core emulation on VGM format for now. So, no music from ZX Spectrum 48k games. It should be noticed that MAME / MESS has real time loading for cassette tapes and disk images, so, you must wait the traditional 5 minutes to load a Speccy game or just fast-forward it with the button associated on your keyboard / joystick.

VGM tools:

  • vgm_cmp: For optimizing VGM files data;
  • vgm_ndlz: For un-dualizing VGM files generated by NEZplay++ through AY files;
  • vgm_ptch: To change VGM files' AY clock rate to 3546895 MHz after being un-dualized;
  • vgm_trim: To make VGM files a proper loop if the music loops;
  • vgmlpfnd: To find loops in VGM files if the music loops.

Other:

  • The ROM of the game you are playing to take the screenshot;
  • A image editor to remove that annoying gray border for the screenshot;
  • pngout: To optimize the PNG taken from an emulator (optional, this one is used by people who is doing VGM packs since SMS Power! days; its function is included in the batch compressors FileOptimizer, ImageOptim, and Trimage);
  • A hex editor to modify each VGM file's header to set YM2149 to AY8912 flags if you followed the NEZplay++ method.

Ripping music with NEZplay++

To rip musics from AY files that you got either from Project AY or World of Spectrum with NEZplay++, all that you can do is drag and drop the AY file in the program.

  • If the music loops, leave the music logging for about 10 minutes. You can change music in the AY file by pressing left or right in your keyboard;
  • If the music is silent, it probably plays an music / jingle in Beeper soundchip. You can simply ignore it, as nothing will be generated other than a VGM file with pure silence.
  • If the music doesn't change after you pressed the right key, then, the AY file has only one music on it. You can stop it by pressing down in your keyboard;
  • After all the music was logged, you can close the program as usual.

This method works for AY files generated from ZX Spectrum 128 and Amstrad CPC games, although there's fewer AY files dumped for the latter.

Dealing with some errors after logging with NEZplay++

As soon you started to manipulate with VGM files' playback, you will notice that such things are missing or odd on them. These are:

  • No tag export unlike NSF, GBS and SGC files;
  • The soundchip set in the VGM files is 2xYM2149 instead of AY-3-8912A;
  • The VGM file sounds in a low pitch than usual.

Until these problems are fixed, we will show to you how to deal with them:

  1. Get the command-line VGM tools listed on Getting Started.
  2. Drag and drop the VGM file(s) in vgm_ndlz. This will generate two additional VGM files. You should delete the one that is probably less than 10KB;
  3. Get vgm_ptch to change the AY's clock rate to 3546895. This command must be done as: vgm_ptch -SetHzAY8910:3546895 nameofyourvgmfile.vgm
  4. Get an hex editor (HxD is a good one) and drag & drop the VGM file(s) on it. Find the 10 byte at 0x00000078 and change it to 01. This will convert the type of AY soundchip (YM2149 to AY-3-8912A). Save it. You know if you done correctly when it appears on VGMPlay or in_vgm, so, you can delete the .bak files;
  5. Find the loops of VGM file(s) (if any) with vgmlpfnd;
  6. Do the loops on VGM file(s) (if any) with vgm_trim;
  7. Drag & drop the VGM file(s) in vgm_cmp to optimize their data;
  8. Now, for VGM tagging, you can do the following: Open the AY file in a dedicated AY player and the composer + track names will be displayed on it. If there's no composer known for the game, leave the Composer field as blank and put it as Unknown in txt file;
    1. To save time, you can open the AY file in a text editor / hex editor and get the composer + track names on it, but you must remember the correct order of the musics you ripped;
  9. Take the screenshot of the game with MAME / MESS or Fuse. Remove the border with an image editor (MS Paint works if you are using Windows). All screenshots must be on 256x192 and in most situations, it must be the Loader screen (the screen where the Tape is playing), as many Speccy games lacks an proper title screen.

For packaging, playlist, text file and uploading stuff, you can follow the traditional steps for every VGM pack tutorial as usual.

Ripping music with MAME / MESS

This is for games that don't have a AY file available, which is not the case of well known games. Let's get additional steps for this method:

  1. Download the BIOS files' ROM set (use DuckDuckGo or any other search provider and type spec128)
  2. Get the Cassette image of the game you want to rip music. Depending of the company / programmer who holds the copyright of the game that you are interested to get music from, World of Spectrum has it. Or, if you actually own the game, you can dump it by connecting your Data Recorder to your PC;
    1. Because of screenshot purposes, you MUST get your games it in .tzx or .tap formats. Quickload and Snapshot formats are discouraged to use because they skip the Loader screens, which are useful (and way more beautiful) to get the screenshot for the VGM pack at the end.
  3. In the emulator, select 128 Basic and type the program that loads the game on it. Some of them has auto-load methods, but you still needs to go on the Tape Control submenu in MAME / MESS to play the tape;
  4. Get the music by staying on screen or with sound test. If you know how to deal with the game's sound driver, you can use the Debugger, but this is for ones that know what are really doing.

After getting all the music you wanted, you still need to do following:

  1. Get vgm_ptch to change the AY's clock rate to 3546895. This command must be done as: vgm_ptch -SetHzAY8910:3546895 nameofyourvgmfile.vgm
  2. Find the loops of VGM file(s) (if any) with vgmlpfnd;
  3. Do the loops on VGM file(s) (if any) with vgm_trim;
  4. Drag & drop the VGM file(s) in vgm_cmp to optimize their data;
  5. Get the tags from a gameplay or sound test. YouTube is your friend for the first, I guess.

For packaging, playlist, text file and uploading stuff, you can follow the traditional steps for every VGM pack tutorial as usual.

Conclusion

These methods are done by Sonic of 8! and is used on every VGM pack that he does.