Article History

99% Yung Gotenks

MDX (MXDRV MML for Sharp X68000)


  1. Features
  2. Setting it up
  3. MDX Players
  4. MXDRV Specific Syntax
  5. Compiling a Tune
  6. Making PDX files
  7. Special Thanks
MXDRV is a music driver which uses MML (Music Macro Language) to create music for the Sharp X68000 Japanese computer. The compiler exports MDX files which you can play in a MDX player or in Foobar2000 with the MDX Decoder plugin. A notable example of it's use is from the 1996 arcade game, Battle Garegga by Raizing.


MXDRV has full FM support from the YM2151 and full ADPCM support from the X68k's sampling chip, the OKIM6258 using PDX files. The tool has the ability to change the frequence of samples, define your own FM instruments, Set amplitude LFO, set hard stereo panning, and more. In order to use the ADPCM channels though, you'll need to either rip samples from existing games which make use of ADPCM, or make your own which will be explained later in this article.

Setting it up

You will need:
: A Sharp 68K command line emulator which is necessary to run 68K programs from the command line/cmd.
: The MXDRV tools needed to make MDX files.
: Get the Win32 executable. Required tool to make PDX files if you want ADPCM. It's not a X68K executable so you wont need Run68k. See the section on creating PDX files for more information on creating a PDX file.
: A program used to convert .wav files to ADPCM for making PDX files.
: A program coded in java used to convert OPM files to MXDRV mml if you don't feel like programming your own patches. To use it type this into the command line:

opm2mml [filename.opm]

MDX Players

: A standalone player for MDX files.
: YM2151 and OKIM6258 emulation library needed for mxv. Just put it in the same directory mxv is.
: MDX driver for windows, once again needed for mxv. Just put it in the same directory mxv is.
MDX Decoder
: A .dll component for Foobar2000 that makes it so Foobar can play MDX files.

MXDRV Specific Syntax

#PCMFILE "filename.pdx"
Specify a PDX file for ADPCM use. See the "Making PDX files" section for more info on how to create a PDX file and use it.


AR, DR, SR, RR, SL, OL, KS, ML, DT1, DT2, AME,
AR, DR, SR, RR, SL, OL, KS, ML, DT1, DT2, AME,
AR, DR, SR, RR, SL, OL, KS, ML, DT1, DT2, AME,
AR, DR, SR, RR, SL, OL, KS, ML, DT1, DT2, AME,

FM Instrument Definition.
NOTE: I'm not an FM wizard, so what I think these mean may not be true, so it's better to use opm2mml for this part.

AR = Attack Rate
DR = Decay Rate
SR = Sustain Rate
RR = Release Rate
SL = Sustain Level
OL = ? (If you know please correct this.)
KS = Key Sync
ML = ? (If you know please correct this.)
DT1 = Detune 1
DT2 = Detune 2
AME = ? (If you know please correct this.)
CON = FM synthesis algorithm. Determines how the operators are connected. Play with VOPM to figure this one out.
FL = Feedback Level
OP = ? (If you know please correct this.)

24, 3, 0, 15, 3, 22, 0, 1, 3, 0, 0,
24, 0, 0, 15, 0, 0, 0, 5, 3, 0, 0,
24, 3, 0, 15, 3, 22, 0, 2, 7, 0, 0,
24, 0, 0, 15, 0, 0, 0, 2, 7, 0, 0,
/* CON FL OP */
4, 5, 15

Again, it's probably easier for you to rip voices from existing games or use opm2mml to do this part.
Set loop start
Use this in a channel if you want to loop everything after this.
A-H, P-W
Set channel.
You MUST set one of these letters at the beginning on a new line if you intend to sequnce notes and macros on this line. A-H is for FM, P-W is for ADPCM.
Change PCM frequency (pitch).
Range is 0-4. Default is 4.
0 = 3.9kHz
1 = 5.2kHz
2 = 7.8kHz
3 = 10.4kHz
4 = 15.6kHz
Set amplitude LFO.
Waveform is the LFO waveform (0 = sawtooth, 1 = square, 2 = triangle).
Speed is 1/4th of the LFO cycle in ticks, and amplitude is the MAX amplitude of the LFO.

Turn on amplitude LFO for the current channel. Only needed if you have it turned off for a channel. (Setting LFO automatically turns it on.)

Turn on amplitude LFO for the current channel. Only needed if it's already on.

Set the delay from note on to LFO start (not including OPM LFO.)
# is the delay in ticks.

Set OPM LFO values
#1 = LFO Waveform (0 = sawtooth, 1 = square, 2 = triangle)
#2 = LFRQ
#3 = PMD
#4 = AMD
#5 = PMS
#6 = AMS
#7 = Key sync (0 = no sync, 1 = sync)

