Does an S98 to MDX converter exist?

Started by H68k, April 10, 2014, 05:35:32 AM

Previous topic - Next topic

H68k

Is there such a thing as an S98 to MDX music file conversion utility of some kind? I tried a goggle search, with sadly turned up fruitless.

I'm looking to convert some S98 music files of games that ran on other computers that also featured the YM2151 (sharp x1, some MSX series etc)

neko68k

No.

There may be converters from the original formats to MDX or similar, though I can't say for sure. I'd guess that this is true though. For example, Snatcher, Sorcerian and others. OTOH, many of the arcade MDX tunes were patched together by ear so I dunno...

Recently some guy was talking about some tools he was writing. Maybe hit him up. I can't find his repo right now but his posts should be on the first page here.

H68k


It really does make me wonder how some of the masters of  the MDX music scene managed to create perfect copies of arcade and console game music. I thought they used some sort of fangled custom made hardware and software to sniff data from the FM chip or dump data from the games ROM  or something like that and convert it to an MML or MDX file etc.

If most of them where only done by ear and guess work.. and ending up (well.. most of them) perfect copies of there console and arcade originals.. then that's a pretty amazing talent.


Would that be Vampirefrog? He has some MDX tools on Github, but sadly there mostly for converting mdx files to other chip tune formats, not the other way around.


Could it be theoretically possible to write a converter program? it be It would be fantastic to be able to play these S98 (for the YM2151) arcade and console game music dumps on the X68k.

I sadly though, lack enough understanding to write a program from scratch.

neko68k

I found some ROM dumping software a while back. It'd be a lot of work but not impossible by far to disassemble the music code and samples from an arcade game and work with that. That's just a guess though. I do know for a fact that some of the musicians did it by ear though. I have txt files to prove it somewhere. :)

As an example of who I think might have been disassembling, check out Veyrlen's Sega tunes. Perfect.

As for converting, I guess it's theoretically possible. It might be possible to convince the x68 to play the S98 files but I can't really help you there.

H68k

I read on a forum sometime ago, about some software that you could use to rip the music data out of sonic game ROM's, that was used by the sound driver that ran on the Z80 in the mega drive, you could then use utilities to convert the data to something more useful like MML or MIDI files etc.

Yes, Most of Veyrlen's music if a perfect copy.. if a little to perfect enough to be suspect... As you've suggested. he may very well of developed his own utilities to help in the reverse engineering of game ROMs to aid in the creation of his mdx music.

Do you know what happened to some of the grates of the mdx music scene? do any of them having anything like blogs or twitter feeds? Also would you mind releasing anything else you have on the mdx music scene Neko68k? it would be fascinating to have a further (if no matter how small) insight into it.


Would it be easier to write a program to play the s98 file on an X68k it self? as all the CPU would have to do is drive the real chip and not emulate it in software.

neko68k

#5
You should look through the diskmags in the TOSEC. There's a lot of history in those in general. Also check out the music data here. You'll find a lot of original mml and uncompiled pdx data and stuff in there. Check the bat files for what programs you'll need. Most of it is available in other sections of that mirror. There's some hilarious stuff in there, programmer ramblings and stuff.

As for who's still around. It's hard to tell. I have a couple guys that follow my youtube but they generally don't participate. There's some people on twitter but I don't pay attention much because Japanese is hard :P One guy is into trains. ~shrug~

It'd probably be easier to write an s98 driver, yeah. I think you're probably on your own on that one.

[edit]
You should also cruise old websites on archive.org. Seisei Yamaguchi's link site is probably a good place to start.

vampirefrog

#6
Quote from: H68k on April 12, 2014, 04:45:59 AM
I read on a forum sometime ago, about some software that you could use to rip the music data out of sonic game ROM's, that was used by the sound driver that ran on the Z80 in the mega drive, you could then use utilities to convert the data to something more useful like MML or MIDI files etc.

You are referring to SMPS, which is the internal format, similar to MML, used in some MegaDrive games (Sonic being one of them), with the Z80 sound driver. If one manages to extract the SMPS data, then it can be converted to MIDI or MDX or whatever. For more info see http://vgm.mdscene.net/, ValleyBell is the one developing the SMPS tools, though I haven't found a dedicated thread for them.

EDIT: found a better link http://forums.sonicretro.org/index.php?showtopic=25219

Using the same logic, if you were to look in the ROMs for arcade games, at some point you'd find the music data, in one format or another, but most probably there is a list of notes to be played, similar to MML, perhaps instrument voices for the FM sound chips, then there are the PCM samples and any other musical info, and finally you'll have the driver somewhere. As you know, the reason why sound chips were used was because all you have to store and send to them is a few bytes of info, and you could fit a song in very few bytes.

Hoot works by emulating the CPUs and hardware necessary to run the driver code, and uses the original drivers (think: MXDRV) to play each song, which is in the original format as well.

So, instead of thinking: "How can I convert this S98 file to MDX" (which, btw should be possible if you write code that takes the chip commands and converts them to voice commands and notes), think, instead, how can I access the MML data in the original game ROM.

To convert from S98, you'd have to write some code that reads each of the commands sent to the YM2151 chip, and each time port 0x08 is written to (that's the key on/key off port), a note would be generated.  Any other command can be translated into a MDX command, with the commands affecting the voice being a separate issue - you can collect those and generate a voice block whenever a new voice is used. Long story short, it is possible, but it is slightly hacky and might not be necessary.

Also, if the logged music is from an X68000 game, you might want to check out the contents of the floppy instead, where you'll find ZmuSiC or OPMDRV MML probably.

EDIT 2: It might also be possible to make a S98 player for the X68000. Shouldn't be too hard, all you do is output the chip commands directly, then let it sit and wait until the next command. You can use the YM2151's timer to do the waiting.

H68k

#7
Sadly, I don't have a clue as to about where to start or how to go about ripping sound data out of game ROMs (we highly suspect some of the greats of the MDX music scene back in the early 90s had there own smiler methods and utilities to do this, as some of there MDX music of some games is note-for-note "perfect")


In something of my own experiments in trying to "convert" some music from some Atari arcade games to MDX music, I came up with a rather long winded (if not that successful) method of trying to convert them.

first of all, I used Hoot to make an s98 dump of the data, then I used an s98 to midi converter utility (this it self managed to do a pretty good job, it even set panning and substituted the operator settings changes for the midi equivalent of program changes) then I used a utility that gets the operator settings from Hoot and saved those to a txt file, I then used a midi to mml conversion utility and pasted the mml and operator settings into one mml file.

The following result when compiled, was an MDX file that would play... but because the midi2mml utility would not convert program change messages to mml OP settings changes, I could not get OP settings to change on a single channel that used them (if you used one channel for percussion and had different OP settings for the high hat, snare and bass drum sounds etc)


I would love to try and make a proper s98 to MDX music converter utility.. but sadly, my understanding of how to really program is sorely lacking.

Someone else on this forum did say it would be easier to write an s98 player for YM2151 dumps, but again... I wish I could program one.

edit: if you did program an s98 player.. you'd also have to take into account the different clock rates that the chip is run at? so the music plays back at the right speed.

vampirefrog

You used Hoot. Hoot works by storing the music data + the sound driver, and emulating the CPU and sound hardware. So it looks like what you're looking for is already ripped. Look in the Hoot files to find the music data.

I suggest you go to the vgmrips forum and ask the guys there, since music ripping is what they do.

You are indeed on the right track. It looks like the midi2mml tool needs to be fixed. Is the source available?

I'm not going to code a S98 player for the X68k, since I am not familiar with coding for the X68k at all.