I used MAME VGM to dump fx from a game who uses 3 AY-3-8910 and VGM tools to clean the rips.Shiru wrote:How to rip AY music for Sega's PSG.
You need an emulator that capable to record sound registers dump. I'm not sure about ST emulators, but even if there is no such an emulator, there are options: either add PSG log in some open source emulator (easy, just few lines of code), or use other version of the game, for example ZX Spectrum one - as far as I remember, it has the same music, and there are emulators with AY log feature for sure. Even better, there is music rip from ZX Spectrum Rick Dangerous, and a converter that gives you needed data in very simple format in just few clicks, so no programming required for this stage at all.
Once you got AY registers dump, you need to make simple tool that converts it to Sega's PSG. You can't convert complex AY music, because AY is more complex than PSG, but Rick Dangerous has really simple music, which could be converted easily. You just need to parse the original dump, got frequency dividers and volumes, recalc them into Sega's values (AY has 12-bit dividers, the PSG has 10-bit, and their clock frequency is different). Record the result into some simple format, even VGM (unzipped) will work fine. Data without any compression will be large, but it just tens of KB for all the music.
I then tried to convert fx following Shiru's advice....with success !
For people interested in this kind of convertion, I would like to share some info with you.
2 important things to know:
AY could set register hi and low value whenever you want
SN could set register hi only after setting the low value first
so, when converting, you have to keep in memory the low/hi value to write the 2 each times.
This could result in wrong value the first time (when hi or low isn't defined yet) and unwanted write (when AY is changing its 2 values) so your tool must handle this or you'll have to delete them manually (actually it's the way I follow througth a visual tool)
Then, the frequency convertion:
From an old article of Atari Mag, I know
Code: Select all
tone freq = AY Freq / (16*AY reg hi&low value)
Code: Select all
tone freq = SN Freq / (16*2*SN reg value)
Code: Select all
SN reg value = (SN Freq*AY reg value)/(2*AY Freq)
I now have to find a way to handle noise....
tell me if you want to know more or want to add more (Shiru?)