Turn OPM LFO on for current channel (setting OPM LFO automatically turns it on)

Turn OPM LFO off for current channel.

Set hard panning position.
0 = no output, 1 = left, 2 = right, 3 = center.
Note cutoff (stacatto) in ticks.
Set the cutoff of a note, with duration in ticks.

Sync send macro
Continue playback on channel if it is in sync wait mode

Write OPM register reg with value val

Set OPM Noise frequency

Sync wait macro
Set current channel in sync wait mode, pausing playback of the channel

Compiling a Tune

So now that you now everything, Let's make a super basic song!

#title "Cool Song"
#pcmfile "coolpcm.pdx"

;instrument definition
24, 3, 0, 15, 3, 22, 0, 1, 3, 0, 0,
24, 0, 0, 15, 0, 0, 0, 5, 3, 0, 0,
24, 3, 0, 15, 3, 22, 0, 2, 7, 0, 0,
24, 0, 0, 15, 0, 0, 0, 2, 7, 0, 0,
/* CON FL OP */
4, 5, 15

A t150
A v10 o4 l8 @1 L cdefgab>c4

After you've done that, save your .mml file or .txt file, And go into your command line.
In order to compile your song, type this into the command line:

run68 mxc [filename.txt] (the file extension can be .mml as well.)

If you did everything right, you should have your first song!

Making PDX files

PDX files are necessary for using ADPCM in your MXDRV tracks. Here's how to make one from scratch.

Use WAV2ADP to convert .wav files into raw ADPCM (.pcm) files.
To use it, type this into the command line:

run68 wav2adp [filename.wav]

If you did it right, it should spit out a. PCM file. After you've got all of your samples, you'll need to put it into one PDX file. But before we do that, we'll need a .PDL file to specify all of the samples and which note you want to give to a sample.
A PDL file is just a renamed text file.
Make your file like this:

#ex-pdx 1


I'll explain what's happening here.
We're using ex-pdx. After the PDX format was created, it was improved to switch banks for tons of samples in one PDX. A single bank can have around 90 files.
Then, we defined which bank we wanted with the "@0" the 0 can be whatever number you want. Then, we set notes 1, 2 and 3 to filename1.pcm, filename2.pcm and filename3.pcm respectively.
After all that's finished, you're ready to make your PDX. You can type the following into the command line, or drag your .PDL onto MKPDX:

mkpdx filename.pdl

If you typed it right, it should make a .PDX file. Congrats! Now you can use ADPCM in your songs. In order to use it, define this at the top of your mml file:

#pcmfile "filename.pdx"

Then, use channels P-W to actually use the samples like this:

P l8 n1 n3 n2,16 ;plays pcm notes 1, 3 and 2. 1 and 3 play as eighth notes while note 2 plays as a sixteenth note.

Special Thanks

Thanks to this article on MXDRV.
It was super helpful. Without this article, This page would not exist.

Enjoy making X68K music!

【日本語】ヌーブ(クラス) · 【日本語】パンダトラッカー · 【日本語】フィルキーマークアップ · 【日本語】フォーマット · 【日本語】サンプルパック · 【日本語】BotBr · 【日本語】現在のメージャーバトルの情報和訳 · 【日本語】deflemask (フォーマット) · 【日本語】mariopantse (フォーマット) · 〔日本のBotBr向け〕 バトル · 〔日本のBotBr向け〕 用語・造語辞典 · bandcamp · Batbia · Bio art · BotBr Projects · BotBrs · Complete list of ripped chiptunes repositories · CreepSmash_Hotkeys · demo scene · failure_lambda · fun · Goggles · Guide to Rendering · Guitar Pedals and YOU · Hexadecimal · Huby · I Am New To fsound · I Am New To Harmony · I Am New To Music Theory · I Am New To NSF · I Am New To Pixeling · I Am New To Poetry and Writing Lyrics · I Am New To pxtone · I Am New To ZXBeep · I'm New To ZXBeep · In regards to Flow and its applications in music composition · Intro to Subtractive Synthesis · juke · List of Scales · Maximizing Artistic Productivity · MDX · modshroom · Music Theory - Case Examples and Analysis · Music Theory - History of Modern Theory and Tonality · NES/Famicom · Octode · Phaser1 · PlugBot · Savage · Smeesh Hotkeys · Special FX · Specification of General MIDI and Roland MT-32 patches · Stats · Stats · Super Mario War · Sylphy · temp · The Hall of Completionists · The Hall of Knowledge · tic80 · Tools · Tournament · Tritone · Upper Structure Triad · Utilising Adlib Tracker II · vgm · Writing Exceptional Characters