News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Carnivius

Convert YM to AY?

Started by Carnivius, 09:07, 18 July 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carnivius

Not really sure where to put this but since YM and AY files tend to be emulated versions of the CPC audio I put it in this subforum.  Please move if not suitable.

Is there a way to convert the often used YM format to an AY format for use in players that can play AY but not YM? 
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Targhan

Mmmh, please enlighten me: what is AY format? Does it refer to player such as AYC by Madram?
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

ASiC

#2
From what I remember, AY contains the player code and the tune. It's a Z80 executable basically.
YM it's just the data stream to the registers of the chip.


I don't think that such a conversion would be possible.




EDIT
---------



WHAT IS A .AY FILE?


The AY file extension is a data format associated to General Instruments AY series sound chip. The AY files contain a "chiptune," that produces a sound format that enables the sound card chip to create sounds in real time. They were used by older computer games such as Amstrad CPC (Colour Personal Computer) games, Spectrum ZX games and Atari ST games. They are composed of blocks of compiled Zilog Z80 microprocessor code joined to a header. They are used to store information such as credits, titles, and copyright details. One AY file can contain multiple tunes despite its 8kb per file size. They can be loaded back using a program that emulates the AY sound chip or AY emulator. Files in AY format can be opened with Audio Overload, Ay_Emul, and Micro Speccy in Mac Os, Microsoft Windows based systems and Linux platforms. These files also used the YM file extension.

Targhan

#3

Thanks. Well then, in theory, you could *simply* call the Z80 code, read the YM values for each frame and create a big YM file that you could extract quite easily.With the now huge hard drive or memory expansion, the size of the YM shouldn't be a problem.

EDIT: Oh, I read AY->YM. Don't bother.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

andycadley

Converting AY->YM is probably possible in that manner, although it will fall over if there are samples or similar effects (but for the most part should be OK). Going the other way, as per the original question, is trickier though since you need to compress the YM file back into something that could fit within the Z80 address space alongside a player routine.

Carnivius

Sorry I'm a bit confused.   When I said 'players' I meant music playing programs on modern hardware.   Does that help?
I want to use a software that can play various 'old school' music formats such as NSF (NES), SPC (SNES) and it has AY listed as both Spectrum and Amstrad.   But almost all the Amstrad tunes I have are in YM format which is not supported.
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

robcfg

For me the best option is WinAmp+ChipAmp.


Take a look at http://www.chipamp.org/.

Carnivius

Quote from: robcfg on 13:39, 18 July 17
For me the best option is WinAmp+ChipAmp.


Take a look at http://www.chipamp.org/.


Sorry thanks for trying to help but that's not what I'm after.  I need an actual way of converting the YM files into AY.  The music player I wish to use is one that can be incorporated into my own game projects to avoid having to convert the YM's into huge MP3 files that would bloat the game to silly amounts when it's all chiptunes.

The original audio libraries be here:
http://blargg.8bitalley.com/libs/audio.html

And I want to use this Game Maker Studio extension (which uses those libraries) to use AY files in the PC versions of my Amstrad projects.
https://forum.yoyogames.com/index.php?threads/chiptune-player-game_music_emu-free.25121/
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

robcfg

Then I'm afraid you're out of luck.


AY files are the code that is actually playing music on the machine. Say, you're playing RoboCop and you manage to isolate the code that plays the music. That's what you get on the AY file.


Also, for playing AY files, you need accurate Z80 emulation. YM files are a crude dump of chip registers along time, so a completely different approach.

Carnivius

Well that bites.   Cos all the Amstrad tunes on places like CPC-power use YM format and such. 
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Targhan

To me, it's quite simple to do (however, I don't know the AY structure). But the problem is the YM which will probably not fit within 64k. If that's the case, you could write a simple YM player (easy to do), embed it with the YM within the AY file. The real problem is the YM size. I'm sure the emulator playing the Z80 code is hardware-agnostic and doesn't know anything about bank switching or memory expansion.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

ASiC

I believe the DTC demo was playing music off a compressed YM stream.

ASiC

I believe the DTC demo was playing music off a compressed YM stream.

Carnivius

So this is impossible then?  To convert the many YM files commonly used by CPC sites like CPC-Power into the AY format used by the libraries I would like to use for my PC retro projects? 
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Targhan

To me it's absolutely possible, but you need some coding ability. However, if you can't do it yourself, I'm pretty sure you will have a hard time finding a CPC coder only to save a few mega-bytes on a PC game.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Carnivius

#15
Quote from: Targhan on 15:38, 20 July 17
To me it's absolutely possible, but you need some coding ability. However, if you can't do it yourself, I'm pretty sure you will have a hard time finding a CPC coder only to save a few mega-bytes on a PC game.

A few megabytes? 
Let's look at the NES-style project I have which the libaries will solve as I can use NSF format created in Famitracker for pure NES authentic music.
Game by itself about - 10MB.
Game with 10 NSF tunes all converted to mp3 in 192 VBR - 66MB
Game with 10 NSF tunes still as NSF.   - 10.5MB
What's more is that these are intended for mobile phone too and many phone users don't have anywhere near the storage space capacity an average PC has so every MB off a game file makes a purchase of the game much more appealing.

I'm mainly just confused why most CPC tunes are available in YM if AY is generally more used by majority of players and audio libraries since AY is also used for the Spectrum which still has a greater userbase.

No I have no real coding knowledge when it comes to this stuff which is why I asked in the first place if there was any easy way to do it.  I had hoped for an existing tool amongst the many quirky little programs the retro scene has for converting all sorts of things into other things.   I guess not.    :/
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

robcfg

QuoteI'm mainly just confused why most CPC tunes are available in YM if AY is generally more used by majority of players and audio libraries since AY is also used for the Spectrum which still has a greater userbase.


My guess is that capturing just the registers is easier than having to extract the player code from the original game. Specially, dumping the registers can be done with a simple program or a small modification to an emulator while the second require assembly skills, which most people don't have.




ThomH


Quote from: robcfg on 16:41, 20 July 17


My guess is that capturing just the registers is easier than having to extract the player code from the original game. Specially, dumping the registers can be done with a simple program or a small modification to an emulator while the second require assembly skills, which most people don't have.
Having a quick look at the AY file format, it's from the Spectrum world. Per the author's reference it allows a CPC-compatible 1Mhz clock to be specified for the AY but then emulates a Z80 at the Spectrum clock rate, with the Spectrum's interrupt scheme, and with the AY sitting at the Spectrum's location. So you'd need not only to rip the code from your CPC game of choice but then also modify it for the different operating environment.

Munchausen


It's a partial evaluation problem  ;D


If I were to tackle this I think I'd start with the aylet source code and replace some of the functions in sound.h/.c to write the AY register values to a YM file instead of emulating the AY.

Powered by SMFPacks Menu Editor Mod