This article is basically an English translation of all the commands listed in the PMDMML.MAN manual that comes with the Professional Music Driver distribution. '[#[Command Parameters] Curly braces denote optional parameters; ellipsis denotes one or more parameters. Any parameter name that does not appear above is an alias for either '[o]number'[/o] or an arbitrary string depending on the context. Where commas are used to separate command parameters, no whitespace may appear immediately before the comma (expect possibly for the '[b]@'[/b] command (3-1)). '[o]number'[/o]: Any longest string containing only numeral digits and possibly a negative sign. Numbers may be preceded by a '[b]$'[/b] symbol to denote hexadecimal numbers. Unless noted otherwise, the valid range for a number is 0 - 255. '[u]The MML compiler cannot parse hexadecimal numbers larger than $FF'[/u]. '[o]±number'[/o]: A number with a mandatory '[b]+'[/b] for non-negative values. Unless noted otherwise, the valid range for a signed number is -128 - 127. '[o]duration'[/o]: Any of the following: - '[o]number'[/o] {'[b].'[/b] ...}: A number followed by zero or more dots, representing a usual note value. - '[b]%'[/b]'[o]number'[/o]: The number of ticks. The relationship between note values and ticks is established by the '[b]C'[/b] command (4-11). The valid range for the ticks representation is 1 - 255. The note value representation must be able to expand to an integer number of ticks between 1 - 255, following the usual definitions of a note value. '[o]identifier'[/o]: Any longest string not containing any whitespace or newline characters. Identifiers may begin with a number. '[o]note'[/o]: Any of the following: '[b]c'[/b], '[b]d'[/b], '[b]e'[/b], '[b]f'[/b], '[b]g'[/b], '[b]a'[/b], '[b]b'[/b]. '[o]sign'[/o]: Any of the following: '[b]+'[/b], '[b]-'[/b], '[b]='[/b]. '[o]note-event'[/o]: Any of the following: - '[o]note'[/o]{'[b]='[/b]}{'[o]sign'[/o]...}, a note with any number of accidental signs, possibly containing a neutral sign. See the notes at '[b]_{}'[/b] (4-15) for details of the accidentals. - '[b]x'[/b], which repeats whatever note value was last used in the channel. - '[b]{'[/b]'[o]note-event shift-specifier note-event'[/o]'[b]}'[/b], a portamento from the first note to the second, where '[o]shift-specifier'[/o] may contain '[b]o'[/b] commands (4-4), or '[b]<'[/b], '[b]>'[/b] commands (4-5). '[o]op-flag'[/o]: Any number between 0 and 15 inclusive, which represents all operators whose values sum up to the flag, as a bit-vector: - Operator 1: 1 - Operator 2: 2 - Operator 3: 4 - Operator 4: 8 '[o]-lfo'[/o]: Either '[b]A'[/b], or '[b]B'[/b], representing the two software LFOs per channel. It may be omitted, which is then equivalent to '[b]A'[/b]. This is a suffix; no whitespace should appear between this string and the command preceding it. '[o]-perc'[/o]: Any of the following: - '[b]b'[/b]: Bass kick - '[b]s'[/b]: Snare - '[b]c'[/b]: Crash cymbal - '[b]h'[/b]: Closed hi-hat - '[b]t'[/b]: Tom - '[b]i'[/b]: Rimshot As with above this is also a suffix. '[#[Channel Headers] PMD supports the following built-in channel headers in YM2608 / OPNA: - A, B, C, D, E, F (YM2608 FM) - G, H, I (YM2149F a.k.a. SSG a.k.a. PSG) - J (PCM / ADPCM depending on current chip) - K (PMD's internal percussion track, which may use SSG channel 3 or YM2608 rhythm channel) - Extra headers from splitting the four operators of FM channel 3, declared using '[b]#FM3Extend'[/b] (2-20) - Extra headers for the PPZ8 software-mixed PCM channels, declared using '[b]#PPZExtend'[/b] (2-25) Channel headers may be cascaded to flush MML commands to multiple channels at the same time, e.g. if OPNA is used then '[b]DEGH'[/b] specifies that MML commands should be written to FM channels 4 and 5, and PSG channels 1 and 2. Furthermore, two families of pseudo-channels are permitted: - '[b]!'[/b]'[o]identifier'[/o] (3-2) - '[b]R'[/b]'[o]number'[/o] (1-2-1) Except otherwise noted, all MML commands can be used in pseudo-channels as well. Pseudo-channel identifiers cannot be cascaded. For sound chips other than OPNA, the following channel headers, and only these headers, are available: - OPN: '[b]ABC'[/b] (FM), '[b]DEF'[/b] (default channel 3 expansions), '[b]GHI'[/b] (SSG), '[b]KR'[/b] (SSG rhythm) - OPL: '[b]ABCDEFGHI'[/b] (FM) - OPM: '[b]ABCDEFGH'[/b] (FM), '[b]J'[/b] (PCM) - OPN2: '[b]ABCDEF'[/b] (FM), '[b]JK'[/b] (PCM) '[#[Master List] '[t[b2]Compiler Directives'[/t] '[tab[#ADPCM[120] '[tab[#Arranger[120] '[tab[#Bendrange[120] '[tab[#Composer[120] '[tab[#Detune[120] '[tab[#DT2Flag[120] '[tab[#EnvelopeSpeed[120] '[tab[#FFFile[120] '[tab[#Filename[120] '[tab[#FM3Extend[120] '[tab[#Include[120] '[tab[#Jump[120] '[tab[#LFOSpeed[120] '[tab[#LoopDefault[120] '[tab[#Memo[120] '[tab[#Octave[120] '[tab[#Option[120] '[tab[#PCMFile[120] '[tab[#PPCFile[120] '[tab[#PCMVolume[120] '[tab[#PPSFile[120] '[tab[#PPZExtend[120] '[tab[#PPZFile[120] '[tab[#Tempo[120] '[tab[#Timer[120] '[tab[#Title[120] '[tab[#Transpose[120] '[tab[#Volumedown[120] '[tab[#Zenlen[120] '[t[b2]Compile-Time Macros'[/t] '[tab[![60] '[tab["[60] '[tab[&[60] '[tab['?[60] '[tab[/[60] '[tab[;[60] '[tab[<[60] '[tab[>[60] '[tab[B[60] '[tab[C[60] '[tab[I[60] '[tab[MP[60] '[tab[S[60] '[tab[W[60] '[tab[X[60] '[tab[_{}[60] '[tab[`[60] '[tab[l[60] '[tab[l=[60] '[tab[l+[60] '[tab[l-[60] '[tab[l^[60] '[tab[o[60] '[tab[o+[60] '[tab[o-[60] '[tab[v[60] '[tab[v+[60] '[tab[v-[60] '[tab[v([60] '[tab[v)[60] '[tab[|[60] '[tab[|![60] '[t[b2]General Commands'[/t] '[tab[&[60] '[tab[&&[60] '[tab[)[60] '[tab[([60] '[tab[*[60] '[tab[D[60] '[tab[DD[60] '[tab[DF[60] '[tab[DS[60] '[tab[DP[60] '[tab[DR[60] '[tab[DM[60] '[tab[F[60] '[tab[L[60] '[tab[M[60] '[tab[MD[60] '[tab[MW[60] '[tab[MX[60] '[tab[Q[60] '[tab[T[60] '[tab[V[60] '[tab[[:][60] '[tab[_[60] '[tab[__[60] '[tab[_M[60] '[tab[m[60] '[tab[q[60] '[tab[t[60] '[tab[y[60] '[t[b2]FM Commands'[/t] '[tab[#[60] '[tab[##[60] '[tab[#a[60] '[tab[#f[60] '[tab[#p[60] '[tab[#w[60] '[tab[#D[60] '[tab[@[60] '[tab[FB[60] '[tab[H[60] '[tab[MM[60] '[tab[O[60] '[tab[P[60] '[tab[p[60] '[tab[px[60] '[tab[s[60] '[tab[sd[60] '[tab[sdd[60] '[tab[sk[60] '[tab[w[60] '[t[b2]SSG Commands'[/t] '[tab[@[60] '[tab[DX[60] '[tab[E[60] '[tab[EX[60] '[tab[P[60] '[tab[w[60] '[t[b2]PCM Commands'[/t] '[tab[@[60] '[tab[A[60] '[tab[E[60] '[tab[EX[60] '[tab[p[60] '[tab[px[60] '[t[b2]Rhythm Commands'[/t] '[tab[*[60] '[tab[@[60] '[tab[R[60] '[tab[\[60] '[tab[\l[60] '[tab[\m[60] '[tab[\r[60] '[tab[\V[60] '[tab[\v[60] '[t[b2]Miscellaneous Commands'[/t] '[tab[N[60] '[tab[Z[60] '[tab[n[60] '[tab[~[60] In the command list itself, all commands are followed by parenthesized section numbers from the PMDMML.MAN manual file. '[#[Compiler Directives] All directives must start from the beginning of a line. Most of these directives and unquoted string parameters are case-insensitive, and will work even if partially spelt out, as long as one unique directive can be identified (e.g. '[b]#ad #ar #b'[/b] will suffice for the first three listed below). Directive parameters extend to the end of line, usually ignoring any comment markers. '[t[b2]#ADPCM off'[/t] '[tab['[t[b2]#ADPCM on'[/t] - Default PCM sample mode[540] ((2-23)) '[-s]1. Default; does nothing.'[/-s] MC.EXE has a bug which renders this identical to '[b]#ADPCM on'[/b]. 2. Expands to '[b]A'[/b] (15-10) at the beginning of the PCM channel. '[tab['[t[b2]#Arranger'[/t] '[o]string'[/o] - Arranger metadata[540] ((2-8)) '[o]string'[/o] = Arranger field '[tab['[t[b2]#Bendrange'[/t] '[o]x'[/o] - Default pitch wheel range[540] ((2-15)) Expands to '[b]B'[/b] '[o]x'[/o] (7-4) at the beginning of FM channel 1. '[tab['[t[b2]#Composer'[/t] '[o]string'[/o] - Composer metadata[540] ((2-7)) '[o]string'[/o] = Composer field '[t[b2]#Detune Normal'[/t] '[tab['[t[b2]#Detune Extend'[/t] - Default SSG pitch mode[540] ((2-16)) 1. Default; does nothing. 2. Expands to '[b]DX1'[/b] (7-3) at the beginning of all SSG channels. '[t[b2]#DT2Flag off'[/t] '[tab['[t[b2]#DT2Flag on'[/t] - Enable DT2 FM parameter[540] ((2-14)) 1. Requires all FM patch definitions to omit the DT2 parameters. Where the DT2 parameter is required by the sound chip, the compiler replaces these values with 0. 2. Requires all FM patch definitions to contain values for the DT2 parameter. '[t[b2]#EnvelopeSpeed Normal'[/t] '[tab['[t[b2]#EnvelopeSpeed Extend'[/t] - Default SSG / PCM envelope speed mode[540] ((2-18)) 1. Default; does nothing. 2. Expands to '[b]EX1'[/b] (8-2) at the beginning of all SSG channels and the PCM channel. '[tab['[t[b2]#FFFile'[/t] '[o]name'[/o] - Load FM patch bank[540] ((2-4)) Loads all FM patches from a given file during compilation. '[o]name'[/o] = Name of the patch bank file '[t[b2]#Filename'[/t] '[o]name'[/o] '[tab['[t[b2]#Filename .'[/t]'[o]ext'[/o] - Output filename[540] ((2-1)) '[o]name'[/o] = Name of the output file '[o]ext'[/o] = File extension of the output file '[tab['[t[b2]#FM3Extend'[/t] '[o]string'[/o] - FM Channel 3 expansion[540] ((2-20)) Splits the four operators in FM channel 3 into individual channels. '[o]string'[/o]: Up to three uppercase or lowercase letters, must not be reserved for existing channels Note: Supported only on OPN or OPNA. The expansion channels default to '[b]DEF'[/b] on OPN. '[tab['[t[b2]#Include'[/t] '[o]name'[/o] - Include MML file[540] ((2-21)) '[o]name'[/o] = Name of the input MML file '[tab['[t[b2]#Jump'[/t] '[o]x'[/o] - Initial measure setting[540] ((2-24)) '[o]x'[/o] = Number of measures to skip before playing compiled song Valid range for '[o]x'[/o] = 0 - 65535 Note: For use on a PC-x801 only; applies to MCH.EXE or MC.EXE with either option /P or /S specified. '[t[b2]#LFOSpeed Normal'[/t] '[tab['[t[b2]#LFOSpeed Extend'[/t] - Default software LFO speed mode[540] ((2-17)) 1. Default; does nothing. 2. Expands to '[b]MXA1 MXB1'[/b] (9-5) at the beginning of all channels except the rhythm channel. '[tab['[t[b2]#LoopDefault'[/t] '[o]x'[/o] - Default loop count[540] ((2-13)) If '[o]x'[/o] = 0 (default): Infinite loop for parameterless '[b]]'[/b] command (10-1) If '[o]x'[/o] = 1-255: Number of loops for parameterless '[b]]'[/b] command (10-1) '[tab['[t[b2]#Memo'[/t] '[o]string'[/o] - Append memo metadata[540] ((2-9)) '[o]string'[/o] = Single line of memo '[t[b2]#Octave Normal'[/t] '[tab['[t[b2]#Octave Reversed'[/t] - Default octave shift direction[540] ((2-12)) 1. Default; does nothing. 2. Expands to '[b]X'[/b] (4-6) at the beginning of FM channel 1. '[tab['[t[b2]#Option'[/t] '[o]opts'[/o]... - Compiler option setting[540] ((2-5)) Appends all specified options to MC.EXE / MCH.EXE when the file is compiled. '[o]opts'[/o]... = Extra compiler options '[t[b2]#PCMFile'[/t] '[o]name'[/o] '[tab['[t[b2]#PPCFile'[/t] '[o]name'[/o] - Load PCM bank[540] ((2-3)) Specifies a PPC / PVI / PZI / P86 file used by the PCM channel ('[b]J'[/b]). '[o]name'[/o] = Name of the sample bank file '[t[b2]#PCMVolume Normal'[/t] '[tab['[t[b2]#PCMVolume Extend'[/t] - PCM coarse volume mode[540] ((2-19)) 1. Default; does nothing. 2. Changes the conversion formula for the '[b]v'[/b] command (5-1) on the PCM channel. '[tab['[t[b2]#PPSFile'[/t] '[o]name'[/o] - Load SSG percussion PCM bank[540] ((2-2)) Specifies a file created from the MAKEPPS.EXE utility which may be used by PMD players to play 4-bit PCM percussion samples on SSG channel 3. '[o]name'[/o] = Name of the sample bank file '[tab['[t[b2]#PPZExtend'[/t] '[o]string'[/o] - PPZ8 expansion[540] ((2-25)) Splits the PCM channel into individual channels allowing use of the PPZ software sample mixer. '[o]string'[/o] = 1 to 8 uppercase or lowercase letters, must not be reserved for existing channels '[tab['[t[b2]#PPZFile'[/t] '[o]name'[/o] {'[t[b2],'[/t] '[o]upper'[/o]} - Load PPZ bank(s)[540] ((2-26)) Specifies a PVI / PZI file used by the PPZ sound driver. '[o]name'[/o] = Name of the sample bank file for instrument 0 - 127 '[o]upper'[/o] = Name of the sample bank file for instrument 128 - 255 '[tab['[t[b2]#Tempo'[/t] '[o]x'[/o] - Initial tempo[540] ((2-10)) Expands to '[b]t'[/b] '[o]x'[/o] (11-1) at the beginning of SSG channel 1. '[tab['[t[b2]#Timer'[/t] '[o]x'[/o] - Initial timer rate[540] ((2-10)) Expands to '[b]T'[/b] '[o]x'[/o] (11-2) at the beginning of SSG channel 1. '[tab['[t[b2]#Title'[/t] '[o]string'[/o] - Title metadata[540] ((2-6)) '[o]string'[/o] = Title field '[tab['[t[b2]#Transpose'[/t] '[o]x'[/o] - Default global transpose[540] ((2-27)) Expands to '[b]_M'[/b] '[o]x'[/o] (4-16) at the beginning of all channels except the rhythm channel. '[tab['[t[b2]#Volumedown'[/t] {'[t[b2]F'[/t]}{'[t[b2]S'[/t]}{'[t[b2]P'[/t]}{'[t[b2]R'[/t]} {'[t[b2]±'[/t]} '[o]x'[/o] {'[t[b2],'[/t] ...} - Default sound chip attenuation[540] ((2-22)) Expands to the corresponding '[b]DF'[/b] / '[b]DS'[/b] / '[b]DP'[/b] / '[b]DR'[/b] commands (15-4) with the given parameter '[o]x'[/o] at the beginning of SSG channel 1. Multiple options can be combined, e.g. '[b]FPR 16'[/b] becomes '[b]DF 16 DP 16 DR 16'[/b]. '[tab['[t[b2]#Zenlen'[/t] '[o]x'[/o] - Default whole note tick count[540] ((2-11)) Expands to '[b]C'[/b] '[o]x'[/o] (4-11) at the beginning of SSG channel 1. '[#[Compile-Time Macros] '[tab['[t[b2]!'[/t] '[o]identifier'[/o] - Substitution macro[540] ((16-1)) Substitutes the command with the contents of the pseudo-channel whose header is '[b]!'[/b]'[o]identifier'[/o] (3-2). Note: '[u]This is not a run-time macro expansion'[/u]. The rhythm channel may use the '[b]R'[/b] command (6-7) instead for run-time patterns. '[tab['[t[b2]"'[/t] - Fast-forward[540] ((16-2)) Skips all note events until the next occurrence of '[b]"'[/b] or '[b]''[/b] (16-3). All other stateful commands remain intact. '[tab['[t[b2]&'[/t] '[o]duration'[/o] - Tie note value[540] ((4-10)) Expands to '[b]l+'[/b] '[o]duration'[/o] (4-9). Note: The '[b]&'[/b] command is compiled rather than expanded if it is followed by a note rather than a duration specifier. '[tab['[t[b2]''[/t] - Unmute after fast-forwarding[540] ((16-3)) Expands to '[b]"'[/b] (16-2) followed by '[b]m0'[/b] (15-7). '[tab['[t[b2]/'[/t] - End of channel[540] ((16-5)) Ignores all remaining MML commands in the channel. '[tab['[t[b2];'[/t] - Comment[540] ((16-6)) Ignores all following text until the next newline character. '[t[b2]<'[/t] - Lower octave '[tab['[t[b2]>'[/t] - Raise octave[540] ((4-5)) By default, '[b]<'[/b] lowers the channel's octave by 1 whereas '[b]>'[/b] increases by 1. The exact directions may be affected by '[b]X'[/b] (4-6) and '[b]#Octave'[/b] (2-12). Note: This macro applies to notes the first time they are read by the compiler; in particular, no extra commands are required to balance the number of octave changes within loops. Where a single note needs to reach multiple octaves, use '[b]__+12'[/b] and '[b]__-12'[/b] (4-14) instead. '[tab['[t[b2]B'[/t] '[o]x'[/o] - Pitch wheel range[540] ((7-4)) '[o]x'[/o] = Number of semitones of the detune when the command '[b]I 8192'[/b] (7-5) is applied '[tab['[t[b2]C'[/t] '[o]x'[/o] - Whole note tick count[540] ((4-11)) Sets the number of ticks in one whole note to '[o]x'[/o] (default 96). Valid range for '[o]x'[/o] = 1 - 255 Note: This command does not alter the absolute duration of one tick. Doing so requires one of the tempo commands. '[tab['[t[b2]I'[/t] '[o]x'[/o] - Fine pitch[540] ((7-5)) Expands to individual '[b]D'[/b] commands (7-1) for all notes respecting the pitch wheel range. See '[b]B'[/b] (7-4). '[o]x'[/o]: Detune amount Valid range for '[o]x'[/o]: -32768 - 32767 Note: Like < and > (4-5), this macro applies to notes the first time they are read by the compiler. '[tab['[t[b2]MP'[/t]'[o]-lfo'[/o] '[o]depth'[/o] {'[t[b2],'[/t] '[o]delay'[/o] {'[t[b2],'[/t] '[o]speed'[/o]}} - Software LFO parameters (one-way)[540] ((9-6)) Expands to '[b]M'[/b]'[o]-lfo'[/o] '[o]delay'[/o]'[b],'[/b] '[o]rate'[/o]'[b],'[/b] '[o]depth'[/o]'[b], 255'[/b] (9-1), followed by '[b]* 1'[/b] (9-3). '[o]delay'[/o] = 0 if not given '[o]rate'[/o] = 1 if not given '[tab['[t[b2]S'[/t] '[o]x'[/o] {'[t[b2],'[/t] '[o]y'[/o] {'[t[b2],'[/t] '[o]z'[/o]}} - Grace note[540] ((12-1)) Expands to note events at the beginning of following notes that move by semitone to the target note. If '[o]x'[/o] = 0: Disable grace notes If '[o]x'[/o] = 1-255: Number of ticks for each grace note If '[o]x'[/o] = '[b]l'[/b] '[o]duration'[/o]: Note value for each grace note If '[o]y'[/o] > 0: Start from '[o]y'[/o] semitones above the target note If '[o]y'[/o] < 0: Start from -'[o]y'[/o] semitones below the target note Valid range for '[o]y'[/o] = -128 - 127 (-1 if not given) If '[o]z'[/o] = 0: Play grace notes individually If '[o]z'[/o] = 1 or not given: Tie grace notes Valid range for '[o]z'[/o] = 0 - 255 Note: Ineffective if the total duration of all grace notes is longer than the note itself. '[tab['[t[b2]W'[/t] '[o]x'[/o] {'[t[b2],'[/t] {'[t[b2]%'[/t]} '[o]y'[/o] {'[t[b2],'[/t] '[o]z'[/o]}} - Retrigger[540] ((12-2)) Expands following notes to shorter notes with increasing or decreasing volume. If '[o]x'[/o] = 0: Disable retrigger If '[o]x'[/o] = 1-255: Number of ticks for each note If '[o]x'[/o] = '[b]l'[/b] '[o]duration'[/o]: Note value for each retriggered note '[b]%'[/b]: If given, uses '[b](%'[/b] and '[b])%'[/b] instead of '[b]('[/b] and '[b])'[/b] (5-5) '[o]y'[/o] = Volume increment for each successive note Valid range for '[o]y'[/o] = -128 - 127 (-1 if not given) If '[o]z'[/o] = 0 or not given: Retrigger notes individually If '[o]z'[/o] = 1: Tie to notes with changing volume If '[o]z'[/o] = 2: As 0, but retrigger only once If '[o]z'[/o] = 3: As 1, but tie only once Note: Ineffective is the note duration is not longer than '[o]x'[/o]. Although the original manual document calls this effect "echo", the PMD compiler does not have any kind of echo buffer, so this macro is not the same as the "echo" macro found in other MML dialects such as PPMCK. '[tab['[t[b2]X'[/t] - Exchange octave commands[540] ((4-6)) Exchanges all following occurrences of '[b]<'[/b] and '[b]>'[/b] (4-5). This command acts independently of channel headers. '[tab['[t[b2]_{'[/t] '[o]sign note'[/o]... '[t[b2]}'[/t] - Key signature[540] ((4-15)) Automatically applies accidentals to all following notes. '[o]sign'[/o]: The accidental to apply, '[b]='[/b] to cancel existing accidentals '[o]note'[/o]...: List of notes that use this accidental E.g.: '[b]_{+fc} _{=fc} _{-bea}'[/b] specifies D Major, then C Major, and finally E Flat Major. Note: Any accidental appearing after a note is relative to the key signature unless the '[b]='[/b] symbol appears in the note, which cancels the key signature for that particular note. '[tab['[t[b2]`'[/t] - Multiline comment[540] ((16-7)) If used as a MML command, ignores all following MML commands until the next occurrence of this command. If used at the beginning of a line, behaves as if a '[b]`'[/b] command is applied to all channels, and also '[u]skips all MML definitions'[/u] until the next occurrence of this command at the beginning of a line. '[tab['[t[b2]l'[/t] '[o]duration'[/o] - Default note duration[540] ((4-8)) Sets the default length of all note events and duration modifiers to '[o]duration'[/o]. '[o]note-event'[/o] '[t[b2]l='[/t] {'[o]duration'[/o]} '[o]note-event'[/o] '[t[b2]l+'[/t] '[o]duration'[/o] '[o]note-event'[/o] '[t[b2]l-'[/t] '[o]duration'[/o] '[tab['[o]note-event'[/o] '[t[b2]l^'[/t] '[o]number'[/o] - Duration modifiers[540] ((4-9)) 1. Sets the previous note event's length to '[o]duration'[/o], or the default length given by the '[b]l'[/b] command (4-8) if omitted. 2. Adds '[o]duration'[/o] to the previous note event's length. 3. Subtracts '[o]duration'[/o] from the previous note event's length. 4. Multiples the previous note event's length by '[o]number'[/o]. Valid range for '[o]number'[/o] = 1 - 255 Note: The '[b]l'[/b] may be omitted in all these commands. The '[b]l='[/b] can be omitted altogether; this is how notes followed immediately by a duration specifier are parsed. '[tab['[t[b2]o'[/t] '[o]x'[/o] - Octave setting[540] ((4-4)) '[o]x'[/o]: New octave (default 4) Valid range for '[o]x'[/o]: 1 - 8 '[tab['[t[b2]o'[/t] '[o]±x'[/o] - Channel octave offset[540] ((4-7)) Also applies to the existing octave value immediately. Each new command replaces the previous parameter. '[o]±x'[/o]: Number of octaves to add to all '[b]o'[/b] commands (4-4) Valid range for '[o]±x'[/o]: -7 - +7 '[tab['[t[b2]v'[/t] '[o]x'[/o] - Coarse volume setting[540] ((5-1)) For SSG channels: Same as '[b]V'[/b] (5-2). For FM channels: Expands to a '[b]V'[/b] command (5-2) by looking up the following constant table for '[o]x'[/o]: '[tab[v[30]'[tab[0[30]'[tab[1[30]'[tab[2[30]'[tab[3[30]'[tab[4[30]'[tab[5[30]'[tab[6[30]'[tab[7[30]'[tab[8[30]'[tab[9[30]'[tab[10[30]'[tab[11[30]'[tab[12[30]'[tab[13[30]'[tab[14[30]'[tab[15[30]'[tab[16[30] '[tab[V[30]'[tab[85[30]'[tab[87[30]'[tab[90[30]'[tab[93[30]'[tab[95[30]'[tab[98[30]'[tab[101[30]'[tab[103[30]'[tab[106[30]'[tab[109[30]'[tab[111[30]'[tab[114[30]'[tab[117[30]'[tab[119[30]'[tab[122[30]'[tab[125[30]'[tab[127[30] For PCM channel: Expands to a '[b]V'[/b] command (5-2) whose parameter is (16 × '[o]x'[/o]), or ('[o]x'[/o] × '[o]x'[/o]) if '[b]#PCMVolume Extend'[/b] (2-19) has been issued, limited to 255. Valid range for '[o]x'[/o]: 0 - 15 on SSG channels, 0 - 16 otherwise '[tab['[t[b2]v'[/t] '[o]±x'[/o] - Channel volume offset[540] ((5-3)) Also applies to the existing channel volume immediately. Each new command replaces the previous parameter. '[o]±x'[/o]: Value to add to all '[b]V'[/b] commands (5-2) '[t[b2]v('[/t] '[o]x'[/o] '[tab['[t[b2]v)'[/t] '[o]x'[/o] - Coarse volume command offset[540] ((5-4)) '[b]v('[/b] subtracts the parameter from all future '[b]v'[/b] commands (5-1), whereas '[b]v)'[/b] adds to them. Each new command replaces the previous parameter. '[o]x'[/o]: Value to add or subtract Valid range for '[o]x'[/o]: 0 - 16 '[t[b2]|'[/t] '[t[b2]|'[/t] '[o]channel'[/o]... '[tab['[t[b2]|!'[/t] '[o]channel'[/o]... - Channel selector[540] ((16-4)) 1. Disables the channel selector. 2. Restricts the following MML commands to only the channels whose identifiers appear in '[o]channel'[/o]..., until the next '[b]|'[/b] command or the end of line. 3. As 2, but for channels that '[u]do not'[/u] appear in the parameter list. '[#[General Commands] '[tab['[t[b2]&'[/t] - Tie note[540] ((4-10)) Suppresses the current note's release due to the '[b]Q'[/b] (4-12) or '[b]q'[/b] (4-13) gate time commands, and the next note's attack. Note: This command must be followed by a note before a duration specifier appears; otherwise the command will expand to '[b]l+'[/b] (4-9). '[tab['[t[b2]&&'[/t] {'[o]duration'[/o]} - Slur[540] ((4-10)) Suppresses the current note's release due to the gate time commands. '[o]duration'[/o]: If given, expands to '[b]x'[/b] '[o]duration'[/o] (i.e. uses current note's pitch) '[t[b2]('[/t] {'[t[b2]^'[/t]} {{'[t[b2]%'[/t]} '[o]x'[/o]} - Volume decrement '[tab['[t[b2])'[/t] {'[t[b2]^'[/t]} {{'[t[b2]%'[/t]} '[o]x'[/o]} - Volume increment[540] ((5-5)) '[b]^'[/b]: If given, command applies to next note only and restores current volume afterwards '[o]x'[/o] = Decrement / increment amount (1 if not given) Omitting '[b]%'[/b] effectively multiplies '[o]x'[/o] by 4 on FM channels, or 16 on the PCM channel. Note: In general, '[b]v'[/b] '[o]x'[/o] '[b])'[/b] is not equal to '[b]v'[/b] '[o]x'[/o]+1 (5-1), and similarly for '[b]('[/b]. '[tab['[t[b2]*'[/t]'[o]-lfo'[/o] '[o]x'[/o] - Software LFO setting[540] ((9-3)) Enables the channel's software low-frequency oscillator A or B. If '[o]x'[/o] = 0: Disable LFO (default) '[o]x'[/o] + 1: Apply LFO to channel pitch '[o]x'[/o] + 2: Apply LFO to channel volume '[o]x'[/o] + 4: New notes do not restart the LFO Note: It is possible for one of the LFOs to control the pitch and another one to control the volume. The following two-parameter shorthands are available: - '[b]*'[/b] '[o]x'[/o] '[b],'[/b] '[o]y'[/o] -> '[b]*A'[/b] '[o]x'[/o] '[b]*B'[/b] '[o]y'[/o] - '[b]*A'[/b] '[o]x'[/o] '[b],'[/b] '[o]y'[/o] -> '[b]*A'[/b] '[o]x'[/o] '[b]*B'[/b] '[o]y'[/o] - '[b]*B'[/b] '[o]x'[/o] '[b],'[/b] '[o]y'[/o] -> '[b]*B'[/b] '[o]x'[/o] '[b]*A'[/b] '[o]y'[/o] '[t[b2]D'[/t] '[o]x'[/o] '[tab['[t[b2]DD'[/t] '[o]x'[/o] - Channel detune[540] ((7-1)) '[b]D'[/b] '[o]x'[/o] = Detune amount, replaces previous value '[b]DD'[/b] '[o]x'[/o] = Relative detune amount, adds to current value Valid range for '[o]x'[/o] = -32768 - 32767 '[t[b2]DF'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] '[t[b2]DS'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] '[t[b2]DP'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] '[tab['[t[b2]DR'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] - Sound chip attenuation[540] ((15-4)) '[b]DF'[/b] = FM channels '[b]DS'[/b] = SSG channels '[b]DP'[/b] = PCM channel '[b]DR'[/b] = Rhythm channel '[o]x'[/o] = attenuation amount, replaces previous value '[o]±x'[/o] = relative attenuation amount, adds to current value '[tab['[t[b2]DM'[/t] '[o]x'[/o] - Channel detune offset[540] ((7-6)) Also applies to the existing detune value immediately. Each new command replaces the previous parameter. '[o]x'[/o]: Detune amount to add to all '[b]D'[/b] commands (7-1) Valid range for '[o]x'[/o]: -32768 - 32767 '[tab['[t[b2]F'[/t] '[o]x'[/o] - Global fade-out[540] ((15-3)) '[o]x'[/o] = Decay rate, higher values are faster Valid range for '[o]x'[/o] = 0 - 127 '[tab['[t[b2]L'[/t] - Channel loop point[540] ((10-2)) Creates a loop point for the channel. If not given, the channel stops playing after the last MML command. Note: Compile-time macros may not recall their states when the channel returns to the loop point. '[tab['[t[b2]M'[/t]'[o]-lfo'[/o] '[o]delay'[/o] {'[t[b2],'[/t] '[o]rate'[/o] '[t[b2],'[/t] '[o]depth'[/o] '[t[b2],'[/t] '[o]K'[/o]} - Software LFO parameters[540] ((9-1)) If '[o]delay'[/o] = 0-255: Number of ticks until LFO triggers If '[o]delay'[/o] = '[b]l'[/b] '[o]duration'[/o]: Note value to wait until LFO triggers Valid range for '[o]depth'[/o] = -128 - 127 Note: The exact meaning of the parameters depends on the '[b]MW'[/b] command (9-2). '[tab['[t[b2]MD'[/t]'[o]-lfo'[/o] '[o]speed'[/o] {'[t[b2],'[/t] '[o]amount'[/o] {'[t[b2],'[/t] '[o]time'[/o]}} - Software LFO depth modulation[540] ((9-7)) If '[o]speed'[/o] = 0: Disable depth modulation If '[o]speed'[/o] = 1 - 255: Number of LFO cycles between adjusting the '[o]depth'[/o] value of '[b]M'[/b] command (9-1) Valid range for '[o]amount'[/o] = -128 - 127 Positive values of '[o]amount'[/o] increase the magnitude of '[o]depth'[/o] and negative values decrease it. If '[o]time'[/o] = 0 or not given: Repeat depth modulation indefinitely If '[o]time'[/o] = 1 - 127: Number of times the '[o]depth'[/o] value is adjusted '[tab['[t[b2]MW'[/t]'[o]-lfo'[/o] '[o]x'[/o] - Software LFO shape[540] ((9-2)) For the absolute pitch envelopes below, repeat each item '[o]rate'[/o] times, then prepend the envelope with 0 repeated '[o]delay'[/o] times, and finally multiply each item by '[o]depth'[/o] (except for '[o]x'[/o] = 3), using the parameters provided by the '[b]M'[/b] command (9-1). '[o]x'[/o] = 0: Bidirectional triangle wave'[c] { | 0 1 2 ... K-1 K K-1 K-2 ... -K+1 -K -K+1 -K+2 ... -2 -1 }'[/c]'[c]If '[o]K'[/o] = 255: { | 0 1 2 ... }'[/c] '[o]x'[/o] = 1: Sawtooth wave'[c] { | 0 1 2 ... K-1 -K -K+1 -K+2 ... -2 -1 }'[/c]'[c]If '[o]K'[/o] = 255: { | 0 1 2 ... }'[/c] '[o]x'[/o] = 2: Square wave'[c] { | K -K }'[/c]'[c]If '[o]rate'[/o] = 255: { K }'[/c] '[o]x'[/o] = 3: Noise wave'[c] { | x }, x is any random value with magnitude not greater than '[o]depth'[/o] × '[o]K'[/o]'[/c]'[c]If '[o]rate'[/o] = 255: { x } (i.e. x changes only once)'[/c] '[o]x'[/o] = 4: Half triangle wave'[c] { | 0 1 2 ... K-1 K K-1 K-2 ... 2 1 }'[/c]'[c]If '[o]K'[/o] = 255: { | 0 1 2 ... }'[/c] '[o]x'[/o] = 5: Amplified triangle wave As '[o]x'[/o] = 0, but with all items further multiplied by the magnitude of '[o]depth'[/o] '[o]x'[/o] = 6: Single'[c] { 0 1 2 ... K-1 | K }'[/c]'[c]If '[o]K'[/o] = 255: { | 0 1 2 ... }'[/c] Note: The graphics in the PMDMML.MAN manual require a monospaced Japanese font to view properly. '[tab['[t[b2]MX'[/t]'[o]-lfo'[/o] '[o]x'[/o] - Software LFO speed mode[540] ((9-5)) If '[o]x'[/o] = 0: Software LFO steps at same rate as ticks If '[o]x'[/o] = 1: Software LFO steps at approximately 54.25 Hz Note: Although the manual says 56 Hz, the actual value is closer to 54.25 Hz which results from the highest possible TimerA value of the YM2608. '[t[b2]Q'[/t] '[o]x'[/o] '[tab['[t[b2]Q'[/t] '[t[b2]%'[/t] '[o]x'[/o] - Gate time setting[540] ((4-12)) 1. Shortens the sustain duration of following notes by '[o]x'[/o]/8-th's of the actual note length. Valid range for '[o]x'[/o] = 0 - 8 2. As 1, but by '[o]x'[/o]/256-th's of the note length instead. '[t[b2]T'[/t] '[o]x'[/o] '[tab['[t[b2]T'[/t] '[o]±x'[/o] - Timer rate setting[540] ((11-2)) '[o]x'[/o] = TimerB rate constant, replaces previous value '[o]±x'[/o] = Relative TimerB rate, adds to current value '[tab['[t[b2]V'[/t] '[o]x'[/o] - Channel volume setting[540] ((5-2)) Valid range for '[o]x'[/o] = 0 - 127 for FM channels, 0 - 15 for SSG channels, 0 - 255 for PCM channel '[tab['[t[b2]['[/t] '[o]main'[/o] {'[t[b2]:'[/t] '[o]sub'[/o]} '[t[b2]]'[/t] {'[o]x'[/o]} - Loop with break[540] ((10-1)) Plays the contents of '[o]main'[/o] followed by '[o]sub'[/o] for '[o]x'[/o] times, but skips over '[o]sub'[/o] on the last loop. If '[o]x'[/o] is not given, uses the value provided by the '[b]#LoopDefault'[/b] directive (2-13). Note: This article uses the fullwidth forms for the square bracket characters where it is impossible to include [ or ] within Firki parameters. '[t[b2]_'[/t] '[o]x'[/o] '[tab['[t[b2]__'[/t] '[o]x'[/o] - Channel transpose[540] ((4-14)) '[b]_'[/b] '[o]x'[/o] = Transpose amount in semitones, replaces previous value '[b]__'[/b] '[o]x'[/o] = Relative transposition in semitones, adds to current value Valid range for '[o]x'[/o] = -128 - 127 '[tab['[t[b2]_M'[/t] '[o]x'[/o] - Channel transpose offset[540] ((4-16)) Also applies to the existing transpose amount immediately. Each new command replaces the previous parameter. '[o]x'[/o]: Value to add to all '[b]_'[/b] commands (4-14) Valid range for '[o]x'[/o] = -128 - 127 '[tab['[t[b2]m'[/t] '[o]x'[/o] - Channel mute[540] ((15-7)) If '[o]x'[/o] = 0: Unmute channel If '[o]x'[/o] = 1: Mute channel '[tab['[t[b2]q'[/t] {'[o]x'[/o] {'[t[b2]-'[/t] '[o]y'[/o]}} {'[t[b2],'[/t] '[o]z'[/o]} - Ticks gate time setting[540] ((4-13)) Further shortens the sustain duration of following notes but also ensures they have a minimum sustain length. '[o]x'[/o] = Number of ticks to shorten (0 if not given) If '[o]y'[/o] is given: Shorten notes by random number of ticks between '[o]x'[/o] and '[o]y'[/o] inclusive; difference between them must be 127 or less '[o]z'[/o] = Shortest sustain duration (0 if not given) Note: Any of '[o]x'[/o], '[o]y'[/o], or '[o]z'[/o] may be substituted with '[b]l'[/b] '[o]duration'[/o]. '[t[b2]t'[/t] '[o]x'[/o] '[tab['[t[b2]t'[/t] '[o]±x'[/o] - Tempo setting[540] ((11-1)) '[o]x'[/o] = Tempo measured in 48-tick beats per minute, replaces previous value '[o]±x'[/o] = Relative tempo amount, adds to current value Valid range for '[o]x'[/o] = 18 - 255 Valid range for '[o]±x'[/o] = -128 - 127 Note: The default value for the '[b]C'[/b] command (4-11) renders the tempo as the number of half notes per minute. '[tab['[t[b2]y'[/t] '[o]reg'[/o] '[t[b2],'[/t] '[o]val'[/o] - Direct register write[540] ((15-1)) Writes '[o]val'[/o] to address '[o]reg'[/o] of the YM2608's internal memory. Uses the high page (ADPCM / FM Ch 4-6) if this command is issued in FM channels 4 - 6, otherwise uses the low page (SSG / Rhythm / FM Ch 1-3). '[#[FM Commands] '[t[b2]# 0'[/t] '[tab['[t[b2]# 1,'[/t] '[o]x'[/o] - YM2608 hardware LFO rate[540] ((9-9)) 1. Disables YM2608's hardware LFO on all channels. 2. Enables YM2608's hardware LFO on all channels. '[o]x'[/o] = LFO rate Valid range for '[o]x'[/o] = 0 - 7 '[t[b2]##'[/t] '[o]freq'[/o] '[t[b2],'[/t] '[o]wave'[/o] '[t[b2],'[/t] '[o]pmd'[/o] '[t[b2],'[/t] '[o]amd'[/o] '[t[b2]#a'[/t] '[o]amd'[/o] '[t[b2]#f'[/t] '[o]freq'[/o] '[t[b2]#p'[/t] '[o]pmd'[/o] '[tab['[t[b2]#w'[/t] '[o]wave'[/o] - OPM hardware LFO settings[540] ((9-10)) 1. Expands to '[b]#f'[/b] '[o]freq'[/o], '[b]#w'[/b] '[o]wave'[/o], '[b]#p'[/b] '[o]pmd'[/o], '[b]#a'[/b] '[o]amd'[/o]. 2. '[o]freq'[/o] = Modulation frequency 3. '[o]wave'[/o] = Modulation wave shape If '[o]wave'[/o] = 0: Sawtooth If '[o]wave'[/o] = 1: Square If '[o]wave'[/o] = 2: Triangle If '[o]wave'[/o] = 3: Noise 4. '[o]pmd'[/o] = Pitch modulation depth Valid range for '[o]pmd'[/o] = -64 - 63 5. '[o]amd'[/o] = Amplitude modulation depth Valid range for '[o]amd'[/o] = 0 - 127 '[tab['[t[b2]#D'[/t] '[o]x'[/o] - FM hardware LFO delay setting[540] ((9-11)) If '[o]x'[/o] = 0-255: Number of ticks before hardware LFO begins If '[o]x'[/o] = '[b]l'[/b] '[o]duration'[/o]: Note value for for hardware LFO delay '[tab['[t[b2]@'[/t] '[o]x'[/o] '[o]fm-patch'[/o] - FM instrument definition[540] ((3-1)) '[o]x'[/o] = Instrument index Default, or if '[b]#DT2Flag off'[/b] (2-14) has been issued: '[o]fm-patch'[/o] = '[o]alg fb'[/o] ('[o]ar dr sr rr sl tl ks ml dt ams'[/o]) × 4 If OPM is used, or if '[b]#DT2Flag on'[/b] (2-14) has been issued: '[o]fm-patch'[/o] = '[o]alg fb'[/o] ('[o]ar dr sr rr sl tl ks ml dt dt2 ams'[/o]) × 4 If OPL is used: '[o]fm-patch'[/o] = '[o]alg fb'[/o] ('[o]ar dr rr sl tl ksl ml ksr egt vib am'[/o]) × 2 Note: Instrument parameters may be separated by whitespace, commas, or newlines. '[tab['[t[b2]@'[/t] '[o]x'[/o] - FM instrument setting[540] ((6-1-1)) '[o]x'[/o] = Instrument index Note: Not all instrument parameters might be written; see the notes for the '[b]s'[/b] command (6-2). '[tab['[t[b2]FB'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] - FM feedback setting[540] ((6-4)) '[o]x'[/o] = New feedback amount, replaces previous value '[o]±x'[/o] = Relative feedback amount, adds to current value Valid range for '[o]x'[/o] = 0 - 7 '[tab['[t[b2]H'[/t] '[o]pms'[/o] {'[t[b2],'[/t] '[o]ams'[/o] {'[t[b2],'[/t] '[o]delay'[/o]}} - FM hardware LFO settings[540] ((9-8)) If '[o]delay'[/o] is given, expands to '[b]H'[/b] '[o]pms'[/o]'[b],'[/b] '[o]ams'[/o] followed by '[b]#D'[/b] '[o]delay'[/o] (9-11). '[o]pms'[/o] = Pitch modulation depth for this channel '[o]ams'[/o] = Amplitude modulation depth for this channel Valid range for '[o]pms'[/o] = 0 - 7 Valid range for '[o]ams'[/o] = 0 - 3 '[tab['[t[b2]MM'[/t]'[o]-lfo'[/o] '[o]op-flag'[/o] - FM software LFO operator mask[540] ((9-4)) Pitch LFO: On FM channel 3 or one of the '[b]#FM3Extend'[/b] (2-20) channels: Apply pitch LFO to only operators enabled in '[o]op-flag'[/o] Otherwise: Always apply pitch LFO to all operators Volume LFO: If '[o]op-flag'[/o] = 0: Apply volume LFO to only carrier operators (default) If '[o]op-flag'[/o] = 1-15: Apply volume LFO to only operators enabled in '[o]op-flag'[/o] Note: Resets to the default settings on '[b]@'[/b] commands (6-1-1). '[t[b2]O'[/t] '[o]op-flag'[/o] '[t[b2],'[/t] '[o]x'[/o] '[tab['[t[b2]O'[/t] '[o]op-flag'[/o] '[t[b2],'[/t] '[o]±x'[/o] - FM operator level setting[540] ((6-3)) '[o]op-flag'[/o] = Operators whose TL values are nodified '[o]x'[/o] = New TL value, replaces previous value '[o]±x'[/o] = Relative TL value, adds to current value Valid range for '[o]x'[/o] = 0 - 127 '[tab['[t[b2]P'[/t] '[o]x'[/o] - OPM output setting[540] ((6-5)) If '[o]x'[/o] = 1: Output tone from OPM channel 8 operator 4 If '[o]x'[/o] = 2: Output noise from OPM channel 8 operator 4 '[tab['[t[b2]p'[/t] '[o]x'[/o] - FM panning[540] ((13-1)) If '[o]x'[/o] = 0: Output nothing '[o]x'[/o] + 1: Output to right channel '[o]x'[/o] + 2: Output to left channel '[tab['[t[b2]px'[/t] '[o]x'[/o] - FM panning (general)[540] ((13-2)) If '[o]x'[/o] > 0: Pan to left If '[o]x'[/o] = 0: Pan to middle If '[o]x'[/o] < 0: Pan to right Valid range for '[o]x'[/o] = -128 - 127 '[tab['[t[b2]s'[/t] '[o]op-flag'[/o] - FM operator mask[540] ((6-2)) Enables processing of the FM operators used in '[o]op-flag'[/o], and disables the rest. Note: Often used with the '[b]#FM3Extend'[/b] command (2-20). For all following '[b]@'[/b] (6-1-1) commands: - Only parameters for the enabled operators are overwritten - The algorithm type is overwritten - The feedback value is overwritten if operator 1 is enabled, which may also come from the '[b]FB'[/b] command (6-4) '[t[b2]sd'[/t] '[o]op-flag'[/o] '[t[b2],'[/t] '[o]x'[/o] '[tab['[t[b2]sdd'[/t] '[o]op-flag'[/o] '[t[b2],'[/t] '[o]x'[/o] - FM operator detune[540] ((7-2)) Adds an extra layer of detuning for each individual operator on top of the '[b]D'[/b] and '[b]DD'[/b] commands (7-1). '[b]sd'[/b] '[o]op-flag'[/o]'[b],'[/b] '[o]x'[/o] = Detune amount, replaces previous value '[b]sdd'[/b] '[o]op-flag'[/o]'[b],'[/b] '[o]x'[/o] = Relative detune amount, adds to current value Valid range for '[o]x'[/o] = -32768 - 32767 '[tab['[t[b2]sk'[/t] '[o]op-flag'[/o] '[t[b2],'[/t] '[o]x'[/o] - Operator delay[540] ((12-3)) If '[o]op-flag'[/o] = 0: Disable delay If '[o]op-flag'[/o] = 1-15: Delay note triggers on given operators by the given duration If '[o]x'[/o] = 0-255: Number of ticks to wait If '[o]x'[/o] = '[b]l'[/b] '[o]duration'[/o]: Note value for delay '[tab['[t[b2]w'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] - OPM noise pitch[540] ((6-6)) Sets the pitch of OPM channel 8 operator 4 when it produces a noise wave. '[o]x'[/o] = New noise pitch, 0 is highest, replaces previous value '[o]±x'[/o] = Relative noise pitch, adds to current value Valid range for '[o]x'[/o] = 0 - 31 '[#[SSG Commands] '[tab['[t[b2]@'[/t] '[o]'[/o] - SSG instrument preset[540] ((6-1-2)) On SSG channels only, expands to one of the predefined '[b]E'[/b] command (8-1-1) envelopes: '[b]@ 0'[/b]: '[b]E 0,0,0,0'[/b] '[b]@ 1'[/b]: '[b]E 2,-1,0,1'[/b] '[b]@ 2'[/b]: '[b]E 2,-2,0,1'[/b] '[b]@ 3'[/b]: '[b]E 2,-2,0,8'[/b] '[b]@ 4'[/b]: '[b]E 2,-1,24,1'[/b] '[b]@ 5'[/b]: '[b]E 2,-2,24,1'[/b] '[b]@ 6'[/b]: '[b]E 2,-2,4,1'[/b] '[b]@ 7'[/b]: '[b]E 2,1,0,1'[/b] '[b]@ 8'[/b]: '[b]E 1,2,0,1'[/b] '[b]@ 9'[/b]: '[b]E 1,2,24,1'[/b] '[tab['[t[b2]DX'[/t] '[o]x'[/o] - SSG pitch mode setting[540] ((7-3)) If '[o]x'[/o] = 0: Linear period offsets for the '[b]D'[/b] command (7-1) If '[o]x'[/o] = 1: Linear pitch mode where '[b]D244'[/b] corresponds to one semitone Note: The number 244 comes from 4096 × (2 ^ (1 ÷ 12) - 1). FM channels must use the '[b]B'[/b] (7-4) and '[b]I'[/b] (7-5) commands instead. '[tab['[t[b2]E'[/t] '[o]al'[/o] '[t[b2],'[/t] '[o]dd'[/o] '[t[b2],'[/t] '[o]sr'[/o] '[t[b2],'[/t] '[o]rr'[/o][540] ((8-1-1)) '[tab['[t[b2]E'[/t] '[o]ar'[/o] '[t[b2],'[/t] '[o]dr'[/o] '[t[b2],'[/t] '[o]sr'[/o] '[t[b2],'[/t] '[o]rr'[/o] '[t[b2],'[/t] '[o]sl'[/o] {'[t[b2],'[/t] '[o]at'[/o]} - SSG volume envelope setting[540] ((8-1-2)) 1. Uses a PMD-style volume envelope. '[o]al'[/o] = Attack length '[o]dd'[/o] = Decay depth '[o]sr'[/o] = Sustain rate '[o]rr'[/o] = Release rate valid range for '[o]dd'[/o] = -15 - 15 Equivalent MML volume sequence: (V is the channel volume, R is the channel volume on note release)'[c]V''[o]al'[/o] V-'[o]dd'[/o]''[o]sr'[/o] V-'[o]dd'[/o]-1''[o]sr'[/o] V-'[o]dd'[/o]-2''[o]sr'[/o] ... / R''[o]rr'[/o] R-1''[o]rr'[/o] R-2''[o]rr'[/o] ...'[/c] 2. Uses a FM-style volume envelope. '[o]ar'[/o] = Attack rate '[o]dr'[/o] = Decay rate '[o]sr'[/o] = Sustain rate '[o]rr'[/o] = Release rate '[o]sl'[/o] = Sustain level '[o]al'[/o] = Attack level (0 if omitted) Valid range for '[o]ar'[/o], '[o]dr'[/o], and '[o]sr'[/o] = 0 - 31 Valid range for '[o]rr'[/o], '[o]sl'[/o], and '[o]al'[/o] = 0 - 15 '[tab['[t[b2]EX'[/t] '[o]x'[/o] - SSG envelope speed mode setting[540] ((8-2)) If '[o]x'[/o] = 0: Volume envelope steps at same rate as ticks If '[o]x'[/o] = 1: Volume envelope steps at approximately 54.25 Hz Note: Although the manual says 56 Hz, the actual value is closer to 54.25 Hz which results from the highest possible TimerA value of the YM2608. '[tab['[t[b2]P'[/t] '[o]x'[/o] - SSG output setting[540] ((6-5)) If '[o]x'[/o] = 0: Output nothing '[o]x'[/o] + 1: Output square tone '[o]x'[/o] + 2: Output noise on this channel Note: PMD has no means of enabling the SSG's envelope generator on any channel. It is possible to use very limited forms of envelope modulation by using the '[b]y'[/b] command (15-1), e.g.: '[c]I y$A,$10 ; CH3 enable envelope'[/c]'[c]I y$5,$01 y$4,$40 y$7,$3B ; CH3 square tone output'[/c]'[c]I y$C,$00 y$B,$20 ; envelope period'[/c]'[c]I y$D,$0A r2 y$D,$8 r2 ; triangle then sawtooth'[/c]Any of PMD's own commands will possibly override the SSG envelope settings. '[tab['[t[b2]w'[/t] {'[t[b2]±'[/t]} '[o]x'[/o] - SSG noise pitch[540] ((6-6)) '[o]x'[/o] = New noise pitch, 0 is highest, replaces previous value '[o]±x'[/o] = Relative noise pitch, adds to current value Valid range for '[o]x'[/o] = 0 - 31 '[#[PCM Commands] '[tab['[t[b2]@'[/t] '[o]x'[/o] {'[t[b2],'[/t] '[o]begin'[/o] {'[t[b2],'[/t] '[o]end'[/o] {'[t[b2],'[/t] '[o]release'[/o]}}} - PCM sample setting[540] ((6-1-5)) '[o]begin'[/o] = Sample loop point (no looping if omitted) '[o]end'[/o] = End of sample loop (0 if omitted) If '[o]end'[/o] = 0: Use last sample as end of loop '[o]release'[/o] = Sample release point (-32768 if omitted) If '[o]release'[/o] = -32768: Disable release part Valid range for '[o]begin'[/o], '[o]end'[/o], and '[o]release'[/o] = -32768 - 32767 Note: Sample positions correspond to bytes for PCM samples, and units of 16 bytes for ADPCM samples. If any of the looped sample parameters is negative, the corresponding position is calculated from the end of the sample. '[tab['[t[b2]A'[/t] '[o]x'[/o] - PCM sample mode[540] ((15-10)) If '[o]x'[/o] = 0: Use samples as PCM If '[o]x'[/o] = 1: Use samples as ADPCM Note: This command can be used on any channel. '[tab['[t[b2]E'[/t] '[o]al'[/o] '[t[b2],'[/t] '[o]dd'[/o] '[t[b2],'[/t] '[o]sr'[/o] '[t[b2],'[/t] '[o]rr'[/o][540] ((8-1-1)) '[tab['[t[b2]E'[/t] '[o]ar'[/o] '[t[b2],'[/t] '[o]dr'[/o] '[t[b2],'[/t] '[o]sr'[/o] '[t[b2],'[/t] '[o]rr'[/o] '[t[b2],'[/t] '[o]sl'[/o] {'[t[b2],'[/t] '[o]at'[/o]} - PCM volume envelope setting[540] ((8-1-2)) Same as the SSG version. '[tab['[t[b2]EX'[/t] '[o]x'[/o] - PCM envelope speed mode setting[540] ((8-2)) Same as the SSG version. '[tab['[t[b2]p'[/t] '[o]x'[/o] - PCM panning[540] ((13-1)) If '[o]x'[/o] = 0: Output to both channels, enable surround sound If '[o]x'[/o] = 1: Output to right channel If '[o]x'[/o] = 2: Output to left channel If '[o]x'[/o] = 3: Output to both channels Note: Surround sound (invert phase on one of the stereo channels) is only supported on OPNA. '[tab['[t[b2]px'[/t] '[o]x'[/o] {'[t[b2],'[/t] '[o]y'[/o]} - PCM panning (general)[540] ((13-2)) On PPZ channels: If '[o]x'[/o] < 0: Pan to left If '[o]x'[/o] = 0: Pan to middle If '[o]x'[/o] > 0: Pan to right Valid range for '[o]x'[/o] = -4 - 4 On OPNA channels: If '[o]x'[/o] > 0: Pan to left If '[o]x'[/o] = 0: Pan to middle If '[o]x'[/o] < 0: Pan to right Valid range for '[o]x'[/o] = -128 - 127 If '[o]y'[/o] = 0: Normal output If '[o]y'[/o] = 1: Enable surround sound '[#[Rhythm Commands] Except for the '[b]@'[/b] (6-1-3) and '[b]R'[/b] (6-7) commands, all these commands may be used in either the rhythm channel or rhythm pseudo-channels. '[tab['[t[b2]*'[/t] '[o]x'[/o] - PDR driver flags[540] ((15-2)) Toggles one of the flags of the SSG 4-bit PCM driver. If '[o]x'[/o] = 0: Allow two PCM voices If '[o]x'[/o] = 1: Allow one PCM voice (default) If '[o]x'[/o] = 2: Play samples at 16 KHz If '[o]x'[/o] = 3: Resample output to 8 KHz If '[o]x'[/o] = 4: Enable interrupts from other background processes (default) If '[o]x'[/o] = 5: Disable interrupts from other background processes Note: Not all PMD players, '[u]including native players'[/u], support all of the options above. '[l[https://en.wikipedia.org/wiki/Terminate_and_stay_resident_program[Such background processes] are only relevant on native players. '[tab['[t[b2]@'[/t] '[o]x'[/o] - Rhythm instrument setting[540] ((6-1-3)) If '[o]x'[/o] = 0: Select none '[o]x'[/o] + 1: Bass kick '[o]x'[/o] + 2: Snare 1 '[o]x'[/o] + 4: Low tom '[o]x'[/o] + 8: Mid tom '[o]x'[/o] + 16: High tom '[o]x'[/o] + 32: Rimshot '[o]x'[/o] + 64: Snare 2 '[o]x'[/o] + 128: Closed hi-hat '[o]x'[/o] + 256: Open hi-hat '[o]x'[/o] + 512: Crash cymbal '[o]x'[/o] + 1024: Ride cymbal Note: The following user-defined samples are available if PPSDRV is enabled: (6-1-4) - '[o]x'[/o] + 2048 - '[o]x'[/o] + 4096 - '[o]x'[/o] + 8192 '[tab['[t[b2]R'[/t] '[o]x'[/o] - Rhythm pattern expansion[540] ((6-7)) Plays the contents of the rhythm pseudo-channel whose header is '[b]R'[/b]'[o]x'[/o] (1-2-1). Note: Unlike the '[b]!'[/b] command (16-1), this command is compiled into the output file, and is in fact the only way to produce rhythmic sound on the SSG channel (since note commands cannot be placed in the rhythm channel itself). '[t[b2]\'[/t]'[o]-perc'[/o] '[tab['[t[b2]\'[/t]'[o]-perc'[/o] '[t[b2]p'[/t] - Play YM2608 rhythm sample[540] ((14-1)) If '[b]p'[/b] is given: Halts given sample on the YM2608 rhythm channel If '[b]p'[/b] is omitted: Triggers given sample on the YM2608 rhythm channel Note: There must not be any whitespace between '[o]-perc'[/o] and '[b]p'[/b]. This command has no note values whatsoever; use rests if necessary. '[t[b2]\l'[/t]'[o]-perc'[/o] '[t[b2]\m'[/t]'[o]-perc'[/o] '[tab['[t[b2]\r'[/t]-perc'[/o] - YM2608 rhythm sample panning[540] ((14-4)) '[b]\l'[/b]: Pan to left '[b]\m'[/b]: Pan to middle '[b]\r'[/b]: Pan to right '[tab['[t[b2]\V'[/t] '[o]x'[/o] - YM2608 rhythm master volume[540] ((14-2)) Valid range for '[o]x'[/o] = 0 - 63 (default 48) '[tab['[t[b2]\v'[/t]'[o]-perc'[/o] {'[t[b2]±'[/t]} '[o]x'[/o] - YM2608 rhythm sample volume[540] ((14-3)) '[o]x'[/o] = absolute volume, replaces previous value '[o]±x'[/o] = relative volume amount, adds to current value Valid range for '[o]x'[/o] = 0 - 31 (default 15) Apart from the commands listed above, these commands may be used in all rhythm (pseudo-)channels: - '[b]l'[/b] (4-8) - '[b]C'[/b] (4-11) - '[b]v'[/b] (5-1) - '[b]V'[/b] (5-2) - '[b]v+ v-'[/b] (5-3) - '[b]( )'[/b] (5-5) - '[b][ : ]'[/b] (10-1) - '[b]L'[/b] (10-2) - '[b]t'[/b] (11-1) - '[b]T'[/b] (11-2) - All the miscellaneous commands as listed in the manual (15-*) - All the control commands (16-*) Notes may be used in rhythm pseudo-channels only, not in the rhythm channel itself. The compiled versions of tie and slur are unavailable. Volume commands work only if PPSDRV has been enabled. The raw SSG percussion instruments have no volume control. Several players allow mapping SSG percussion notes to the YM2608 rhythm channel automatically (such as FMPMD2000's "SSG+RHY" option). Their implementations might not utilize all of the PMD rhythm channel commands. '[#[Miscellaneous Commands] '[tab['[t[b2]N'[/t] '[o]x'[/o] - Play FM sound effect[540] ((15-5)) If '[o]x'[/o] = 0: Silence currently playing sound effect If '[o]x'[/o] = 1-255: Play sound effect at index '[o]x'[/o] Note: Defining FM sound effects requires EFC.EXE, which is unavailable in the freeware version of PMD. This command is only useful when PMD is used as an actual game music engine. '[tab['[t[b2]Z'[/t] '[o]x'[/o] - Measure duration[540] ((15-8)) '[o]x'[/o] = Number of ticks in a measure Note: This command does not affect the tempo of the compiled song, and is only useful for native PMD players supporting said feature. '[tab['[t[b2]n'[/t] '[o]x'[/o] - Play SSG sound effect[540] ((15-6)) If '[o]x'[/o] = 0: Silence currently playing sound effect If '[o]x'[/o] = 1-127: Play sound effect at index '[o]x'[/o] If '[o]x'[/o] = 128-255: Play SSG 4-bit PCM sound effect at index ('[o]x'[/o] - 128) Note: The first few indices correspond to PMD's own instruments for SSG channel 3 percussion. PMD only defines sound effects up to '[b]n'[/b] '[o]153'[/o]; any higher index might crash PMD players. This command is only useful when PMD is used as an actual game music engine. '[t[b2]~'[/t] '[o]x'[/o] '[tab['[t[b2]~'[/t] '[o]±x'[/o] - Write to Status1[540] ((15-9)) '[o]x'[/o] = New Status1 value, replaces previous value '[o]±x'[/o] = Relative Status1 value, adds to current value Note: Status1 is the name of a general-purpose byte variable in PMD. It has nothing to do with the read-only status flag with the same name on YM2608. '[#[MC.EXE Command Line Arguments] Usage: '[c]mc [option...] mml-file ff-file'[/c]'[c]mml-file: Name of input MML file, file extension may be omitted if ".MML"'[/c]'[c]ff-file: Name of extra FM patch bank, file extension may be omitted if ".FF"'[/c] The following options are available: - '[b]/V'[/b]: If ff-file is not provided, adds the FM instruments defined in mml-file to the output file. This is usually required. - '[b]/VW'[/b]: Overwrites the FM patches in ff-file with the definitions in mml-file (plus any changes to the PMD driver's FM patch memory if the sound driver is used directly). - '[b]/L'[/b]: Uses YM3526 / OPL, for IBM machines. - '[b]/M'[/b]: Uses YM2151 / OPM, for X68000 machines. - '[b]/N'[/b]: Uses YM2203 / OPN or YM2608 / OPNA, for NEC PC-x801 machines. This is the only default setting. - '[b]/T'[/b]: Uses YM2612 / OPN2, for FM Towns. '[u]FM Towns does not have an equivalent SSG chip like the Sega Genesis.'[/u] - '[b]/C'[/b]: Displays the song length and loop length of all used channels in number of ticks, unless the channel contains an infinite '[b][:]'[/b] loop (10-1). - '[b]/A'[/b]: If /P or /S is supplied, skips loading PCM samples before playing. - '[b]/O'[/b]: If /P or /S is supplied, skips loading the file's metadata into the player. - '[b]/P'[/b]: Plays the output file after compilation. Requires PMD.EXE. - '[b]/S'[/b]: Plays the compiled file without saving any files. Requires PMD.EXE. All files, input or output, are expected to have a file size within 64 KB. '[#[See Also] '[[Professional Music Driver (PMD)] '[[List of Effects Commands]