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

  1. ;; THINWHL.CAL
  2. ;;
  3. ;; A CAL program to "thin" channel aftertouch data.
  4. ;;
  5. ;; Deletes every N'th channel aftertouch event unless the pressure value is
  6. ;; is 0, 64, or 127.
  7. ;;
  8. ;;
  9.  
  10. (do
  11.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  12.  
  13.     (int N 4)    ; thin every N'th event
  14.     (int i 0)        ; index for moving through
  15.  
  16.     (getInt N "Delete every Nth ChanAft event:" 1 100)
  17.  
  18.     (forEachEvent
  19.         (do
  20.             (if (== Event.Kind CHANAFT)
  21.                 (do
  22.                     (switch ChanAft.Val
  23.                         ;; Don't delete if value is 0, 64, or 127....
  24.                         0
  25.                             NIL
  26.                         64
  27.                             NIL
  28.                         127
  29.                             NIL
  30.  
  31.                         ChanAft.Val   ; Default -- anything else...
  32.                             (if (== 0 (% i N))  ; is it the N'th event?
  33.                                 (delete)
  34.                             )
  35.                     )
  36.                     (++ i)          ; this counts
  37.                 )
  38.             )
  39.         )
  40.     )
  41. )
  42.