Re: [yoshimi-user] An exciting discovery! - further thoughts.

  • From: Will J Godfrey <WillGodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi-user@xxxxxxxxxxxxxxxxxxxxx
  • Date: Sun, 14 Oct 2012 19:41:54 +0100

I think I now understand why Cal went for the DB idea (that Mark was so hostile
to).

Hyper Matrix is 580k of xml, whereas simple voices are around 5k. Before doing
anything else, all that xml has to be parsed - which is obviously going to take
a finite time.

Also, for MIDI controls to work efficiently, you either need to parse the
filenames or have the files in each bank to be strictly in numerical order, with
no gaps - no prizes for guessing which will be faster! Also, of course, to be
MIDI compatible you can only have 128 voices per bank.

Th DB does away with all of these problems, but creates problems of its own.

What I would like to propose is to use a variant of the python method of code
speed-up.

When yoshimi starts up, it should scan through the banks looking for voices
with prefixes from 1 to 128. Each time it finds one it should decode it to a
'byte code' and store it as a simple number (but starting from zero). For any
gaps it should generate the basic voice in order to keep a full list. Sorry,
but any numbers above 128 should be ignored.

So:
0004-Muffled Bells.xiz
0010-Metal Sweep.xiz
....

becomes:

00 {basic}
01 {basic}
02 {basic}
03 {muffled bells}
04 {basic}
05 {basic}
06 {basic}
07 {basic}
08 {basic}
09 {metal sweep}
....

In order to be able to see the voice names, I would guess it would be simplest
to bed these at the start of the new bytecode as fixed length strings (padded
with trailing zeros).

When a voice is called for, you simply have to load the file with the MIDI
value! You never have to check that the voice is actually there or is the right
one.

Editing voices would be done exactly as before, and when saving, you would save
to the xml format and the new bytecode format - overwriting any basic voices
when creating new ones. This maintains compatibility with older versions of
yoshimi and also with zyn, as they will both ignore files with no suffix.

Finally, when you manually load voices either through the instrument window or
by loading a parameter bank, you do so exactly as you do now - time is not an
issue under these circumstances. Also, you can then get to the voices from 129 -
160.

Phew!
Ideas?
Good?
Bad?

--
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


Other related posts: