home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / SEQUENCE / CAL_CONT / CRESCEND.CAL < prev    next >
Encoding:
Text File  |  1991-09-11  |  1.5 KB  |  77 lines

  1. ; Scott Michael Kemp - Serial Number: 400899 - CP - 4.0
  2. ;
  3. ; CRESCEND.CAL
  4. ;
  5. ; This function will crescendo (or decrescendo) a section of music.
  6. ;
  7. ; This functions uses percentages rather that strict offsets in order
  8. ; to keep the same feel as you played it originally.
  9. ;
  10. ; To use it:
  11. ;
  12. ; Enter the starting and ending percentage values.  (i.e. for a crescendo
  13. ; the first number should be lower than the second number)
  14.  
  15.  
  16.  
  17. ;;; Prolog
  18. (do
  19.     (int spercent 100) ; starting percent
  20.     (int epercent 100) ; ending percent
  21.  
  22.     ; temporary variables
  23.     (int location 0)
  24.     (int prevmeas 0)   ; used for status display
  25.     (int percent 0)    ; delta percent
  26.     (dword offtime 0)  ; time distance from "From"
  27.     (int roughper 0)
  28.     (dword timedif (- Thru From)) ; delta time
  29.  
  30.     ; get values
  31.     (getInt spercent "Starting Percentage?" 1 200)
  32.     (getInt epercent "Ending Percentage?" 1 200)
  33.     (int perdif (- epercent spercent))
  34.  
  35. )
  36.  
  37. ;;; Body
  38. ;(do 
  39. (if (== Event.Kind NOTE)
  40.    (do
  41.         (= offtime (- Event.Time From))  ; difference from FROM
  42.         (= location (/ (* offtime 100) timedif)) ; percentage through the selection
  43.         (= roughper (/ (* perdif location) 100))
  44.         (= percent (+ spercent roughper))
  45.  
  46.         ; change note velocity
  47.         (*= Note.Vel percent)
  48.       (/= Note.Vel 100)
  49.  
  50.         ; display status
  51.         (if (!= (meas Event.Time) prevmeas)
  52.              (do
  53.                  (= prevmeas (meas Event.Time))
  54.                  (message "Current Measure: " prevmeas)
  55.              )
  56.              NIL
  57.         )
  58.     )
  59.     NIL
  60. )
  61.  
  62. ;;; Epilog
  63. NIL
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.