[CM] cm3 error
Heinrich Taube
taube at uiuc.edu
Wed Mar 18 12:13:05 PDT 2009
first...its great that your implementing your own code! for
transposing in cm3 you could just use the 'plus' function -- its
overloaded to handle common list procssing like this. so you just
pass it the scale as the first arg and the distance you want to
transpose it as the second:
(plus '(60 62 64} 7)
=> (67 69 71)
so the only bit of code you need (i guess...) is a function that
converts two keysigs to the semitone interval distance between them.
if you encode signatures using signed ints where 0=C -7= seven
flats and 7=seven sharps something like this might work i think
(define (sigdiff sig1 sig2)
(modulo (* 7 (- sig2 sig1)) 12))
(sigdiff -3 3) ; ef to a
=> 6
(sigdiff -3 2) ; ef to d
=> 11
(sigdiff 0 1) ; c to g
=> 7
(sigdiff 0 -1) ; c to f
=> 5
On Mar 18, 2009, at 1:36 PM, Lieven Moors wrote:
> I see, I had a look at it already, but didn't realize that I could
> pass
> a list of steps.
> (should have read the manual better...). But still that doesn't solve
> the problem
> of transposing the mode. I wanted to be able to say: transpose this
> mode
> up or
> down with n flats or sharps, and always do the right thing... Do you
> think there
> is a simple way to do this?
>
> greets
>
More information about the Cmdist
mailing list