[about music]

>Don't forget the speed issue. In fact, MBWAVE-files are very badly
>organizes. For example, the note is stored in the file, while it would
>be way better if the frequency was stored in the file. This would
>greatly reduce the replayer-size and result in a huge speed-up.

?? I don't get that. I'm not really familiar with the format of
the MWM files or programming the MoonSound, but assuming that it's
similar to that of MBM/FM-PAC I don't see the big difference.
The difference is one (1!) look-up in a table per note played
to convert notenumber to freq.  That's not a big deal...

Because those can be shared. Palette-settings are quite specific to the
characterset though. It is easier and more logical to store it with the
patterndata. Otherwise the filename of the belonging palette has to be
stored and it has to be loaded seperately. Much more trouble for the
same result. And your directory will be flooded with .PAL-files.


> I remembered programs I made in the past and I noticed that I almost
> never
>
> Hmmm... run-lenght??? Good idea.

Run-length or even some more advanced pattern based compression.
I once implemented this compressed gfx fileformat:

     1 byte:  repeat
     1 byte:  pattern length
     n bytes: pattern

a pattern consists of max. 256 bytes (0 = 256) which is repeated a couple
of times.  The first byte used a simple trick: if the highest bit was 1,
it meant that the last pattern had to be repeated.  The other 7 bits
indicated the nr of times the patern had to be repeated (0 = 128)
So, you could squeeze a block of 512 bytes of 0-s into 6 bytes:

     #00 1 0 #10 #10 #10
              ^^^^^^^^^^^ repeat this pattern 3 x 128 times
            ^------------ 1 byte of data :-)
          ^-------------- pattern length: 1
       ^----------------- repeat new pattern 128 times

Writing the decoder is a piece of cake and it will be fast.
The compressor was a bit more trickier and slow, but that's not
important...

Alternatively you could use the compressor/decompressor of
Final Video Graphics (FVG) - sources should be on the 'net somewhere.
I/we/Aurora (*grin*) used that to compress the GFX for EXOR and Ruby&Jade
but I lost almost all my sources for those games, damn!

Ciao,
     Eric



****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED]
and put "unsubscribe msx [EMAIL PROTECTED]" (without the quotes) in
the body (not the subject) of the message.
Problems? contact [EMAIL PROTECTED]
More information on MSX can be found in the following places:
 The MSX faq: http://www.faq.msxnet.org/
 The MSX newsgroup: comp.sys.msx
 The MSX IRC channel: #MSX on Undernet
****

Reply via email to