;;; KEEPAFT.CAL ;;; ;;; A CAL program to "thin" channel aftertouch data. ;;; ;;; Keeps every N'th channel aftertouch event, and those whose pressure value ;;; is 0, 64, or 127. ;;; ;;; ;;; Prolog (do (int N 4) ; thin every N'th event (int i 0) ; index for moving through (getInt N "Keep every Nth ChanAft event:" 1 100) ) ;;; Body (do (if (== Event.Kind CHANAFT) (do (switch ChanAft.Val ;; Don't delete if value is 0, 64, or 127.... 0 NIL 64 NIL 127 NIL ChanAft.Val ; Default -- anything else... (if (== 0 (% i N)) ; is it the N'th event? NIL (delete) ) ) (++ i) ; this counts ) NIL ) ) ;; Epilog NIL