Skip to main content
Topic: A question on writing a new itree file (Read 4674 times) previous topic - next topic

A question on writing a new itree file

Morning All;
   I am attempting to write an itree file for the CHAOS8M sound font and am having a small problem. I have used Rick's excellent little script to dump the sf2 file, but am having trouble trying to derive the proper values for the MSB and LSB arguments for the BANK(mmm,nnn) property.
   Any light that y'all can shed would be greatly appreciated.

Regards
Keith
Illigitimi Non Carborundum

Re: A question on writing a new itree file

Reply #1
G'day Keith,
as near as I can tell, Ricks script is reporting only the LSB information.  The stuff at bank 128 is what's used on channel 10 for percussion.

So, while I haven't tested it to confirm, the bank information would be 0,nnn where nnn = the bank as reported by Ricks script.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: A question on writing a new itree file

Reply #2
as near as I can tell, Ricks script is reporting only the LSB information.
Actually, I am reporting the right 3 digits of values in the range from 0 - 65535.
This should suffice for any normally constructed soundfont.
Valid banks range from 0 - 128 and valid patches range from 0 - 127

You can display the entire range by changing:
Quote from: sf.vbs
  a(1) = Right("00" & cvii(tso.Read(2)), 3)
  a(0) = Right("00" & cvii(tso.Read(2)), 3)
to:
Quote
  a(1) = Right("0000" & cvii(tso.Read(2)), 5)
  a(0) = Right("0000" & cvii(tso.Read(2)), 5)

I am no expert on how to construct itrees, but I believe that my utility provides all the info about a soundfount needed to construct a full itree. My AWE32 limits me to 8mb soundfonts and I lack the horsepower to use SynthFont on all but trivial examples.
Registered user since 1996

Re: A question on writing a new itree file

Reply #3
Evening All;
   Tried a bit of experimentation based on both your replies. As expected when I changed the script file per Rick's instructions it reported the Bank and Patch as 5 sigits rather than 3 for this sf2 file it simply added leading 0's. May try it on a more complex file just to see the possible results. Rick as usual your script works flawlessly and your instructions to change it were succinct and accurate.
   I tested Lawrie's hypotheses by constructing a test itree file with 3 entries. One as Acoustic piano on patch 0 with no Bank(mmm,nnn) statement. One with a detuned EPS on patch 5 and bank 8 with Bank(0,8) and finally one the exact reverse with Bank(8,0). I than played a short section of an nwc file with each definition. As a baseline of what the detuned EPS would sound like I used the Creative Font Bank manager's on screen keyboard to approximate what the section played in nwc should sound like as far as tone and timbre.The winner of this decidedly short test was the construct of Bank(8,0) rather than Lawrie's proposed Bank(0,8).
   I will continue to conduct this same experiment on random instruments and effects as I go along. For know I am going to proceed with the winning construct from my first test. Will continue to report back as it becomes clearer. Thank you both for your insights and encouragement.

Regards
Keith

PS
   Just for my own edification, can someone explain what MSB & LSB actually are and do in this context. Thanks and TTFN.
Illigitimi Non Carborundum

Re: A question on writing a new itree file

Reply #4
MSB - Most Significant Byte
LSB - Least Significant Byte

Together they form a 14 bit number capable of addressing 16383 different banks!!

On Creative cards only the MSB is used.
The value is entered through Controller 0 (Bank Select coarse).

Other cards (such as Yamaha XG) also make use of Bank Select fine (Controller 32).
MSB selects Voice Type (Normal, SFX, Drums) and the LSB selects the voice Banks.

A Bank Select message has no effect until followed by a Program (Patch) Change message.

----------------
Barry Graham
Melbourne, Australia


Re: A question on writing a new itree file

Reply #5
Good Evening Barry;
   Thank you very much for the succinct and clear explanation. I suspected that they were Most and Least Significant, but was struggling as to how they were applied.

Regards
Keith
Illigitimi Non Carborundum

Re: A question on writing a new itree file

Reply #6
G'day all,
been doin' some reading and found this in a linux audio forum:
Quote
According to midi standard the bank number is (LSB + 128 * MSB)

and an excerpt from Wikipedia:
Quote
GS extensions
Main article: Roland GS

The first GM synthesizer in the Roland Sound Canvas line included a set of proprietary extensions to General MIDI standard. The most notable addition was the ability to address multiple banks of programs (instrument sounds) by using an additional pair of Bank Select controllers to specify up to 65536 'variation' sounds (cc#0 is Bank Select MSB, and cc#32 is Bank Select LSB).

Other most notable features were 9 Drum kits with 14 additional drum sounds each, Control Change messages for controlling the send level of sound effect blocks (cc#91-94), entering additional parameters (cc#98-101), portamento, sostenuto, soft pedal (cc#65-67), and model-specific SysEx messages for setting various parameters of the synth engine.

I suspect this article is in error RE "up to 65536 'variation' sounds" as the spec specifically agrees with Barry's statement about using 14 bits, not 16.  This makes sense as 0-127 is only 7 bits and the maximum range for both the MSB and LSB controllers is 0-127.

more info available here:
http://www.midi.org/techspecs/midispec.php
http://www.midi.org/techspecs/midimessages.php
http://home.roadrunner.com/~jgglatt/tech/midispec.htm (click on the "Bank Select" link)

So, if Rick's tool reports in the range 0 to 65535 then you have a modulo of 128 to define the MSB and LSB numbers thus:
Divide the derived number by 128 and take the integer portion as your MSB.  Multply 128 by the MSB number just determined and subtract the result from the original number.  This difference will be the LSB (zero based)...  *Sometimes...

E.G.
  • Number from Ricks tool = 593
  • Divide 593 by 128 = 4.6328125
  • Take the Integer portion as the MSB = 4
  • Then subtract the MSB * 128 from the original number for to get the LSB
  • LSB = (593 - (128 * 4)) = 81

I think I got the math right...  Ricks tool reports the bank data as 0 based so I don't need to allow for that in the above exercise.

*It seems that some synths only use MSB in lieu of LSB for basic bank select...  You may need to experiment to determine your exact requirements.

<edit> Corrections in italics
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.