MBM file format

Door Sky_hawk

Champion (267)

afbeelding van Sky_hawk

26-07-2004, 19:27

I'm looking for the description of the mbm file format.
Does anyone know where to find it ?

So far I've found:

- the source of moonblaster 1.4 (thankx to marcel delorme), it's possible to determine the file format from this ml-source, but looking at it, it looks like files are saved exacly like their are stored in memory, so the exact format is not easy to make out.

- the sources of a mbm2kss converter, (http://nezplug.sourceforge.net) but it uses a mbm-replayer
(MOONBLASTER REPLAY ROUTINE v1.43 by W. Brants (c) 1992/1993)

Does anyone know how to contact him or have any other suggestions?

Aangemeld of registreer om reacties te plaatsen

Van Sonic_aka_T

Enlighted (4130)

afbeelding van Sonic_aka_T

26-07-2004, 20:50

Try MiLC, I think it had some info there. You can probably get the most info by decyphering the replayer and checking what data is played every interrupt. Try checking out MB's play-buffer while playing a song. Short that with the info you get from the source and you should be able to find out how it works.

Van ro

Scribe (4902)

afbeelding van ro

26-07-2004, 21:08

I recently copied all my MSX data files to PC and here ya go.. I once made a Fileformat library file where I included MBM too.
have fun.

--------------------

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)

Van Sky_hawk

Champion (267)

afbeelding van Sky_hawk

26-07-2004, 22:49

Many thanks!

This will make my job a lot easier Smile

Did you by any change every do anything with this info yourself ?
like writing a program that reads or writes such a file?
If so i'd still like the source...

Van ro

Scribe (4902)

afbeelding van ro

26-07-2004, 22:51

Yeah, I used it to convert MBM tunes to ORC tunes for example. And I've done some heavy work on rewriting some pieces to make it a bit faster (done that while coding the f-kernel which has MBM for it's main music driver)

what source ya need?

Van Sky_hawk

Champion (267)

afbeelding van Sky_hawk

29-07-2004, 00:36

Well, your mbm-spec isnt't very complete (but it was very helpfull!)
for instance is does not list how notes are calculated
( notebyte = octave*12 + note)
or how crunched data is saved
(f3 = empty note)
(fe = 1 note, rest of position empty)
etc..
(ff = empty position)

also, edit-saved mbm's start with a leading "FF" in the header and have extra (unused pattern) information in them.

I've found out much more about the format, and i'm able to write mbm-files myself now, but I'll add my found information to the document and post it here when i'm done.

However, if you do know more about to format than what you've told me sofar, i'm still interested...

Thanks for you help..

Van ro

Scribe (4902)

afbeelding van ro

29-07-2004, 09:04

Sky, the notebyte is something that needs no explenation.. it's just 96 notes in a row.

The format clearly states "user" files, so indeed there's some missing info on the "edit" files.

The crunch data type is just when empty steps occure (per row).
243=1 step emtpy
244=2 steps empty
245=3.. etc

It's not indepth info about data/replay, just file format. But feel free to add some notes and stuff!
so, euh. what's ya using it for?

Van Huey

Prophet (2694)

afbeelding van Huey

20-12-2011, 14:51

@Ro; Is it OK if I submit this stuff in the MSX WIKI?

Van wolf_

Ambassador_ (10088)

afbeelding van wolf_

20-12-2011, 15:34

If it was up to me: this is exactly why the wiki was made: handy info all in one place, all in one interface, with tags 'n stuff.

Van Retrofan

Paragon (1339)

afbeelding van Retrofan

20-12-2011, 17:17

And please also add information for the MBWAVE and MBFM format.