lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changePitch and ties


From: Richard Sabey
Subject: changePitch and ties
Date: Fri, 11 Mar 2011 10:01:57 +0000

For the task of coding music where a rhythmic pattern occurs many times with various pitches and/or chords, I have found two utilities that have been of use to me:

changePitch at http://gillesth.free.fr/Lilypond/changePitch/changePitch.ly
defineTransform in LSR 346

However, each has its deficiencies, and I now need to code some music which neither of these utils can handle. The rhythmic pattern to be repeated involves ties. 346 handles these but changePitch doesn't. The pitch sequence involves markups and chords. changePitch handles these but 346 doesn't. Help, please! I can just about parse Scheme but can't write it because I don't know the internal data structures.

I know that I can use changePitch and hack the ties by writing twice every pitch which corresponds to a tied note in the rhythmic pattern. However, that entails knowing which pitches correspond to tied notes, so it fails to keep the rhythm separate from the pitches, which is what I was hoping to do. (And it'll also entail a heck of a load more typing...)

%%%%%%%%%%%%%%%%%%
\version "2.13.17"
\include "changePitch.ly"

rhyA =
    #(define-music-function (parser location newnotes) (ly:music?)
        #{ \changePitch { c2. c4 } $newnotes #}
    )

rhyB =
    #(define-music-function (parser location newnotes) (ly:music?)
        #{ \changePitch { c2 ~ c8 c4. } $newnotes #}
    )

{
    \rhyA { <c'e'>^\markup{OK} <d'f'> <e'g'> <f'a'>  }
    \rhyA { b'^\markup{unis} c'' }
}

{
    \rhyB { <c'e'>^\markup{Mishandles the tie} <d'f'> <e'g'> <f'a'> }
    \rhyB { b'^\markup{unis} c'' }
}
%%%%%%%%%%%%%%%%%%


reply via email to

[Prev in Thread] Current Thread [Next in Thread]