------------------------------------------------------------------------
MCKC: MML > MCK Converter Ver 0.14 by Manbow-J
(manbow-j@hamal.freemail.ne.jp)
NES/NSF sound driver by Izumi
English Translation and additional documentation by virt
(virt@vgmix.com | virt.vgmix.com)
------------------------------------------------------------------------
Introduction
As you may or may not know, MML (Music Macro Language) is a popular form of
sound programming in Japan, and has been shaped into a creation tool for
everything from music for various game consoles to General MIDI sequences.
Its huge array of commands and extremely simplified macro structure make it
quite fast and adaptable for composition in many forms, past a relatively
simple learning curve.
Americans and Europeans have typically relied on module trackers to create
chiptunes - or, as they're called in Japan, VGM. A tracker is certainly an
incredibly precise, visually straightforward, and otherwise logical tool.
However, in imitating a NES, there are many things that it just can't pull
off, and others that take far more effort than they should.
For one thing, in such a restrictive timing grid, it's difficult to cram a
lot of timbral changes into a short space. There's no facility in a sample-
based tracker for programming changes in the sound into the instrument
script, so a quick change of timbre at the beginning of the note has to be
put into the pattern each time, and this can drastically complicate the
composition of a tune. Every note echo, every timbral attack, all by hand.
We do it out of necessity, but it's extremely inefficient, and leaves me
wanting for more control.
Plus, there's that whole feeling of disconnection one gets when working
with audio samples to emulate the realtime synthesizer of the NES. Sampled
noise sounds fake and reacts too predictably, since it's not at all random.
The triangle's aliasing is weak and unconvincing. DPCM doesn't sound right
when mixed at 44.1khz. We need to be composing for the actual console's
limits and structure, not a crude imitation. While NSF might still be an
emulation, it's a LOT closer than an S3M or XM module.
But NSFs are just big chunks of ASM instructions! What's a NES-obsessed
musician to do? Either devote months (or years!) to perfecting 6502
assembly and code your own sound driver, then worry about a script for the
music itself -- or use the fantastic MCK driver, and program it with MML,
then compile it into a finished NSF or NES binary. Let the authentic
Western NESchip love begin!
------------------------------------------------------------------------
Using MCKC
MCKC, specifically, is the program that you run to convert your raw MML sequence
(just a plain old text file) into assembly-language source code compatible with
the MCK sound driver, to be compiled with NESASM into a finished NSF or NES rom.
Once you have created your MML document, you run MCKC on it like so:
Mckc [switch] [mml file] ([output file, optional])
You'll probably want to name the file songdata.h so it won't be necessary to
edit the compilation scripts, but you can change the file that the scripts call
for from songdata.h to whatever you like, and thus the filename becomes
unimportant.
* Command-line switches:
-h or -?
A help message is printed out.
-n
Helpful information is written to the screen but "effect.h", an
assembly file defining the various macros used in the song, is not
created as it normally would be.
-o[str]
The same data is printed and "effect.h" is created with a filename
equivalent to [str].
-w
Suppress warnings.
------------------------------------------------------------------------
Explanation of conventions used in this text
* Note: Hexidecimal Notation
Within this document there are several instances where a number is preceded
by a "$" and may contain the letters A ~ F. This is standard hexidecimal
notation, and it is assumed that the reader is familiar with hex numbers,
although for most functions described no hexidecimal values are necessary.
* Duration Conventions and Timing
MML's notation works much like traditional staff notation. Quarter notes,
Hemisemidemiquavers, 16th notes, Half rests, they're all used. "c4", in
addition to being a powerful explosive, is a "c" quarter note. c16 is a
16th note.
Furthermore, you can 'dot' your notes, extending them by half their length,
by adding a period. "c4." is equivalent to c4 with a c8 added to the end.
An interesting thing about MML is that you can chain certain modifiers like
dots - you can type "c4..." and it will be equivalent to c4 with c8, c16,
and c32 tied onto it.
There is another division within notes: 'Count Length', which works as
follows: All notes are broken up into 192 equal pieces, regardless of their
time duration. This is used in such commands as the "q" effect as noted
below, when it is necessary to divide a note proportionally in order to
alter some part of it.
Finally, in the terms of the NES, a 'frame' is a period of time equal to
1/60 second. This is not related to tempo in the traditional musical sense,
but the values for many commands are stepped through once per frame and
thus take the same amount of time regardless of the song's tempo. Things
like volume envelopes have discrete values that are not scaled to match the
speed of the song.
------------------------------------------------------------------------
The Script Header
There are a number of fields that you will find at the top of the
file, before all of the note data. This information is the header, and
it sets forth a number of parameters that define the properties of the
song, and establishes "macros" that will allow you to automate volume,
pitch, and timbre changes by issuing simple commands in the sequence
script.
Credits
None of the following three fields are included in the final output
assembly file once run through MCK. To have them show up in the final NSF,
you will have to edit the appropriate fields in the make_nsf.txt assembly
file included with your MCK distribution. These fields are simply included
in the format so that MML files can be identified upon examination.
#TITLE[str]
The title of your tune.
#COMPOSER[str]
The name of the person who composed the tune.
#PROGRAMER[str] <--sic, typo is correct form
The name of the person, if applicable, who created the MML file from a
pre-existing composition in another format and compiled it into binary
data with the player code. In the Japanese VGM industry, it is not
uncommon for a composer to work with a sound programmer.
Definitions and Includes
#OCTAVE-REV[num] (0)
Normally, the way you change octaves within your sequence is by
writing > (raise octave) or < (lower octave) in between notes. If you
use #OCTAVE-REV, however, with a non-zero value for [num], the
"polarity" of octave-changes will be reversed; < will increase the
octave by one. and > will decrease it.> " with +1, " < " with -1).
#INCLUDE[str]
Inserts a separate, supplementary file into the current file at the
conversion-to-assembly stage. You can chain together up to 16 files in
this manner. This will allow you to have un-changing or oft-used
values such as #COMPOSER or a