[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] began real transposition script
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] began real transposition script |
Date: |
Sat, 08 Nov 2008 09:22:09 +0000 |
On Fri, 2008-11-07 at 10:37 -0600, Jeremiah Benham wrote:
> I began writing a real transposition script
>
> (define chromatic_notes '(
> ("a" 0)
> ("b" 1)
> ("c" 2)
> ("d" 3)
> ("e" 4)
> ("f" 5)
> ("g" 6)))
>
> (define sharp_list (list "a" "ais" "b" "c" "cis" "d" "dis" "e" "f"
> "fis"
> "g" "gis"))
>
> (define transpose
> (lambda (note modulate)
> (list-ref sharp_list (+ modulate (car (cdr (assoc note
> chromatic_notes)))))))
>
>
> Am I on the right path with this.
I am not so sure that this is a good way to go. A transposition is not
defined by a single integer.
You need two, one would be the number of diatonic steps, the other
something to encode the number of additional sharps/flats.
So c->cis would be (0, 7)
an augmented unison (that is going for example from C-major to C#-major)
c->cis'' would be (16, 7)
same plus two octaves
while
c->des would be (1, -5)
a minor second (going for example from C-major to Db-major)
my guess is that someone will have sorted out a neat way of calculating
the amount to add/subtract to the enharmonic_shift for a given
transposition - a good place to look might be the LilyPond source
tarball.
hth
Richard
Re: [Denemo-devel] began real transposition script, Jeremiah Benham, 2008/11/08