As far as I understand it it works independent from a key signature so it doesn't matter if the key is in C or not. The function says taht you transpose a pattern in a given key for X steps, so in your example you transpose a pattern in a-minor one step up, and from C one step is D.
Now to you John. Thanks for this awesome function(s). :) I'll be sure using them a lot. But I have some questions also. Would it be possible to make \diatonicTranspose recognize the key automatically? It would save a lot of typing. e.g.: motive = { c'8 d'8 } \new Staff { \key c \major \motive \diatonicTranspose #1 \motive \diatonicTranspose #2 \motive } Maybe the same for modeTranspose, that I only have to specify the mode I transpose into. This would be especially useful for minor keys because a motive is often transposed into minor melodic/harmonic. I guess the best solution would be to have both options available, e.g. just to specify the key if necessary and automatic recognition of the current key if no key is specified. Another thing I was thinking about is maybe using interval numbers instead of steps for the integer, so that #2 tranposes a second up and #-4 a fourth down etc. I think that's also what Stefan meant. Well, that's just my thoughts. It's definitely an awesome function and it makes constructing a piece with motives possible. Regards, Tao -------- Original-Nachricht -------- > Datum: Mon, 29 Dec 2008 10:16:29 +0100 > Von: "Stefan Thomas" <kontrapunktste...@googlemail.com> > An: lilypond-user <lilypond-user@gnu.org>, john.mander...@gmail.com > Betreff: Re: Diatonic/modal transposition function (John Mandereau) > Dear John, > I understood now. You have a note 0 in c major and in a minor, which > is a c. In my opinion it would be better to understand for a musician, > if You could use the intervall-names. I suggest something like: > diatonicfourthup= #(define-music-function (parser location x) (ly:music?) > #{ > $x \diatonicTranspose c \major #3 { $x } > #}) > But, what can be done, if the key is not c? > 2008/12/29 Stefan Thomas <kontrapunktste...@googlemail.com>: > > Dear John, > > many thanks for Your fantastic macro! There is only one thing, I don't > > understand. I tried to transpose to a minor. Why does it, in the below > > quoted example, start with d? The first note should be a, I assume. > > > > pattern = \relative c' { c2~ c8 d16 e f g a b c4 g e c } > > \new Staff { > > \pattern > > \diatonicTranspose a \minor #1 \pattern > > } > > > > > _______________________________________________ > lilypond-user mailing list > lilypond-user@gnu.org > http://lists.gnu.org/mailman/listinfo/lilypond-user -- Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user