x68k Music: MXDRV MML Documentation (& Short Tutorial)

Started by exodusmodules, January 24, 2016, 11:50:13 AM

Previous topic - Next topic

exodusmodules

Well, as the subject suggests, I have just about fully documented MXDRV MML, and have explained how to write and compile MDX tunes, as well as PDX PCM banks.

Woot woot!
So give me all your monies and you can see my documentation...just kidding!

If you don't know what any of this means, this is documentation and a tutorial on a popular x68000 music format, known as none other than the MDX. MDX is a non-executable binary format that is compiled from a plaintext .mml (Music macro language) source file. I explain the details of MML and MDX in the documentation as well, and also how to create PDX pcm sound banks.

So if you're a person who is gifted musically like me, you can compose tunes on the x68k with the YM2151 and OKI MSM6258.

Here's a link to the documentation (a txt file):
https://drive.google.com/file/d/0B3FbCURTShmeZl9hNVdBVmQyS0U/view?usp=sharing

Have fun making MDX tunes!

EDIT: I'm currently making a wiki page that is more or less identical to the linked text file, except the wiki allows me to format everything nicely. Here is the (working) link: http://gamesx.com/wiki/doku.php?id=x68000:mxdrv_mml_mdx_tutorial

kamiboy

Great work lad. Now if only everyone could shower us elbow deep in sweet, sweet video game style chiptunes that we could steal for future projects, without giving due credit of course.

Now, all that remains is figuring out how to play MDX files in C projects using MDXDRV.

exodusmodules

#2
Quote from: kamiboy on January 25, 2016, 05:08:15 AM
Great work lad. Now if only everyone could shower us elbow deep in sweet, sweet video game style chiptunes that we could steal for future projects, without giving due credit of course.

Now, all that remains is figuring out how to play MDX files in C projects using MDXDRV.

vampirefrog (creator of a project called "mdxtools") has an English documentation on the MDX format. https://github.com/vampirefrog/mdxtools/blob/master/docs/MDX.md
mdxtools is programmed in C++ (should help if you know C++ syntax), so looking at his source code may be of more help. It's in the github project I linked above as well.

I'll try reverse engineering mmdsp when I get the chance to figure out how to play MDX tunes. xm6 Pro68k has a nice disassembler. That's a starting point.

EDIT: Actually, wouldn't it be easier to look at the source code for an mdx player on Windows or Linux? If I remember correctly, the source for a Winamp MDX plugin is available.

kamiboy

I don't think we need to go that far actually. If I understand things correctly MDXDRV is an MDX playback library ready to be used by games and other programs. There are other such libraries, such as Z-music which some other games use.

All that is needed to use said programs is documentation on how they are supposed to be used. During one of my searches I discovered that Z-Music and other such libraries install themselves as an interrupt handler. This happens when you run the Z-music TSR driver, and I am sure it is the same for MDXDRV. In fact some games use these and you can see the TSR executable being called as part of the game startup batch script.

If I understand things right using these drivers must involve loading the MDX file into some specific area in memory, then calling the driver, most likely trough the interrupt mentioned before.

I found website out there with all the Z-Music driver files, which I am sure include documentation on how they are to be used, since they were commercial software meant to be used in third party projects.

Only trouble is all that documentation is in Japanese. I think there is a website hosting MDXDRV files as well.

exodusmodules

#4
If I remember correctly, MXDRV does not play the MDX file; an external player is required for that, which is the reason for mmdsp.

EDIT: Yes, I was right. You are correct about loading the MDX and calling the driver, but there is no library with which to do this with from what I've seen, at least in C. MXDRV is just the TSR.

kamiboy

I wasn't expecting there to be a C library, since most games were prolly written in Assembly back in the day. But you should be able to call the TSR fine from C using the same method as in assembly. You only need the dev documentation for how the TSR is supposed to be used.

Zmusic might be worth a look as well. I think it acually comes with some example source code. But Z-Music plays back its own format. I think maybe it includes an MML compiler to create files compatible with its TSR. Not sure though as I only took a very cursory glance at the library archive files.

corpsicle

How did this topic exist for days without me reading it!?
Ive been looking at Vampirefrog's stuff for a while and while its a fantastic source of information on the topic, it doesnt go into a lot of explanation about the actual music making.
So this is a great addition.
Thank you so much.

exodusmodules

Quote from: corpsicle on January 28, 2016, 06:23:49 PM
How did this topic exist for days without me reading it!?
Ive been looking at Vampirefrog's stuff for a while and while its a fantastic source of information on the topic, it doesnt go into a lot of explanation about the actual music making.
So this is a great addition.
Thank you so much.
Haha, you're welcome. :-)

Anyway, don't mean to bump an old thread, but I was meaning to ask, does anybody know of any good MIDI->MML converters? I found one a while ago called PetiteMM (https://code.google.com/archive/p/loveemu/downloads), but it has a major issue with the octave macro-- '<' and '>' are reversed!

bootlogger

Hi everyone,

This is my first post here so quick intro: my name's Tom and I like game music-- mostly FM-based, though not a MIDI or NSF/SPC hater, hehe.

I've been working on a web-based (game) music player that handles VGM, DRO, IMF and the likes, and I'm adding support for the MDX format so I thought you might be interested. *I* would be interested in having someone try it out and letting me know a) if it sounds acceptable, and b) whether it actually works for songs created using the tutorial by exodusmodules!

