;; ;; ;; randtime.cal ;; ;; ;; A sort of "un-quantize" command. ;; ;; Prolog ;; (do (dword wid 30) (int upbound) (int lobound) (int ofs) (getInt wid "Random time window (in ticks)?" 0 480) (= upbound (/ wid 2)) (= lobound (* upbound -1)) ) ;; Body (do (= ofs (random lobound upbound)) (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 ) NIL ) NIL ) (+= Event.Time ofs) ; do it! ) ;; Epilog NIL