home *** CD-ROM | disk | FTP | other *** search
/ Hope PC Multimedia SuperPack 2 / HOMEPC.iso / CAKEWALK / THINWHL.CA_ / THINWHL.bin
Text File  |  1996-02-22  |  884b  |  41 lines

  1. ;; THINWHL.CAL
  2. ;;
  3. ;; A CAL program to "thin" pitch wheel data.
  4. ;;
  5. ;; Deletes every N'th pitch wheel event unless the wheel value is
  6. ;; is -8191, 0, or 8191 (min, center, and max values, respectively).
  7.  
  8. (do
  9.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  10.  
  11.     (int N 4)    ; thin every N'th event
  12.     (int i 0)        ; index for moving through
  13.  
  14.     (getInt N "Delete every Nth wheel event:" 1 100 )
  15.  
  16.     (forEachEvent
  17.         (if (== Event.Kind WHEEL)
  18.             (do
  19.                 (switch Wheel.Val
  20.                     ; If -8192, 0, or 8192, don't delete
  21.                     0
  22.                         NIL
  23.                     -8192
  24.                         NIL
  25.                     8191
  26.                         NIL
  27.  
  28.                     Wheel.Val        ;default
  29.                         (if (== (% i N) 0)           ; Is it the N'th event?
  30.                             (do
  31.                                 (delete)                ; Yes: delete it
  32.                                 (message "Deleted #" i) ; Let 'em know how it's going
  33.                             )
  34.                         )
  35.                 )
  36.                 (++ i) ; this counts
  37.             )
  38.         )
  39.     )
  40. )
  41.