The project is called Muki and you can see it live at muki.io.

I've added a few MDX songs to the collection-- you'll find them by opening the Recently Added playlist-- but you can also play your own by dragging and dropping them into the window. If the song(s) require a PDX file just include it in the selection, and it should Just Work(tm)... I hope.

Sorry if this looks like spam, by the way. I found this forum and thread while looking for information about the MDX and PDX formats. You're kind of the experts on the X68K so I thought this would be the best place to get some feedback. :)

Pinwizkid

Quote from: bootlogger on March 31, 2016, 11:10:47 AM
Hi everyone,

This is my first post here so quick intro: my name's Tom and I like game music-- mostly FM-based, though not a MIDI or NSF/SPC hater, hehe.

I've been working on a web-based (game) music player that handles VGM, DRO, IMF and the likes, and I'm adding support for the MDX format so I thought you might be interested. *I* would be interested in having someone try it out and letting me know a) if it sounds acceptable, and b) whether it actually works for songs created using the tutorial by exodusmodules!

The project is called Muki and you can see it live at muki.io.

I've added a few MDX songs to the collection-- you'll find them by opening the Recently Added playlist-- but you can also play your own by dragging and dropping them into the window. If the song(s) require a PDX file just include it in the selection, and it should Just Work(tm)... I hope.

Sorry if this looks like spam, by the way. I found this forum and thread while looking for information about the MDX and PDX formats. You're kind of the experts on the X68K so I thought this would be the best place to get some feedback. :)

Your site is beautiful. I will be listening and keeping track of your progress! Looking forward to MDX support :)

bootlogger

Quote from: Pinwizkid on April 01, 2016, 12:36:02 AM
Your site is beautiful. I will be listening and keeping track of your progress! Looking forward to MDX support :)

Thanks!! Really appreciate it. Were you able to listen to any MDX songs?

Pinwizkid

Quote from: bootlogger on April 01, 2016, 12:50:55 PM

Thanks!! Really appreciate it. Were you able to listen to any MDX songs?

Yep, they sound perfect. Gotta get more Star Cruiser on there - that whole soundtrack is a masterpiece.

Hopefully one day I can figure out how to convert some of my original YM2151 tracks to MDX using MXDRV MML...

corpsicle

Bootlogger: nice site! perfect for at-work listening.

kamiboy

Shit don't work...

I kid, I kid. In all seriousness though, it does not work on my iPad. Interface works but music playback is no dice.

bootlogger

Quote from: Pinwizkid on April 05, 2016, 12:01:33 AM
Yep, they sound perfect. Gotta get more Star Cruiser on there - that whole soundtrack is a masterpiece.

Hopefully one day I can figure out how to convert some of my original YM2151 tracks to MDX using MXDRV MML...

Great, thanks. I just loaded an initial batch of MDX songs so yes, we need moar of them. Any suggestions?

About your songs: in which format are they? Maybe there's a way to convert them.

Quote from: corpsicle on April 05, 2016, 06:22:49 PM
Bootlogger: nice site! perfect for at-work listening.

Ha! That's what I use it mostly for.

Quote from: kamiboy on April 06, 2016, 12:15:00 AM
Shit don't work...

I kid, I kid. In all seriousness though, it does not work on my iPad. Interface works but music playback is no dice.

Oh shoot. I don't have an iPad nor an iPhone to test it on, that's why. Mobile Safari seems to disable Web Audio and there's a weird trick you need to do to make it work.  If you'd like to help out with the testing it'd be very helpful. :)

kamiboy


bootlogger

Thanks!

If you could share the output of the debug console in Mobile Safari it would really help. You should be able to enable it under Settings/Safari/Developer.

kamiboy

Seems there is no debug console on the device itself. From the looks of it, it needs to interface with a PC running a special hardware. I do not have the right setup for that I fear.

bootlogger

Rats.

I'll try to get my hands on an iPhone and see what's going on.

Thanks anyway kamiboy.

Pinwizkid

Quote from: bootlogger on April 06, 2016, 04:04:25 AM
Quote from: Pinwizkid on April 05, 2016, 12:01:33 AM
Yep, they sound perfect. Gotta get more Star Cruiser on there - that whole soundtrack is a masterpiece.

Hopefully one day I can figure out how to convert some of my original YM2151 tracks to MDX using MXDRV MML...

Great, thanks. I just loaded an initial batch of MDX songs so yes, we need moar of them. Any suggestions?

About your songs: in which format are they? Maybe there's a way to convert them.


Well, it definitely won't be a simple/seamless conversion. They were composed using Renoise (.xrns music format) using samples and VOPM (YM2151 emulator VST plugin). Theoretically, I could export the MIDI of each track, then convert to MML and then just copy over the patches I used in VOPM, but it's much easier to type that sentence than to actually do it with no technical hangups.

That said, I'm very happy with the way VOPM sounds and the only real benefit of "porting" over the music would the authenticity of it actually playing through a real YM2151 instead of a sequencer using an emulator (though I'd most likely have to rework the tracks a bit to ensure they are only 8 channels).

Here are some of the tracks:

http://brendanbailey.net/Dynamite_Force.mp3
http://brendanbailey.net/Castlevantasy.mp3
http://brendanbailey.net/Asteroid-Base.mp3

-BB