
          




                  |\/\/\/|        Chris Ahlstrom
                  |      |        uucp ahlstrom%hei.uucp@usc.edu
                  |      |        GEnie KICKAHA; Compuserve 73340,26
                  | (.)(.)
                  C      _)  "Some people call me the space cowboy..."
                  | `___|
                  \   /           9950 Topanga Canyon Blvd
                  /____\          Chatsworth, CA   91311
                 /      \         (818) 998-0490

               File: V_CAL.TXT
              Title: Cakewalk Application Language (CAL) Programs
            Subject: Cakewalk Professional CAL Programs for Volume and
                     Pitch-Bend Control
             Format: ASCII text file created by PROFF text formatter
          Sequencer: Cakewalk 4.0 Professional
           Computer: 386 SX IBM PC clone (HD Systems; SVT motherboard)
               Date: 91.11.05




                        CAKEWALK PROFESSIONAL CAL PROGRAMS

                               Edition 1.0 91.11.05




          1. INTRODUCTION 

               I created  some  minor CAL routines to aid in controlling
          the  volume  of  notes.   Because of the limitations of memory
          when  running  a  CAL  program  from CakeWalk, and the size of
          some  of  these programs, I had to remove most commentary from
          them,  to get some extra space.  Thus, this document describes
          each routine.  

               These routines  are written almost exclusively to support
          Volume  (#7)  and  Pitch (#-1 under Cakewalk) information.  It
          is  very  easy  to  put  in  a  prompt for a different type of
          information,   and   other  minor  bells  and  whistles.   For
          example,  VTREMOLO  could  be  modified  to  vibrate  the  Pan
          control,  causing  nifty  sounds  sweeps  across the listening
          field.  

               A problem  with  most  of these macros is that I have not
          yet  had a lot of experience in running them.  Hence, bugs and
          unsuitability  of usage can be problems.  Get in touch with me
          to  see  if  there  are  improved versions.  Faster and better
          yet, try to modify them yourself.  It's fun! 


                                      - 1 -

          CAL Programs, Edition 1.0                             Ahlstrom



               Feel free  to  use  and  modify these in whatever way you
          want.   Please  pass  any enhancements on to me, so that I can
          benefit from them, and, in turn, pass them on.  

               Note that  only  the  "Professional"  version of Cakewalk
          supports the Cakewalk Application Language.  

               CAL programs described herein: 

          VRAMP.CAL    Ramps the volume control (#7).  An extension 
                       of the controller-fill function of Cakewalk.  

          VSWELL.CAL   Ramps the volume control up, then down, to 
                       generate a swelling of volume.  

          VSWELL3.CAL  An earlier version of VSWELL, done by brute 
                       force.  Other versions of VSWELL might be 
                       included by accident; ignore them.  

          VDWELL.CAL   A primitive version of VSWELL that ignores 
                       note information... the From and Thru times 
                       are used to determine the endpoints of a single 
                       big swell.  

          VTREMOLO.CAL Similar to VSWELL, but generates more periods 
                       of volume ramping, and the tremolo gradually 
                       decays.  The number of periods is specifiable.  

          VIBRATO.CAL  Generates a decaying vibrato (pitch-bend) in 
                       a manner similar to VTREMOLO.  The waveform 
                       is triangular, not sinusoidal.  

          STRUM.CAL    Converts chords into rough simulations of 
                       guitar strumming.  

          SUSTAINS.CAL Simulates sustain information by lengthening all 
                       notes that occur in region where sustain is 
                       on.  

          PAN.CAL      Simulates panning information by first adding 
                       two complementary volume values on the main 
                       channel and an alternate, and moving 
                       right-side notes to the alternate channel.  


               I also  included  a section on some of the enhancements I
          would  like  to  see in CakeWalk Professional.  See the end of
          this document.  






                                      - 2 -

          CAL Programs, Edition 1.0                             Ahlstrom



          2. SPEED WARNING 

               Some of   the   following   CAL  routines  do  a  lot  of
          processing  for  each  note.  For example, applying 20 periods
          of  vibrato  to  a single note can take up to half a minute on
          my  16  MHz  386SX  (cached).  Hence, be very patient when you
          give a CAL routine a lot to do.  

               The enterprising  user might want to dig for more optimal
          ways of doing things.  

               The number  of  notes  processed should give a clue as to
          whether  the  user  made  a  mistake  (e.g. processing a whole
          track, instead of just one small section).   

               Note that  the  number of notes is reported only for some
          of  the  CAL  programs  (VSWELL, VTREMOLO, and VIBRATO).  Feel
          free to upgrade the others.  


          3. BUG REPORTS: (message) function in loop; hanging.  

               I attempted  to  include  a message that would keep track
          of  the number of the note currently being processed, as a way
          of  reassuring  the  user  that something was going on.  After
          the   second   note,  however,  an  error  message  concerning
          "Event.Kind  out  of  range" would occur.  So, I had to remove
          the  message,  and be content with merely reporting the number
          of  notes  that were found.  See VSW_ERR.CAL to view the buggy
          code for yourself.  

               Another bug  (perhaps) strikes on occasion -- when paging
          up  or  down  in  the  Measure  View, while notes are playing,
          sometimes  the  notes  get  stuck,  necessitating a reboot.  I
          have  Cakewalk  set to filter out notes on all channels but 1.
          My  synthesizer  (PSS-790)  has  a  nasty  MIDI-IN-to-MIDI-OUT
          feature,   so   perhaps  this  superfluous  input  is  causing
          Cakewalk to stumble at times.  

               Other than that, Cakewalk seems rock-solid! 


          4. OPERATIONS USEFUL IN ALL CAL PROGRAMS 

          1.  Floating-point numbers.  

               CAL does  not support floating-point numbers.  Instead, I
          used  the dword (32-bit unsigned integers), and scaled them by
          a   factor   of   10000.   This  reduces  the  largest  number
          representable,   but   allows   the   encoding  of  fractions.
          Luckily,  the  smallest  fraction  really  necessary is 1/128.
          Hence,  10000  might  be  too big a factor -- 1000 might do as


                                      - 3 -

          CAL Programs, Edition 1.0                             Ahlstrom



          well (it allows larger numbers).  

               To use  floating-point,  treat the number as one having a
          numerator  and  denominator.   Multiple  the top number by the
          chosen   math-scale   (MScale)  factor,  then  divide  by  the
          denominator.  

          Example: 

              Represent  11/128.   First multiply by MScale (10000),
              then   divide   by  128.   This  yields  110000/128  =
              859.375.    Since  CAL  handles  only  integers,  this
              becomes  859  by truncation by integer division.  This
              is  a 0.044% error, not enough to affect, for example,
              the timing of an event enough to detect.  

          It  is  important  to  do  all math operations with this scale
          factor  in place.  Then, once the final result is obtained, it
          must  be converted back to a normal CAL integer by dividing by
          the math scale.  

          2.  The "round()" function.  

               Using the  MScale  factor  to  implement a rough floating
          point scheme, we can see that 

              round(x) = (x + MScale/2) / MScale

          Converted to CAL syntax, this becomes a pseudo-macro 

              round(x): (= x (/ (+ x (/ MScale 2)) MScale))

          Example: 

               Calculate round(4.8).   We  represent 4.8 as 4.8 x 10000,
          or 48000.  Then calculate 

              round(4.8) = (48000 + (10000/2)) / 10000
                         = 53000 / 10000
                         = 5

          This  example  implies  that 4.8 was converted to a "floating"
          number, then back to a regular CAL integer.  

               Unfortunately, CAL   does   not   support  user-definable
          functions.   Hence,  the  code  must  be  written  out in full
          wherever it is put to use.  







                                      - 4 -

          CAL Programs, Edition 1.0                             Ahlstrom



          5. VRAMP.CAL 

               A CAL  program  to  generate  a "volume ramp", which is a
          ramping  of  Volume  information  from  the  From  to the Thru
          times.   The  lower and upper limits of the control values can
          be provided.  Defaults are 72 to 112.  

               This function    is   essentially   equivalent   to   the
          controller-fill  function  that CakeWalk provides.  I wrote it
          to  get  the idea of how CAL worked.  However, it does let one
          select  a  volume  increment,  to  allow  fewer  events  to be
          generated.  


          6. VSWELL.CAL 

               This program  is  a newer version of VSWELL3.CAL.  Hence,
          please  read  the  description of that program first.  The new
          version differs in two ways: 

              1.  I renamed a lot of the variables, giving them 
                  shorter, yet more meaningful, names that 
                  match the equations below better.  

              2.  To get used to the looping necessary for more 
                  complex waveforms, this version implements 
                  the up-down ramping as a loop iterated twice.  
                  This actually shortens the program a bit.  In 
                  fact, the comments would fit.  However, I 
                  removed most of them anyway, and they appear 
                  as follows a bit later.  

          Also  see  the descriptions of variables listed in the section
          on  VTREMOLO.CAL.   That  program  adds  a  few variables, but
          otherwise,  most of them are taken from VSWELL, since VTREMOLO
          is just a fancier version of VSWELL.  

               Because of  the  method of generating the ramps, the peak
          value  is  created twice, and the minimum value falls right at
          the  end  of  the  note.   If  this  behavior  is not desired,
          removed  the  "="  from the "(while (<= t t1)".  Not only does
          this  cause  only  one  occurrence  of  the peak value, but it
          makes  the  swell  stop  a  little  sooner,  at  a  value  one
          increment above the minimum.  

               Comments from  the code -- to save space, only a one-line
          comment  was  left  in  the  code;  the rest of the commentary
          appears here: 

              1:  Set initial values of newfrom, newthru, 
                  (t0,v0), (t1,v1), etc.  



                                      - 5 -

          CAL Programs, Edition 1.0                             Ahlstrom



              2:  Set increment parameters for each period.  
                  For volume swell, they are determined by 
                  the peak-time in percent.  For tremolo 
                  or vibrato, by the number of periods 
                  requested.  

              3:  Set time for next ramp.  

              4:  Set volumn range (dv) and direction (vdec).  
                  If vdec == 0, we're currently ramping 
                  upward, otherwise, downward.  "vdel" is 
                  the absolute value of the whole range 
                  from minimum volume to maximum volume.  

              5:  Set parameters to start ramping up or 
                  ramping down.  While the current time 
                  is less than the current high time, 
                  insert an event, and increment or 
                  decrement the volume.  The actual, more 
                  accurate version of the current time 
                  is stored in "tflt".  The current time, 
                  t, is then tflt, rounded up, and 
                  converted to an integer.  

              6:  Set up for the next cycle (in opposite 
                  direction).  For the simple volume swell, 
                  just swap the values of v0 and v1.  Move 
                  t0 to the peak time, and t1 to the 
                  end time.  



          7. VSWELL3.CAL 

               This is  essentially  the  same  as VSWELL.CAL, but is an
          earlier  version  done  more  by  "brute force".  I include it
          here because it might be slightly easier to understand.  

               Generates a  "volume  swell",  a  triangular  ramping  of
          Volume  information.  This routine processes all notes between
          the  From-Thru  times.  It generates one swell per note, using
          the  duration  of  each  note.   The  default  peak  time,  in
          percent,  can be altered by the user.  An increment volume can
          also  be provided, to allow the macro to generate fewer events
          than might otherwise be generated.  See the figure below.  

               The function  for  the  current  volume  level  is in two
          parts,  as  per the point/slope formula.  Given two endpoints,
          (t0,v0)  and (t1,v1), and the time t, the control value, v, is
          given by: 




                                      - 6 -

          CAL Programs, Edition 1.0                             Ahlstrom




                                v1 - v0
                      v = v0 + --------- (t - t0)
                                t1 - t0

          To  get  the  default  value  of the peaktime, we multiply the
          difference   in   time   (Thru   -   From)   by   the  desired
          percentage-time for the peak, and add it to the From time.  

              User's input:

              Name    Prompt         Min  Max  Default
              ----    ------         ---  ---  -------
              min_v:  "Min volume"    0   127   72
              max_v:  "Max volume"    0   127  112
              inc_v:  "Incr volume"   0    16    2
              top:    "Peak time (%)" 1   100   50

              top     The user's entry for percentage-time; locates
                      the peak as a proportionality.
              inc_v   The size of the velocity increment.  If set
                      to 1, the maximum number of events is generated.
              min_v   Minimum velocity desired.
              max_v   Maximum velocity desired.

              Other variables:

              MScale  Factor to help implement a rough floating-point
              chan    The channel to use; determined by first note found
              del_t   Duration of each of two sections
              inc_t   The "floating-point version of the time increment
                      to use; the largest the volume increment, the
                      larger this value.  Given by the formula:

                          inc_t = del_t * inc_v * MScale / del_v

              peak_t  The time of the peak point, determined by the
                      "top" entered by the user, and the duration of
                      the current note.
              bot     The bottom of the proportionality; equals 100.
              cur_flt Floating point version of the current time, kept
                      to increase the accuracy of time calculations.
              cur_t   The current time at which to place a Volume event.
              del_v
              dec_v   0 = increment velocity as time increases;
                      1 = decrement velocity as time increases.
              cur_v   The current Volume value to write.
              ctlnum  Equals 7 for Volume information.  Could be
                      made into a prompt with a default value of 7.
              newthru Current end-time.




                                      - 7 -

          CAL Programs, Edition 1.0                             Ahlstrom



              max_v         * Each line represents "inc_v", the increment
                           *   *
                          *       *
                         *           *
                        *               *
                       *                   *
                      *                       *
              min_v  *------|--------------------*

                          peak_t

                Event.Time + Event.Dur =   max time (duration of note)

          Note  that  this  figure  can be inverted by responding to the
          prompts  so  that the maximum volume is less than the minimum.
          In  this  case,  one  then obtains an inverse swell (temporary
          muting).  [I have not verified this yet.] 

               Also be aware of the following quirks: 

              1.  There is a chance that the max and min 
                  values might not be exactly as specified.  

              2.  Slight editing is necessary to achieve 
                  other effects.  For example, the triangle 
                  can be converted to a trapezoid, to 
                  flatten the curve, by simply deleting a 
                  few of the inserted events, by hand.  

              3.  Error checking is not thorough, due to 
                  space constraints.  It is possible to 
                  enter illegal values, or values that 
                  cause weird things to happen.  Use backups 
                  or the undo function.  Use caution.  

              4.  Do not use this function when chords 
                  occur on a MIDI channel.  It generates an 
                  enormous number of useless events, since 
                  it tries to generate the waveform for 
                  each note it finds.  Use VDWELL instead.  



          8. VDWELL.CAL 

               Generates the  same  waveform  as  VSWELL, but it ignores
          the  Notes,  and instead just generates one waveform, from the
          From  to  the  Thru times.  Use this version when chords occur
          on the track.  

               Since this  little  program operates before any notes are
          found,  there's no way to get the channel, except by prompting


                                      - 8 -

          CAL Programs, Edition 1.0                             Ahlstrom



          the user.  

               It should  be  possible  to  move the processing from the
          Prolog  section  to the Epilogue section, but I have not tried
          this yet.  


          9. VTREMOLO.CAL 

               Generates a  rough form of decaying tremolo by repeatedly
          adding  ramps  up  and  down,  as  shown  in  the figure.  The
          prompts  for  input,  and  the parameters, are very similar to
          that  for VSWELL.  There is an additional parameter, Np, which
          determines the number of peaks to put out.  

               The variables  and  methods used are very similar, except
          that the VSWELL process must be iterated Np times.  

              vmax          *
                           * *        Np = 3 (three peaks)
                          *   *
                         *     *
                        *       *        *
                       *         *     *   *         *
                      *           *  *       *    *     *
              vmin   *------|------*-----|-----*-----|-----*

                          peak_t (determined by percentage)

              Event.Time + Event.Dur =  max time


              1:   Set  initial values of newfrom, newthru, (t0,v0),
              (t1,v1), etc.  

              2:  Set increment parameters for each period.  
                  For volume swell, they are determined 
                  by the peak-time in percent.  For 
                  tremolo or vibrato, by the number of 
                  periods requested.  Note that we could 
                  set vinc in the prologue, instead of the 
                  body.  

              3:  Set min & max volumns current ramp.  
                  If i is even, set v0 and v1 to the min 
                  and max values, respectively.  If i is 
                  odd, set v0 and v1 to the opposite (max 
                  and min, respectively.) After than, 
                  prepare for the next even value of i by 
                  adjusting the max value according to the 
                  necessary increment (the min value is 
                  not adjusted for tremolo.) 


                                      - 9 -

          CAL Programs, Edition 1.0                             Ahlstrom



              4:  Set volumn range (vdel) and direction 
                  (vdec).  If vdec == 0, we're currently 
                  ramping upward, otherwise, downward.  
                  "vdel" is the absolute value of the 
                  whole range from minimum volume to 
                  maximum volume.  

              5:  Set parameters to start ramping up or 
                  ramping down.  While the current time 
                  is less than the current high time, 
                  insert an event, and increment or 
                  decrement the volume.  The actual, more 
                  accurate version of the current time 
                  is stored in "tflt".  The current time, 
                  t, is then tflt, rounded up, and 
                  converted to an integer.  

              6:  Set up for the next cycle (in opposite 
                  direction).  Increment both t0 and t1.  



          10. VIBRATO.CAL 

               Generates a  rough form of decaying vibrato by generating
          positive   and  negative  pitch  bend  events.   The  prompts,
          parameters,  and  processing  are  very  similar  to  that for
          VTREMOLO.   However,  the  "minimum  pitch-bend"  parameter is
          unnecessary,  since  few  practical  applications require a DC
          offset   to  pitch-control  waveforms.   If  a  DC  offset  is
          desired,  modify  VTREMOLO  to  generate pitch bend instead of
          Volume.   (This  might  not work, since I can't guarantee that
          the VSWELL algorithm works for negative vmin.  

               Note that  peaks  are  counted in a similar way, but that
          the  negative  peaks  shouldn't  be  counted  (see  the figure
          below).   One  counts  this  way  because,  for  vibrato,  one
          specifies periods instead of peaks.  
















                                      - 10 -

          CAL Programs, Edition 1.0                             Ahlstrom




              +8191 |
                    |
                    |
                    |   * (t,pmax)      ^
                    |                   |      Np = 3
                    |                   |
                    |                 2*pinc   (this figure is
                    |  * *              |       very schematic)
                    |                   |
                    |                   |
                    |                   v
                    | *   *             *
                    |
                    |                  * *
                    |
                    |*     *          *   *
                    |
                    |                *     *            *
                    |                                 *   *
                 0  *---|---*---|---*---|---*---|---*---|---*---|---*
                    |                        *     *            *
                    |                         *   *
                    |        *     *           * *
                    |                           *
                    |                       ---><---dt   --->   <---dt
                    |         *   *
                    |                    (note how dt changes to
                    |                     accomodate the constant dp)
                    |          * *
                    |
                    |
                    |           * (t,-pmax+pinc)
                    |
                 --->   <---tinc
                    |
                    |
              -8191 |

          After  than, prepare for the next even value of i by adjusting
          the  max  value  according to the necessary increment (the min
          value is not adjusted for tremolo.) 

               For extra  fun,  set  Np  to a very high value (e.g. 48).
          This  should  create  a  buzzing effect.  In this regard, note
          the  variable  called  "told".  "Told" is the old t, and helps
          prevent  problems  when  generating  very  steep ramps.  These
          ramps  result in a lot of events on the same tick.  So VIBRATO
          generates  a  new  event  only  if  the  current  time,  t, is
          different from told.  

          NOTE:  Only VIBRATO currently has this protection.  


                                      - 11 -

          CAL Programs, Edition 1.0                             Ahlstrom



                 If it doesn't exist in other routines, you can 
                 add it by following the example of VIBRATO.  


          11. STRUM.CAL 

               This macro  provides a way to make a first-try simulation
          of  guitar strumming, without the pain of using a keyboard, or
          the  expense  of  a  guitar  controller.   The user enters the
          desired  separation between the rapidly arpeggiated (strummed)
          notes,  and  the  range  of  time chords should occupy.  STRUM
          then  takes all notes within the chord-interval, and puts them
          back  in  at  each  arpeggiation  interval.   In  addition,  a
          randomization increment can also be specified.  

               There are   some   problems  and  assumptions  concerning
          STRUM: 

              1.  Notes are logged in the order they are found.  
                  Due to the lack of arrays in CAL, we cannot 
                  save up the notes and sort them by note 
                  value before putting them out.  Hence, 
                  they must appear in proper order before 
                  the macro is applied.  For the musician, 
                  this means that the notes must be keyed 
                  roughly like a guitar already, in which 
                  case STRUM merely cleans up the strumming 
                  intervals somewhat.  

              2.  All notes within the chord-interval are moved, so 
                  the user must think carefully about what interval 
                  to specify.  

              3.  Strumming patterns other than "down down..." are 
                  not implemented, due to lack of either arrays 
                  or shift operators in CAL.  

              4.  Channel control isn't rigorous.  The track must 
                  have only one channel of information.  


               It should  be  straightforward  to  implement  a "down up
          down  up..."  pattern,  but  I  have not used this CAL routine
          enough  to  know  what  it really needs to make it useful.  It
          probably has bugs in it, too.  


          12. SUSTAINS.CAL 

               "SUSTAINS" is  meant for those people having a synth with
          no  sustain.   It  merely  lengthens any note that occur while
          sustain  is  on.   This  feature  is similar to the sustaining


                                      - 12 -

          CAL Programs, Edition 1.0                             Ahlstrom



          feature  of  Edit  Track  II  for  the Atari ST, but is a more
          reasonable  and  robust  implementation... it makes no attempt
          to  keep  a  note  on  for  the whole duration of the sustain.
          Hence,  notes  don't  build  up,  and this CAL program doesn't
          crash, like Edit Track does (or did).  

               The user   must  specify  the  maximum  duration  of  the
          sustained  notes,  in  ticks.  The default duration is six (6)
          whole-notes,  which might be too much for some voices, but not
          enough  for  others.   The  good  value  of this duration thus
          depends  upon  (1)  the  TIMEBASE of the current WRK-file; (2)
          the  voice  to  which  sustain  is  to be applied; and (3) the
          number  of  notes  currently active.  Many voices fade after a
          few  seconds,  and it makes no sense to sustain them past this
          point.  

               SUSTAINS has    one   feature   that   most   synthesizer
          implementations  of  sustain might not have... the duration of
          the  notes  is  proportional  to  the  level  of  the sustain.
          Sustain  is  normally  an  ON/OFF  switch, but many sequencers
          allow  values other than ON (127 or 64) and OFF (0).  So, this
          provides another variation to keep track of! 

               I would  expect that specifying an obscenely long maximum
          duration  would  eventually  cause problems on playback, since
          the  synthesizers would eventually run out of notes, and start
          dropping them anyway.  

               The durations  are  set so that a constant value is added
          to  the  original  note  duration.   There is no way to do the
          inverse  of  SUSTAINS,  to  recover  the original track.  I am
          considering  making  the new duration equal to a constant plus
          a  percentage  of  the original duration.  I haven't yet spent
          enough  time  using  this  macro  to know what is good and bad
          about it.  


          13. PAN.CAL 

               For synthesizers    that    do    not   support   panning
          information,  this  CAL  routine will take a track and convert
          it  into two channels of notes.  One channel consists of notes
          meant  for  the  left  side,  and  the other consists of notes
          meant  for  the  right side.  Both channels remain on the same
          track.   Complementary volume values are inserted for the left
          and  the  right  channel.  The Pan controls are left in place,
          although  no  longer  necessary.   Notes that occur in regions
          where  the  panning indicates "to the right" (control-7 values
          greater  than  64)  are  moved to the right channel.  The user
          can enter the minimum and maximum volumes to use.  

               So, if  Pan=64,  then  no notes are moved, but the volume


                                      - 13 -

          CAL Programs, Edition 1.0                             Ahlstrom



          in  both  left  and  right  channels  is set to 1/2 the volume
          range entered by the user.  

               If Pan=0,  then no notes are moved, but the volume in the
          left  channel  is  set  to  the maximum, and the volume in the
          right channel is set to the minimum.  

               If Pan=127,  then  the  notes  are  moved  to  the  right
          channel,  and  the  volumes  are  set opposite to those of the
          preceding paragraph.  

               Some assumptions must be adhered to: 

              1.  The track should be free of control 7 (volume) 
                  information.  

              2.  The selected right channel number should not be 
                  equal to the current channel number of the events 
                  on the track.  (We could rewrite the CAL program 
                  to move all events to two totally new channels).  

              3.  The channels will later be separated in some 
                  manner, so that they drive to different, but 
                  similar, MIDI devices.  One MIDI device is 
                  routed to the left speaker, and the other is 
                  routed to the right speaker.  


               I do  not  expect  that  this  CAL program will prove all
          that  useful,  since  it requires one to have two sound boxes,
          and,  if  two  boxes are affordable to the user, then a single
          sound  box  with  panning  ought to be affordable to the user.
          However,  this CAL program could be used as a two-channel form
          of  vector  synthesis.   In fact, it could be elaborated to do
          vector  synthesis based on two control values (e.g Panning and
          Volume).   Of  course,  this  is  useful  mainly  for  special
          effects.  

               At any  rate, it is a good example of some tricks you can
          pull with Cakewalk Pro.  


          14. ON THE HORIZON 

               I plan,  if  time  permits, to implement a better form of
          floating  point number, or some other trick, in order to allow
          generation  of  simple  power  series.  Many common functions,
          such   as   sine,   cosine,   log,   and  e-to-the-x,  can  be
          approximated  by power series.  If these can be implemented in
          CAL,  then the above routines can be rewritten to provide more
          natural, smoother, waveforms.  



                                      - 14 -

          CAL Programs, Edition 1.0                             Ahlstrom



          15. KICKAHA'S WISH LIST 

          A. Arrays and pointers 

               The single  greatest  improvement  to CAL would be to add
          arrays  and  pointers.   I  believe  this  to  be a relatively
          simple  and  straightforward enhancement.  The biggest benefit
          would  be  in  the  ability to include small look-up tables in
          the  program.   For  example, imagine the following section of
          code: 

              (do
                  (int sine[32] 64 78 93 ... 127 ...
                                93 78 64 ... 56 32
                                ... 0 ... 56)
                  (int *sptr sine)

                  ...

                  (while (< 1 32)
                      (insert time chan CONTROL 7 *(++ sptr)
                  )
              )

          Thus,  it  would  be  very  easy  to incorporate virtually any
          shape  of  waveform  into  a  CAL program, with a fairly small
          investment in memory.  

          B. More regions (100 instead of 10) 

               I'm just  thinking  how very useful 100 regions (numbered
          00 to 99) were in EditTrak II on my Atari ST.  

          C. Chaining of regions on a chain-track 

               Again, remembering   EditTrak   II,   this   feature  was
          sometimes  very useful.  The only caveat to it is that, due to
          the  need  to  scan  all  regions  before playing (to see what
          needs  to  be  played),  EditTrak  always took an extra second
          before  it  would  start  playing.   This pause proved a minor
          annoyance when previewing a section a lot of times.  

          D. Floating-point numbers for CAL 

               Adding arrays  and  pointers  would  reduce  the need for
          floating-point numbers somewhat.  

          E. A Graphics screen for editing note and control information 

               The note  screen  is pretty nice to use in a lot of ways,
          but  it  suffers  some minor defects.  Firstly, there's no way
          to  use  the  mouse  to drag the end of the note, to give it a


                                      - 15 -

          CAL Programs, Edition 1.0                             Ahlstrom



          longer  or  shorter duration.  Instead, one has to guesstimate
          what the new duration should be, and enter it as a number.  

               Secondly, even  in  zoom  mode, the character-cell is too
          coarse to show subtleties in the durations of the notes.  

               Thirdly, although  the  CAL  programs  described above do
          perform  certain  things  much  more  quickly than any graphic
          editing  could  do,  it  would  be  nice  to  quickly  fill in
          exponential  flangs  and  such.   Since  we  don't have lookup
          tables,  the  easy  CAL  program  is  forced  to employ linear
          control changes.  

          F. Usage of extended memory 

               It would  be  nice  to have some leg room form both large
          songs  and  for  scrap  buffers,  etc., by putting portions of
          memory  in  extended  memory.   For  example,  extended memory
          could  be  used for buffering song information, so that, while
          the  current  normal  buffer  plays, extended memory is loaded
          into the alternate normal buffer.  

               Of course,  scheduling  such  memory swapping might prove
          problematic, at least on slower PCs.  

          G. Command for Unmixing Channels 

               Such a   command   would  simply  extract  all  the  MIDI
          information  from  selected tracks, and write it to a sequence
          of  empty  tracks,  one channel at a time (with the 17th track
          used  for non-channel specific information).  Since CAL has no
          way  to  write  to  other than selected tracks, I haven't been
          able  to  find  a  workaround,  other  than  to  laborious cut
          channels out by hand.  

          H. Command for Key Splitting 

               Key splitting  means  putting each note on its own track.
          This  would  allow  spreading  out  a drum track, so that each
          drum  line  could  be transposed for other drum machines, with
          little effort or confusion.  













                                      - 16 -

