home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / music / patchlib / patchsrc / convert.doc < prev    next >
Encoding:
Text File  |  1985-11-20  |  5.0 KB  |  90 lines

  1. Conversion for both the DX and CZ series have a few things in common.  The
  2.  
  3. preprocessor variable TOTAL_SIZE should be changed to the total size (in
  4.  
  5. bytes) of a single voice in the synth.  The preprocessor variable VOICE_SIZE
  6.  
  7. should be changed to the number of voice parameters that the program will be
  8.  
  9. setting when generating new voices (which will correspond to the number of
  10.  
  11. parameters given in the RANDOM_FILE parameter file).
  12.  
  13.  
  14.  
  15. Voices are always sent to and read from the voice edit area of the synth.
  16.  
  17.  
  18.  
  19. You will have to set up a new RANDOM_FILE with appropiate parameter contents.
  20.  
  21. I hope you know the function of all the voice parameters because it would take
  22.  
  23. another 10 pages to explain all of them in detail -- check your owner's manual.
  24.  
  25. For the DX100 you can examine how I set them against the listing in the back
  26.  
  27. of the owner's manual (sorry, I'm not going to type it in!).  The CZ parameters
  28.  
  29. can be checked against the listing in CZ101.DOC .
  30.  
  31.  
  32.  
  33. The remaining comments have to deal principally with random voice generation
  34.  
  35. and are best dealt with separately for each series.
  36.  
  37.  
  38.  
  39. DX series Conversion
  40.  
  41. --------------------
  42.  
  43. Voice generation is extremely simple.  Essentially, each data byte in the
  44.  
  45. voice corresponds to a voice parameter in the synth.  So, to generate a voice,
  46.  
  47. we go through each data byte, generate a random parameter as dictated by the
  48.  
  49. RANDOM_FILE parameter file, stuff it into the data byte, and continue.  When
  50.  
  51. all the data bytes are filled we are done.  All this is done in the make_voice()
  52.  
  53. routine.  This is a slight over-simplification, however.  The scheme described 
  54.  
  55. is adhered to only for the first VOICE_SIZE data bytes.  The remaining bytes 
  56.  
  57. are either voice name bytes (into which we put "RANDOM") or parameters which 
  58.  
  59. have no effect on the DX100 (into which we put 0).  In addition, certain of 
  60.  
  61. the VOICE_SIZE bytes are modified as described in the make_voice() routine to
  62.  
  63. produce more pleasing effects in ways that are difficult to deal with in the
  64.  
  65. RANDOM_FILE parameters.
  66.  
  67.  
  68.  
  69. Note that whenever a voice name is obtained from the user for a new voice,
  70.  
  71. it is also copied into the appropiate data bytes in the voice (overwriting
  72.  
  73. "RANDOM" or whatever).
  74.  
  75.  
  76.  
  77. CZ series Conversion
  78.  
  79. --------------------
  80.  
  81. As stated previously, the program should already work for the CZ-1000 and 5000.
  82.  
  83. However, the 5000 (unlike the 1000) is not 100% identical in system exclusive
  84.  
  85. features.  The important thing is that the tone data format *is* 100% identical.
  86.  
  87. However, there are certain other data that can be sent for the 5000 as well as
  88.  
  89. tone data (namely GLIDE NOTE, GLIDE TIME, MODULATION DEPTH, VOLUME LEVEL, and
  90.  
  91. GLIDE ON/OFF).  Not having a CZ-5000 I don't know if it is important to set any
  92.  
  93. of these, but it would seem that since these are not an intrinsic part of the
  94.  
  95. tone data their setting(s) should be left to the user.  Not to mention that 
  96.  
  97. there is no way to *read* them back from the 5000.
  98.  
  99.  
  100.  
  101. If you are going to attempt conversion for some other CZ (e.g., CZ-1), good 
  102.  
  103. luck!  Well really, it is not impossible, just a lot harder than for a DX.  
  104.  
  105. First, check the differences in system exclusive implementation.  If you are 
  106.  
  107. lucky, (like with the CZ-1000) the tone data format will be identical.  If
  108.  
  109. there are no other things to be sent with a tone, then no conversion is needed.
  110.  
  111. If you are not so lucky, and there are differences in the system exclusive
  112.  
  113. implementation, keep a few things in mind:
  114.  
  115.  
  116.  
  117.     1) Casio sends their data bytes with the nibbles reversed.  Notice
  118.  
  119.         that at the end of my make_voice() routine, all the just
  120.  
  121.         generated data bytes get reversed.
  122.  
  123.  
  124.  
  125.     2) If the data byte values to be sent don't seem to have any simple
  126.  
  127.         relation to the parameter value (like VIBRATO DELAY TIME on
  128.  
  129.         the CZ-101) you can use CONVERT.PRG to convert an ASCII hex
  130.  
  131.         file you've created in an editor to binary (and back again
  132.  
  133.         if you've made an error and want to examine a binary file).
  134.  
  135.  
  136.  
  137.     3) If a name can be stored with a voice, look at the parts of the DX
  138.  
  139.         code that deal with that (usually short sections surrounded
  140.  
  141.         by #ifdef DX100, #endif dealing with 'v_name' in between).
  142.  
  143.  
  144.  
  145.     4) Handshaking is done by handshake().
  146.  
  147.  
  148.  
  149.     5) If the system exclusive implementation is *similar* (say just more
  150.  
  151.         ADSR steps for example) you may be able to get away with not
  152.  
  153.         re-writing the make_voice() routine from scratch, perhaps just
  154.  
  155.         by extending the range of a loop variable.
  156.  
  157.  
  158.  
  159.     6) Keep in mind when looking at make_voice() that many data values are
  160.  
  161.         being put in a single byte or, worse, split across bytes. Don't
  162.  
  163.         yell at me.  Also, those incredible messy functions you see
  164.  
  165.         are because for some reason Casio doesn't believe that if a
  166.  
  167.         parameter value is 35 you should send 35, instead you send 86 
  168.  
  169.         (or whatever).  
  170.  
  171.         
  172.  
  173. If you are willing to settle for just a voice librarian but not generator, the 
  174.  
  175. conversion should be trivial and you can probably forget all my little helpful 
  176.  
  177. suggestions above.
  178.  
  179.