MML Reference

Global Setting

#opll_mode <0|1>
 0:FM 9 tracks
 1:FM 6 tracks+Rhythm track

#machine_id <0~7>
 1:Sony
 2:Panasonic
 3:SANYO

#lfo_mode <0|1>
 0:normal 1:fast

#title <"string">

#alloc <track no.=bytes,track no.=bytes,track no.=bytes...>
 buffer size per track

#psg_tune { c,c# .... b }

#opll_tune { c,c# .... b }

#tempo <57~2047>

#macro_offset <name = no>

#end

Macro definition

*<0~255> = { string }

Voice definition

@e<number> = { Mode,Noise,data...data }
 number: Voice number 0~31
 (1)Mode
  0 ... none
  1 ... tone only(default)
  2 ... noise only
  3 ... tone and noize
 (2)Noise
  noise frequency
 (3)Data
  envelope data
   Volume : count ... 2~239
   Volume = count ... 2~239
   n<noise frequency>
   /<mode> *<mode>
   [~] ... repeat
   @<Voice number>
   y<r>,<d> ... write d to register r
   \<-127~127> ...
   .,

@r<number> = { Mode,Noise,AL,AR,DR,SL,SR,RR }
  Mode ... 
  Noise ...
  AL ..... attack level
  AR ..... attack rate
  DR ..... delay rate
  SL ..... sustain level
  SR ..... sustain rate
  RR ..... release rate

@s<number> = { data1 .... data32 }
  voice of SCC

@v<number> = { data ... }
  voice of OPLL

@#<number> = <n>

Music

<track no.> <notes>
 track no.
  opll_mode 0
   1~3 ... PSG
   4~8 ... SCC
   9~h ... FM
  opll_mode 1
   1~3 ... PSG
   4~8 ... SCC
   9~e ... FM
   f(r)... Rhythm

 notes
  t<n> ... tempo, 57~2047(default:120)
  l<n> ... note length, 1~192 (default:4)
  ^<n> ... ties
  & ... slur
  q<n> ... length ratio, 0~8 (default:8)
  v<n> ... volume, 0~15(default:0)
  v+|-<n> ... change volume
  )<n> ... volume up
  (<n> ... volume down
  v<rhythm instrument><n> ... rhythm instrument volume in rhythm track, 0~15
  v<rhythm instrument>+|-<n> ... change instrument rhythm volume, 0~15
  k<n> ... fade out speed in PSG or SSC, 0~255(default:0)
  @<n> ... change voice
  @e<n> ... copy voice data
  @r<n> ... copy voice data
  m<n> ... envelope frequency in PSG, 1~65535
  s<n> ... envelope shape in PSG, 0~15
  n<n> ... noise in PSG, 0~31
  o<n> ... octave, 1~8(default:4)
  > ... octabe up
  < ... octabe down
  a~g<+,-><n> ... musical notes
  _ ... change smooth
  r ... rests
  <rhythm instrument><:> ... bsmhc
  \<n> ... detune, -127~127(default:0)
  @\<n> ... detune details, -32768~32767(PSG, SSC), 0~255(FM)
  p<n> ... volume down in PSG or SSC, 0~255
  h<n1>,<n2>,<n3>,<n4> ... LFO
   n1: delay(0~255)
   n2: depth(0~127)
   n3: speed(0~255)
   n4: roughness(-127~127)
  @p<n>	... LFO details, -32768~32767
  ho ... start LFO
  hf ... stop LFO
  hi ... initialize LFO
  [<count>~]; ... repeat, 0~255(0: endless, default:2)
  [~]<count> ... repeat, 0~255(0: endless, default:2)
  | ... out of the repeat
  so ... sustain on in FM
  sf ... sustain off in FM (default)
  ko ... do not stop the sound(in rhythm) (default)
  kf ... stop the sound(in rhythm)
  /<n> ... key off
  y<n1>,<n2> ... write n1 to register n2,
                 n1 FM:0~56 PSG:0~15
                 n2 0~255
  @l<n> ... change total level in OPLL
  *<n> ... call macro(0~255)
  ! ... ignore the MML after this
  @m<n> ... call the control string
  @o<n> ... offset of the control string
  @f ... increment <fadefg> of MIB
  $ ... debug command

Voice number
0 Violin
1 Guitar
2 Piano
3 Flute
4 Clarinet
5 Oboe
6 Trumpet
7 Organ
8 Horn
9 Synth
10 Harpsichord
11 Vibraphone
12 Synth bass
13 Wood base
14 Electric base

Hint
  • Alloc When the MML file is compiled, the size of each track is displayed. track : 9 ( 1016) ( 165) ( 851) (reserved bytes) (used bytes) (remaining bytes) This information can be used to adjust the reserved size in "#alloc".
  • Tempo compatibility Because MSGDRV operates for MSX in 60hz, the tempo needs to be multiplied by 1.2 in 50hz.

  • back