home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1996 February / CD_02_96.BIN / share / _music / disk1 / thinaft.ca_ / thinaft.bin
Text File  |  1993-04-28  |  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.