NRTDRV MAN EN SYNTAX DRIVERMACROD

From MSX MUSIC WIKI
Jump to: navigation, search

Driver macros

!<str> YOURMML(for OPM)

?<str> YOURMML(for PSG)

This is macro function which driver itself has and successively processed. It is useful to save data size because it can store MMLs in it like valuable of character. Defined macros are used unlimited times in the data.

<str> is macro name. Max 255 characters of alphabets and numbers can be used. It is case sensitive and different name between capital and small character are treated as other macros.

Error occurs when undefined macro is used.

[sample]
       !Melo l8c4de fgab >c1
       A !Melo    ;Plays "l8c4defgab>c1" in track A.
       A !melo    ;Error (capital and small characters are different)

Repeat should complete within a driver macro. It cannot be specified what jump over inside or outside of driver macro.

Endless loop is not availablr

Driver macro cannot load other macros.

Settings such as default note of OPM/PSG tracks, octave, volume are not succeeded in driver macros.

Values in driver macro and in OPM/PSG tracks are not effected vice versa and are applied defaults. Be carefull if you use l, v, V, VOP, o, < and > commands.

[sample]
       !B @0c8
       !S @1b8
       !T @2aaaa
       !X @3g2
       A !B:r8!S:r8!B!B!S!B
       ;Same as "@0c8r8@1b8r8@0c8@0c8@1b8@0c8"
       A !B4 !S4 !B8 !B8 !S8 !B8

Error ("B4" or "S4" macro are not defined.)

       B l16aaa8[!T]a8aa
       ;Not same as "l16aaa8[@2aaaa]a8aa" but "l16aaa8[l4@2aaaa]l16a8aa"
       C o5!X d4a4
       ;Not same as "o5@3g2d4a4 "but as "o4@3g2o5d4a4"

Macro names of OPM and PSG are common, so define identical names. For example, "!hoge" and "?hoge" cannot be defined at a time.

[sample]

?FUGA cde
1 ?FUGA ; Plays "cde" in track 1.
A ?FUGA ;Error (because PSG macro is called in OPM track).

If you want to write multiple lines of MML, enclose with "{" and "}". Line feeding is available in area from "{" to "}" .

[sample]

!hoge { v15 l8
        o4 cdefgab>c^1
}

Strings just before character which cannot be used in macro names are recognized as a macro name. Some times error occurs when macro name and MML are convined. Insert separate signs like space, tab or colon to avoid such error.

[example]

A !hogea1&a2   ;NG: Macro name is recognized as "!hogea1". It might cause error.
A !hoge:a1&a2  ;OK: Macro name is recognized as "!hoge". Colon is treated as same as space.

[note from wiki editor] "FUGA" and "HOGE" are (funny) jargon which expresses nothing in Japanese, like "BLA" in English.