Class
midi-tempo-changeA MIDI tempo change event.
midi-tempo-change supports the following
slot initializations:
:time number:usecs integer;; The midi-tempo-change event. ;;; tempo 120 quarters per minute (new midi-tempo-change :time 0 :usecs 500000) ;;; tempo 90 quarters per minute (new midi-tempo-change :time 0 :usecs 666667) ;; Converting quarter notes per minute to usecs. (define (qpm->usecs bpm ) (inexact->exact (round (* (/ 60 bpm) 1000000)))) (define (accel num tempo1 tempo2) ;; accelerate in num quarters from tempo1 to tempo2 (process for i below num for r = (interp i 0 tempo1 (- num 1) tempo2) output (new midi-tempo-change :time (now) :usecs (qpm->usecs r)) output (new midi :time (now) :duration .5 :keynum (between 60 72)) wait 1)) (events (accel 20 60 240) "test.mid") ⇒ "test.mid"