Using the "kaanalyz" program

by Michael Hester
March 03, 2003



The kaanalyz program was apparently originally conceived and written by Chris Dalton who produced a basic working version, and was then completely re-written and expanded by Jens Groh.
The concept is simple: to read a Kawai K5000 ".KAA" bank dump file and create a listing of the patches that the bank contains. Also to report on how much memory is in use within that bank.
Additionally, the program has the capability to "split" a bank dump into individual ".KA1" patch files---just like the "KAAtoKA1" program.

Why use it?

Most importantly, in a word: memory management (Okay, that's two words).
The program is extremely useful in showing how many additive ("A") and/or PCM sources ("P") make up the patches stored in the memory bank, and how many bytes of memory each patch occupies. There is quite a difference between the smallest size patch (254 bytes) versus the largest (5434); almost twenty-one times larger!
By being able to see which patches in your memory banks are the "greedy" ones---using up a lot of memory, you can scrutinize them carefully. Any big patches that you don't like---and think that you will probably never use---can be archived onto disk and then deleted; freeing up a lot of space for storing other patches.
Ease of Auditioning: The printed listings are an almost indispensable tool for auditioning new patches without getting the dreaded "out of memory" error.
Documentation of bank dump files on floppies: The listings provide documentation of what patches are in a bank dump file. Sounds obvious; but very handy if you are frequently shuffling banks in and out of memory on the K5000. Just keep the listings with the floppy diskettes, and come up with a good naming system of your own for your bank dump files.
Searching out examples to learn from: The listings by type of sources or by number of sources can help you when working with on-screen computer editors to select patches to learn from and modify.
Splitting banks apart: A very useful feature is to be able to split a bank dump into it's individual patches so that you can load only the ones you are interested in. (Note that the "KA1TOKAA" program written by Yasuhiro Iwamoto allows you to "assemble" a new bank file (".KAA") from a group of ".KA1" patch files.)
The kaanalyz program has six options for printing listings, of which I primarily use two: list patches by patch number, and list patches by size.

A remark by the author of the program, Jens Groh:
No warranty - use the software at your own risk!

Downloading the zip file:

When you download the kaanalyz.zip file and unzip it, it should create two sub-directories named: "1.0" and "1.1".
The "1.0" subdirectory contains the "C" source code and executable program for Unix/Linux systems. Within it will be "kaanalyz.c"---the source code, and "kaanalyz"---the executable binary program.
The "1.1" directory will contain the "C" source code "KAANALYZ.C", and the executable "KAANALYZ.EXE" for Windows/DOS systems. Also a KAANALYZ.BAT file which seems to have to do with running the program on DOS systems. The one from Jens looks like it moves into a program directory and runs the program for him specifying certain options. You will have to modify this to meet your own needs.
Note that the source code is essentially identical, er, well, almost, 1.1 has an additional feature: looks like it can "convert" a bank file so that it creates a new bank file; use an "A" bank file to create a new "D" bank file for example. This is a guess based on what I have seen inside the version 1.1 source code. But either one can be made to compile and run on Unix or DOS by changing just a few of the commented-out lines of code.

How to use it:

Once you have unzipped the zip file onto your computer and decided either to use the existing executable program, or have compiled and linked your own executable from the "C" source code:
On your K5000 synth, create the bank dump(s) that you wish to examine; i.e., do a dump "ALL" of a bank from the disk menu.
For this example I dumped my "A" bank to a file I named: "my_abank.KAA".
Remove the floppy from the synth and put it into the computer. I usually move the bank dump file into the same directory where I have the executable kaanalyz program. Bank dump files are *always* 134660 bytes in size, anything else is incorrect.
Here's the syntax for running the program (version 1.0, version 1.1 has two more optional switches...):
kaanalyz -i<infile> [-e<outpath>] [-l{p|a|n|s|c|t}]
Parameters: (in any order, lower or upper case)
  -i<infile>     : <K5000 bank (.KAA) file name>
  -e<outpath>    : extract .KA1 files <destination path name>
  -lp            : list patches ordered by number
  -la            : list patches ordered by address
  -ln            : list patches ordered by name
  -ls            : list patches ordered by size
  -lc            : list patches ordered by number of sources
  -lt            : list patches ordered by type of sources
Simple isn't it? Well, maybe not for those of us who aren't programmers.
Here's what it means.
The program has three "switches": "-i" which is required; and "-e" and "-l" which are optional. The square brackets indicate optional parameters. The words within angle brackets mean that you put a filename or pathname there; "<infile>" is the name of your input file which is the bank dump, and "<outpath>" can be a directory path of where you want the program to write all of the ".KA1" patch files it creates if you have specified the "-e" switch. Note that you are not supposed to enter the angle brackets "<>" themselves; this is just programmer notation. I use an angle bracket ">" below, but this is something different. Though the parameters (switches) can be in any order and can be either upper or lowercase, I use lowercase and I put the "-lp" or whatever in the middle to remind me which type of listing I am creating.
So, to produce a basic listing by patch number(I'm showing Unix/Linux syntax):
kaanalyz -imy_abank.KAA -lp >my_abank_by_number.txt
Note that the ">my_abank_by_number.txt" is "redirecting" the output of the program into a new text file. The greater than sign (>) is a Unix symbol meaning: "redirect". Looks like Jens is doing something similar with the ">%1.txt" in his KAANALYZ.BAT file example. If you don't redirect the program output, the listing just "spews" onto your computer screen. Harmless, but not as useful as having something that you can print and keep.
Note that there was no space between the "-i" switch and the input filename. I am assuming that your input filename resides within the same directory as the program, if not, then you would need to put a complete pathname there pointing to the input file.
To produce a listing by patch size:
kaanalyz -imy_bank.KAA -ls >my_abank_by_size.txt

Here is an example of a patch listing by patch number:

"FacABnk3.KAA" contains 60 patches using 124868 bytes (95.27% of memory).

Base address = 0x003535C8.  Patches:
number name     sources size  padding
   1   Sphaera  AAPP--  2038     0
   2   RockPad  AP----  1060     0
   3   StageMKI AAA---  2758     0
   4   Valves   AA----  1866     0
   5   Bronx    AAP---  1952     2
   6   RaVa     PPPP--   426     0
   7   Oszilla  AAAA--  3650     0
   8   InTraxx  AAAAPP  3822     0
   9   BigTime3 AAAP--  2844     0
  10   FASTSTRG AAA---  2758     0
  11   Rotator  AP----  1060     0
  12   Africa   APP---  1146     0
  13   DynoSaur AAA---  2758     0
  14   GosplOrg AAA---  2758     0
  15   Rezonato PP----   254     0
  16   TB5005   AA----  1866     0
  17   Taurus   AAP---  1952     0
  18   Gorgizmo AAPP--  2038     0
  19   OB_Hornz APP---  1146     0
  20   Junova   AAP---  1952     2
  21   Hormonic AAPP--  2038     0
  22   Creaturz AAAP--  2844     0
  23   FM-PIANO AAA---  2758     0
  24   SmthWssn APPP--  1232     0
  25   RaveRizm AA----  1866     2
  26   505_Hard AAPPPP  2210     0
  27   OB@5000  PAA---  1952     0
  28   @IsCream AA----  1866     0
  29   PlayWtMe AAP---  1952     0
  30   DreamMch AAP---  1952     0
  31   Polecat  AAPP--  2038     0
  32   Heaven   AAP---  1952     0
  33   Engage   AA----  1866     0
  34   Milleniu AAPP--  2038     0
  35   UltraSub PPA---  1146     0
  36   Houzeton AAP---  1952     0
  37   Screamer AAAAAA  5434     0
  38   Wavelab  AAAP--  2844     0
  39   The_OB!  AAA---  2758     0
  40   PhazStrg AP----  1060     0
  41   K-Bells  AA----  1866     0
  42   ClassPad AAA---  2758     0
  43   Melmaker AAA---  2758     0
  44   @Vocodor AP----  1060     0
  45   Pound    AAP---  1952     2
  46   PolyMorf PPPPP-   512     0
  47   IronHead AAP---  1952     0
  48   SynCity  AAAAAA  5434     0
  49   Protonic PAA---  1952     0
  50   Warmer   AA----  1866     0
  51   Metaloid AAP---  1952     0
  52   Clavaxx  AA----  1866     0
  53   @Clustaz AAP---  1952     0
  54   VooCoo   AA----  1866     0
  55   Slpstick AAP---  1952     0
  56   Tinnitus AAPP--  2038     0
  57   LeadGtar AAAA--  3650     0
  58   TeknoBas AP----  1060     0
  59   MarsMoby PAA---  1952     0
  60   AnlogKit PPPPPP   598     2


Done.

Here is an example of a patch listing by patch size:

"FacABnk3.KAA" contains 60 patches using 124868 bytes (95.27% of memory).

Base address = 0x003535C8.  Patches:
number name     sources size  padding
  15   Rezonato PP----   254     0
   6   RaVa     PPPP--   426     0
  46   PolyMorf PPPPP-   512     0
  60   AnlogKit PPPPPP   598     2
   2   RockPad  AP----  1060     0
  40   PhazStrg AP----  1060     0
  44   @Vocodor AP----  1060     0
  58   TeknoBas AP----  1060     0
  11   Rotator  AP----  1060     0
  35   UltraSub PPA---  1146     0
  19   OB_Hornz APP---  1146     0
  12   Africa   APP---  1146     0
  24   SmthWssn APPP--  1232     0
  52   Clavaxx  AA----  1866     0
   4   Valves   AA----  1866     0
  16   TB5005   AA----  1866     0
  54   VooCoo   AA----  1866     0
  41   K-Bells  AA----  1866     0
  50   Warmer   AA----  1866     0
  33   Engage   AA----  1866     0
  25   RaveRizm AA----  1866     2
  28   @IsCream AA----  1866     0
  51   Metaloid AAP---  1952     0
  17   Taurus   AAP---  1952     0
  20   Junova   AAP---  1952     2
  53   @Clustaz AAP---  1952     0
  27   OB@5000  PAA---  1952     0
  30   DreamMch AAP---  1952     0
  49   Protonic PAA---  1952     0
   5   Bronx    AAP---  1952     2
  47   IronHead AAP---  1952     0
  32   Heaven   AAP---  1952     0
  29   PlayWtMe AAP---  1952     0
  36   Houzeton AAP---  1952     0
  55   Slpstick AAP---  1952     0
  59   MarsMoby PAA---  1952     0
  45   Pound    AAP---  1952     2
  34   Milleniu AAPP--  2038     0
  18   Gorgizmo AAPP--  2038     0
  21   Hormonic AAPP--  2038     0
  31   Polecat  AAPP--  2038     0
   1   Sphaera  AAPP--  2038     0
  56   Tinnitus AAPP--  2038     0
  26   505_Hard AAPPPP  2210     0
  42   ClassPad AAA---  2758     0
  43   Melmaker AAA---  2758     0
  39   The_OB!  AAA---  2758     0
  14   GosplOrg AAA---  2758     0
   3   StageMKI AAA---  2758     0
  23   FM-PIANO AAA---  2758     0
  13   DynoSaur AAA---  2758     0
  10   FASTSTRG AAA---  2758     0
  22   Creaturz AAAP--  2844     0
   9   BigTime3 AAAP--  2844     0
  38   Wavelab  AAAP--  2844     0
  57   LeadGtar AAAA--  3650     0
   7   Oszilla  AAAA--  3650     0
   8   InTraxx  AAAAPP  3822     0
  37   Screamer AAAAAA  5434     0
  48   SynCity  AAAAAA  5434     0


Done.


To split a bank dump into individual patches (this is a Unix example):
kaanalyz -imy_abank.KAA -e/usr/mike/k5000/abank/indiv_patches
When extracting, you do not need to create a listing.

Using the printouts productively:

I print out the current bank dumps by patch number first, then the listings arranged by patch size.
I also keep a separate printout of the "valid patch sizes" document page which shows all of the possible sizes in bytes that a K5000 patch could be---there are no others. Anything else is not a valid ".KA1" patch. Note that we are not talking about multi's or arpeggiator files.
I put the listings into plastic page protectors and place them in a K5000 3-ring binder. I consider the listings by patch number to be the "master" listings.
When I have a new patch that I want to audition, I "hunt" for a patch of the same byte size that I may not like very well.
I put the floppy containing the new patches into the disk drive, I play the "old" patch for a few minutes to establish it in my mind, then I write that patch onto the floppy in the K5000. (You could write it onto a floppy of "old" or "removed" patches instead if you really prefer to keep a separate diskette of "archived" patches.)
Next I select the new patch and "drop" it right on top of the old patch. Note that once the new patch is written into memory you *must* move the data wheel "away" from the current patch location and then back again in order to hear the new patch.
I play with the new patch. If I like the new patch, it stays. I cross out the old name in pencil and write in the new patch name on my master listing of patches by number. If I don't like the new patch, I reload the original "old" patch from the floppy diskette back into the current patch location and I move on to audition the next patch if any. Eventually I produce new listings once the banks have changed quite a bit.
So, the patches in my K5000S onstage synth have "earned" their places by a sort of Darwinian "survival-of-the-fittest" (or should I say: "survival-of-the-phattest"?). Virtually every patch in all four banks has won a "contest" against some other patch.
If you are a "C" programmer and improve the program in some way, please share it so that we can all benefit from your changes.
I hope that this program proves to be as useful to you as it has been to me. Good luck with it!



back