home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Music Workshop 1
/
Music_Workshop_Walnut_Creek_January_1995.iso
/
mcd
/
unzipped
/
demo
/
cwpro30
/
randtime.cal
< prev
next >
Wrap
Text File
|
1993-04-28
|
640b
|
34 lines
;; RANDTIME.CAL
;;
;; Sort of an "un-quantize" command.
(do
(include "need20.cal") ; Require version 2.0 or higher of CAL
(dword wid 30)
(dword widDiv2)
(int ofs)
(getInt wid "Random time window (in ticks)?" 0 480)
(= widDiv2 (/ wid 2))
(forEachEvent
(do
(= ofs (random 0 wid))
(= ofs (- ofs widDiv2))
(if (< ofs 0) ; if shifting earlier
(if (> (* ofs -1) Event.Time) ; if more than start time
(do
(= ofs Event.Time) ; make it equal to start time
(= ofs (* ofs -1)) ; restore to negative
)
)
)
(+= Event.Time ofs) ; do it!
)
)
)