home *** CD-ROM | disk | FTP | other *** search
- ; Author: Douglas A. Delaney User ID:142 VARYVEL.CAL
- ;
- ; This will ask the user for the highest and lowest VELOCITY values that
- ; each NOTE event should be randomly set between in the selected region.
- ;
- ; by Doug Delaney (313)-585-5473
- ; 208 La Plaza Ct.
- ; Royal Oak, MI 48073
- ; Any comments, suggestions or criticisms are welcome
- ;
- ; Useage: This can be very benefitial if you have a keyboard that is
- ; NOT touch-sensitive, or a drum machine. I find it particularly
- ; helpful for making Hi-Hat parts sound Human.
- ;
- ; Note: the Message command at the start of the DO loop at the top of
- ; the body section adds to the execution time. I put it in so
- ; I can see something happening... Delete the line, or
- ; comment it out to decrease processing time.
- ;
- ;
- ; This routine demonstrates the use of STRING variables to produce a line of
- ; text to display in the Message Line that is too long to be entered as a
- ; single Message command. The text itself is less than 80 characters, but
- ; the CAL editor will not let you edit a line longer than 80, which, by the
- ; time the Message command (to display the text) is added to the text, the
- ; total is more than 80.
- ;
- ; prolog
- (do
- (string use "Use to randomly change velocities within LOW and HIGH")
- (string use2 " limits ** PRESS ANY KEY **")
- (string hlp " ESC to Abort <or> Any Other Key")
- (int low 40)
- (int high 90)
- (int new 0)
- (dword ave 0)
- (word count 0)
- (getInt low "Low limit of Velocity Range" 0 127)
- (getInt high "High limit of Velocity Range" 0 127)
- )
- ;body
- (do
- (message "Event #" (index) "Low:" low "High:" high hlp)
- ;Delete the line above this one to speed up processing
- (if (== Event.Kind NOTE)
- (do
- (++ count)
- (if (< Note.Vel low)
- (= low Note.Vel)
- NIL
- )
- (if (>= Note.Vel low)
- (do
- (+= new (random low high))
- (= Note.Vel new)
- )
- NIL
- )
- (= new 0)
- (if (> Note.Vel high)
- (= high Note.Vel)
- NIL
- )
- (if (<= Note.Vel high)
- (do
- (+= new (random low high))
- (= Note.Vel new)
- )
- NIL
- )
- (= new 0)
- (+= ave Note.Vel)
- )
- NIL
- )
- )
- ;epilog
- (do
- (/= ave count)
- (pause "Low=" low " High=" high " Ave.=" ave " # Notes changed=" count hlp)
- )