home *** CD-ROM | disk | FTP | other *** search
- ; Scott Michael Kemp - Serial Number: 400899 - CP - 4.0
- ;
- ; CRESCEND.CAL
- ;
- ; This function will crescendo (or decrescendo) a section of music.
- ;
- ; This functions uses percentages rather that strict offsets in order
- ; to keep the same feel as you played it originally.
- ;
- ; To use it:
- ;
- ; Enter the starting and ending percentage values. (i.e. for a crescendo
- ; the first number should be lower than the second number)
-
-
-
- ;;; Prolog
- (do
- (int spercent 100) ; starting percent
- (int epercent 100) ; ending percent
-
- ; temporary variables
- (int location 0)
- (int prevmeas 0) ; used for status display
- (int percent 0) ; delta percent
- (dword offtime 0) ; time distance from "From"
- (int roughper 0)
- (dword timedif (- Thru From)) ; delta time
-
- ; get values
- (getInt spercent "Starting Percentage?" 1 200)
- (getInt epercent "Ending Percentage?" 1 200)
- (int perdif (- epercent spercent))
-
- )
-
- ;;; Body
- ;(do
- (if (== Event.Kind NOTE)
- (do
- (= offtime (- Event.Time From)) ; difference from FROM
- (= location (/ (* offtime 100) timedif)) ; percentage through the selection
- (= roughper (/ (* perdif location) 100))
- (= percent (+ spercent roughper))
-
- ; change note velocity
- (*= Note.Vel percent)
- (/= Note.Vel 100)
-
- ; display status
- (if (!= (meas Event.Time) prevmeas)
- (do
- (= prevmeas (meas Event.Time))
- (message "Current Measure: " prevmeas)
- )
- NIL
- )
- )
- NIL
- )
-
- ;;; Epilog
- NIL
-
-
-
-
-
-
-
-
-
-
-
-
-
-