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

  1. ; David Rude  ID #31077
  2. ;
  3. ; Make it swing!
  4. ;
  5. ; CAL program for adding 'swing' to 16th note based music
  6. ;
  7. ;  This CAL program will add that 'swing' feel to music that
  8. ;  is based on 16th notes.
  9. ;
  10. ; Works independant of TIMEBASE!
  11. ;
  12. ;
  13. (do
  14.   (dword tck 0)              ; current note's tick
  15.   (int swing 0)              ; value to add for swing time
  16.   (int division1 TIMEBASE)   ; 16th note division value
  17.   (int division2 0)          ; 2nd possible 16th note division value
  18.   (int swingadd TIMEBASE)    ; value to add for full swing
  19.   (/= swingadd 12)           ; value of a triplet
  20.  
  21.   (/= division1 4)                 ; calc the tick divisor for a 16th note
  22.   (= division2 (* division1 3 ))   ; calc 2nd value
  23.  
  24.   (getInt swing "Swing percentage (10-100) " 10 100 )  ; Entering 100 means
  25.                                                        ; make it FULL swing
  26.  
  27.   (*= swing swingadd)              ; make value to add to swing notes
  28.   (/= swing 100)                   ; do % math (sort of)
  29. )
  30.  
  31. (do
  32.   (if (== Event.Kind NOTE)               ; is it a note?
  33.     (do
  34.       (message "Measure: " (meas Event.Time ))    ; update display
  35.       (= tck (tick Event.Time))
  36.       (if (== tck division1)                      ; is it the right note
  37.           (+= Event.Time swing)                   ; make it swing time
  38.           NIL
  39.       )
  40.       (if (== tck division2)                  ; is it the other right note
  41.           (+= Event.Time swing)               ; make it swing also
  42.           NIL
  43.       )
  44.     )
  45.     NIL
  46.   )
  47. )
  48.  
  49. ;;
  50. NIL
  51.  
  52.  
  53.