AY file format
11 02 11 - 04:03It was long time since previous featured article was published. Here is new one, this time it is about the AY file format - what is this, where to get music in this format, how to play and create these files, and so on.
The AY format
As you probably know, there are special file formats for chip music ripped from games and demos for certain home computers and game consoles. For example, there are SID (*.sid) format for C64 music or NSF (*.nsf) format for NES/Famicom music. AY (*.ay) format similar to those, except it was developed to store music ripped from ZX Spectrum and Amstrad CPC games. It also could be used to store music from other systems with AY-3-8910 sound chip and Z80 CPU.
The format was developed for DeliAY plug-in for DeliTracker on Amiga, by Patrik Rak (Czech Republic) in late 1990s. Initially it only supported AY sound chip and ZX Spectrum, but later got Amstrad CPC support too. In 1998 the first MS-DOS AY player was made, AYPLAY by James McKay. It added support of standart beeper, so since then AY format capable to store 1-bit music too.
Currently there are no other 'standart' formats capable to store 1-bit ZX Spectrum music, so it is the only choice if you want to store music similar to SID and NSF collections.
Where to get AY files
The largest collection of AY files is ProjectAY. The collection mostly includes AY-3-8910 music ripped from ZX Spectrum and Amstrad CPC games, but also includes 1-bit music from ZX Spectrum. Unfortunately, there is no separation between 1-bit and AY music in the collection, because some games had both, and single AY file could contain many songs, similar to SID and NSF formats.
How to play AY files
There are a lot AY players, for many systems and computers, including Amiga, MS-DOS, Windows, MacOS, Linux/Unix, and even ZX Spectrum itself. There is a WinAmp plug-in too. Complete list of players with links is here.
How to create AY files
AY files store original player's Z80 code and data, so you can't easily 'record' sound to this format, like you can with WAV or other audio formats. This also means it is not possible to open an AY file with any existing music editor and see notes - although they are stored in the music data in some form, the exact format depends from Z80 code, and it changes from file to file. You have to be programmer in order to extract music from a game or a demo. Luckily, ProjectAY has music ripped from many games, so there are good chances that music you need is already available as AY file.
If you really want to create an AY file from music you ripped, or from some custom sound engine you made, you have to prepare a Z80 routine which just plays music when called, and then make an AY file from it using tools like AYMakeR. You can learn more about the tools here.
Please note that AY players only emulate ZX Spectrum 48K, and they don't have Sinclair BASIC ROM code in memory of emulated ZX Spectrum. If your code needs ROM data or routines, you should put needed parts of the ROM into an AY file.
In case if you just made a song with Beepola and want to get an AY file, there is much simpler way. Beepola itself currently does not support AY export, although it is planned, so you can use separate tool released recently.
180 comments