[CM] Tuning question

Per Bloland bloland@stanford.edu
Tue, 18 Jul 2006 13:18:18 -0700


Hi,
I've been experimenting with tunings, and there's one thing I can't figure
out. I'm using the "tuning" class with :cents. When the subsequent list
begins with 0, all is well and I can specify each notes distance from the
lowest note. However, when the cents list does not begin with 0, it doesn't
seem to consistently specify the distance between adjacent steps. For
example:

(new tuning :name 'one
     :cents '(200 100)
     :lowest 261.625)

(events (play-tuning #&one 0 2 .5 .6)
    "hscale.mid")

gives me C D Eb, as expected, but this (with the same events call):

(new tuning :name 'one
     :cents '(100 200)
     :lowest 261.625)

gives me C D E, rather than C C# D#. What am I missing?

Thanks,
Per

Also, here's the "play-tuning" code taken from the book, which I used above:

(define (play-tuning tuning low high rate amp)
    (let* ((rise (loop for i from low below high
              collect i))
       (fall (loop for i downfrom high downto low
              collect i))
       (ran1 (shuffle (rest rise)))
       (ran2 (shuffle (rest rise)))
       (coda (loop for i from low to high collect i))
       (all (append rise fall ran1 ran2 coda)))
      (process for k in all
           for x = (keynum k :from tuning)
           output (new midi :time (now)
               :keynum x
               :amplitude amp
               :duration (* rate .95))
           wait rate)))


-- 
Per Bloland
http://www.stanford.edu/~bloland