Moonblaster file format
This page was last modified 11:28, 30 March 2018 by Grauw. Based on work by Mars2000you and Huey and others.
MoonBlaster 1.4
			       [Moonsoft, Sunrise]

       Ext.name:   *.MBM (User file!)
       Length:	   Variable (min $0180 bytes)
       Type:	   Data
       Contains:   Music settings etc., pattern data

       > Case: Memory Offsets
       Offset Length  Description
       -----+--------+----------------------------------------------------
       $0000  3       Song Length + ID
       $0003 16*9     Voice data MSX-AUDIO (incl. volume)
       $0093 16       Instrument list MSX-AUDIO
       $00A3 32       Instrument/Volume list MSX-MUSIC
		      (Instr: 1-15:Hardware, 16-22:Original)
       $00C3 10       Channel chip set.
       $00CD 01       Start tempo
       $00CE 01       Sustain MSX-AUDIO
       $00CF 41       Track name
       $00F8 09       Start instruments MSX-AUDIO
       $0101 09       Start instruments MSX-MUSIC
       $010A 6*8      MSX-MUSIC original instrument OPL data (6xOPL)
       $013A 06       ,,  ,,	,,	 ,,	    prog.number.
       $0140 08       Sample-Kit name
       $0148 15       Drum set-up MSX-MUSIC/PSG
       $0157 03       Drum volumes MSX-MUSIC
       $015A 20       Drum frequencies MSX-MUSIC
       $016E 09       Start detune
       $0177 01       Loop position
       $0178 snglen   Position table
       $0xxx hipat*2  Pattern Address table
       $0xxx ..       Pattern data

       > Case: Pattern data, Music channels
	 offsets: 00-08   
       Data    Description
       -------+-----------------------------------------------------------
       000     Empty
       001-096 Note (data/12=octave, rest is note)
       097     Note OFF
       098-113 Instrument change
       114-176 Volume change
       177-179 Stereo set
       180-198 Note LINK
       199-217 Pitch
       218-223 Brightnes negative
       224-230 (de-)Tune
       231-236 Brightnes positive
       237     Sustain
       238     Modulation (Frequency!)
       237-242 Free
       243-255 Crunched Line data (Empty steps)

       Link:   180 -> L-9
	       189 -> L+0
	       198 -> L+9
       Pitch:  199 -> P-9
	       208 -> P+0
	       217 -> P+9
       (de)tune: 224 -> T-3
	       227 -> T+0
	       230 -> T+3



       > Case: Pattern data, Command channel
       Data    Description
       -------+-----------------------------------------------------------
       000     Empty
       001-023 Change Tempo
       024 End Of Pattern
       025-027 Change Drumset MSX-MUSIC
       028-039 Set status-byte
       049-... Transpose


       > Case: Channel buffer, at replayer
       IY+00   Note nr.
	 +01   MSX-AUDIO frequency
	 +03   MSX-MUSIC frequency
	 +05   .
	 +06   Frequency mode: 0, normal. 1, pitch. 2, modulation
	 +07   .
	 +09   Tuning
	 +0A   Instrument
	 +0B   .
	 +0E   Pitch value
	 +0F   ,,    ,,     0, positive. -1, negative.
	 +10   MSX-AUDIO original frequency
	 +12   MSX-MUSIC ,,	  ,,
	 +14   MSX-AUDIO brightness
	 +15   .
	 +16   MSX-AUDIO volume
	 +17   .
	 +18   Value of last OPL register (MSX-AUDIO)


       Ext.name:   *.MBK (Sample Kit)
       Length:	   56 bytes (hdr) + 32k. ADPCM data
       Type:	   Data
       Contains:   Sample start addresses and ADPCM samples

       These  are the  so called  DRUMKITS for moonblaster. Other than the 
       Sountracker files, these are a 32kB file (excl. header).

       header:
       00-56	   Sample start address (16 bit per sample, 14 samps)
       data:
       57-xxxx	   ADPCM data

       In version 1.4 the files are always 56+32k bytes long!
       (a standard 32k ADPCM file)