home *** CD-ROM | disk | FTP | other *** search
- ;; 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!
- )
- )
- )
-
-