home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Music Workshop 1
/
Music_Workshop_Walnut_Creek_January_1995.iso
/
mcd
/
unzipped
/
demo
/
cwpro30
/
thinwhl.cal
< prev
next >
Wrap
Text File
|
1993-04-28
|
884b
|
41 lines
;; THINWHL.CAL
;;
;; A CAL program to "thin" pitch wheel data.
;;
;; Deletes every N'th pitch wheel event unless the wheel value is
;; is -8191, 0, or 8191 (min, center, and max values, respectively).
(do
(include "need20.cal") ; Require version 2.0 or higher of CAL
(int N 4) ; thin every N'th event
(int i 0) ; index for moving through
(getInt N "Delete every Nth wheel event:" 1 100 )
(forEachEvent
(if (== Event.Kind WHEEL)
(do
(switch Wheel.Val
; If -8192, 0, or 8192, don't delete
0
NIL
-8192
NIL
8191
NIL
Wheel.Val ;default
(if (== (% i N) 0) ; Is it the N'th event?
(do
(delete) ; Yes: delete it
(message "Deleted #" i) ; Let 'em know how it's going
)
)
)
(++ i) ; this counts
)
)
)
)