[CM] tempo change in midi files

Rick Taube taube@uiuc.edu
Mon, 17 Nov 2003 06:46:41 -0600


> Two questions:
>
> 1. Is there a straightforward way to keep time in musical time (from
>    the beginning) rather than absolute time? Musical time should *not*
>    be measured in beats, as the reference of the beats (denominator of
>    time signature) might change. The format I formally (in cl) used
>    were ratios expressing the musical time from the beginning in

Offhand I dont see why you cant use ratios to express time -- the 
scheduler doesnt really care what format "time" values are in, and 
since you can fiddle with :divisions and tempo changes in midi its not 
really seconds anyway

>    as absolute time and I fear that tempo-changes are taken into
>    account in the events routine.

Tempo changes are NOT taken into account -- they are just data that 
gets written to the file and have no effect on the scheduler.

> 2. Taking your example above and applying that to time-signatures, I
>    run into an error:

the function make-time-signature returns TWO values so your loop will 
have to do somthing like

(define (make-time-sig-map timesiglist)
   (let ((curr 0))
     (loop with m and d
            for x in timesiglist
            do (multiple-value-setq (m d) (apply #'make-time-signature 
x))
            collect (new midimsg
                           :time curr
                           :msg m :data d)
  ...)


i think at some point i should rewrite the midiroutines to return 
messagses or vectors of messages rather than multiple values...