home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazin 1996 February
/
CD_02_96.BIN
/
share
/
_music
/
disk1
/
randtime.ca_
/
randtime.bin
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!
)
)
)