Ŀ
                            the .SBM(*) format 
                           

This file fill explain how the SCC-BLAFFER NT music files are build up...

[$000..$00F] -  16 bytes - Init bytes (Blaf NT Song    )
[$010..$052] -  67 bytes - Song name
[$053..$05D] -  11 bytes - Instrument kit name
[$05E..$05E] -   1 byte  - Last Position
[$05F..$060] -   2 bytes - Loop Position
[$061..$160] - 256 bytes - Patterns to play
[$161..$161] -   1 byte  - Initial Tempo
[$162..$166] -   5 bytes - Start volumes
[$167..$16B] -   4 bytes - Start instruments
[$16C..$170] -   5 bytes - Detune Settings
[$170..$174] -   5 bytes - Auto volume slide settings
[$175..$1CF] -  91 bytes - Future expansions
[$1D0..$1D0] -   1 byte  - Number of patterns stored
[$1D1..$???] - ??? bytes - Pattern data

Some explinations:

The init bytes are ofcourse to reconize the song when it's loaded. The song
name is also clear, the instrument kit has 11 characters, because the
extension is also saved with the kit. This is (ofcourse) done because you
can load files with another extension then the original in SCC-Blaffer NT.
The last position is also clear, the loop position has two bytes, because you
can loop from position 0 till position 255, and you can set the loop position
OFF. The first byte determines wheter to loop or not. If the first byte is
zero, then there's a loop position, else the loop position is OFF. Patterns
to play are the patterns to play at the positions. The initial tempo is clear,
the start instruments only have four bytes, that's (ofcourse) because of the
fact channel 5 hasn't got it's own instrument (it uses the instrument of
channel 4). Detune settings is clear, also as the auto volume slide settings.
The future expansions data is empty data, and may be used in future versions
of Blaffer NT. This is done to keep the loading of a song in future versions
simple.

A pattern is build as follows:

The fisrt 2 bytes contain the address where to store the pattern. After those
2 bytes, the pattern data comes. The pattern data is build as follows:

16 rows * ((5 channels * 2 bytes) + 2 bytes).

5 channels of 2 bytes is clear, the 2 bytes after that are the PSG channel
value, and the command channel value. So a pattern has 16*12 bytes = 192
bytes, plus the 2 pointer bytes, that's in total 194 bytes.

Now you might say hey!, why do you use a pointer to store an pattern?? Well,
that's quite simple. When a song has eg. 2 positions (last position = 1) and
on the first position you use pattern 0, and at the second you use pattern
82, and I use the way to store a song like this: Save the song from pattern
0 till the highest pattern used, then the song is like way large, and pattern
1 till 81 are not in use! So when I store the patterns that are used, (0 and
82) then I only have to store 2 patterns, but only the addresses won't be
correct, so that's why the address as a pointer is stored (got it??)...

So a song is always
16+67+11+1+2+256+1+5+4+5+5+1+91+((number of patterns used)*194) bytes large.

In this way a song can be exactly 16567 bytes large. Well, that won't fit in
the momory bank (16384 bytes), you might say. Yep, that won't fit, but check
this: The addresses of the patterns are only stored in the song, they won't
be stored in RAM, so we get rid of 166 bytes. Well 16597-166=16401. And the
Number of patterns byte doesn't have to be stored, so 16401-1=16400, and the
song-header doesn't have to be stored either, so 16400-16=16384 bytes! And
that *will* fit in 1 memory bank! (smart huh?) Blue Crystal: Oh, d-fader,
you're so smart... (NOT!)

In ML use these bytes to read some info..

MusicAddress            .equ $8000
SongName                .equ MusicAddress
InsKitName              .equ SongName+67
LastPos                 .equ InsKitName+11
LoopPos                 .equ LastPos+1
Patterns                .equ LoopPos+2
InitialTempo            .equ Patterns+256
StartVolumes            .equ InitialTempo+1
StartInstruments        .equ StartVolumes+5
DetuneSettings          .equ StartInstruments+4
VolumeSlideSettings     .equ DetuneSettings+5
PatternData             .equ MusicAddress+448

Well, this is it...

mzl.
d-fader of TwZ..

* .SBM means teddywarez 'S'cc 'B'laffer nt 'M'usic


(and one last note: d-fader is *NOT* darth fader from Star Wars or so.. It's
because in the past I always made fades.. (I love 'em!) and 'the fader' is a
stupid name, so d-fader is the result..)


HeXx: Always talkin' crap, the fader!
d-fader: d-fader!!!
HeXx: yeah, whatever..
DJ Chaos: My name is Chaos, because d-fader always has such a mess in his
          room!

HeXx and d-fader: SHUT UP!! working in a mess is relaxed.. (no echo's!)

Blue Crystal: <SIGH!>, can you guys believe what I must go through, me and
              my huge brain. Ahwell, maybe they'll eventually grow up.

HeXx: huge brain??

Blue Crystal: Oh, sorry, I said huge?? Well, ofcourse I meant massive...

HeXx: Oh, Ok, hey d-fader??

d-fader: Yeah, What up??

HeXx: What massive mean??

d-fader: Eeh, I donno, something like a cow who gives blue milk??

Blue Crystal: Please, someone, get me outta here!

DJ. Chaos: Ok.. Let's go to McDonalds! There I always get a nice toy with
           my happy meal (tm, c, r, and all those other thingies)!!

Blue Crystal: <very, Very, VERY big sigh>....

d-fader: What up Blue crystal?? Feeling sleepy??

Blue Crystal's brain: Oh my god, what a dumm-asses!!

* .SBM means Scc Blaffer nt Music
  .SBK means Scc Blaffer nt Instrument Kit
  .SBS means Scc Blaffer nt SCC Instrument
  .SBP means Scc Blaffer nt PSG Instrument









[EOF]






hmm.. there's no more!











darn.. go away...










5







4







3







2







1
end.