Re: changePitch and ties
> I'll try to include it in a next release of changePitch.ly Done. http://gillesth.free.fr/Lilypond/changePitch/ Note that, you can deactivate the new automatic tie grouping, for pieces done with previous version of changePitch.ly. Please, see the (also new) doc, changePitch-doc.pdf (end of chapter 6), in the directory above. Happy new year to everybody. -- Gilles ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: changePitch and ties
Gilles THIBAULT wrote >> Would it be possible to tell changePitch to automatically repeat the >> pitch >> of a tied note? > Well, i have just read your message just yesterday. Sorry. > Here is a function that automatically repeats the pitch > of a tied note. > I'll try to include it in a next release of changePitch.ly Works great, thank you for your work! Jakob -- View this message in context: http://lilypond.1069038.n5.nabble.com/changePitch-and-ties-tp35389p185387.html Sent from the User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: changePitch and ties
> Would it be possible to tell changePitch to automatically repeat the pitch > of a tied note? Well, i have just read your message just yesterday. Sorry. Here is a function that automatically repeats the pitch of a tied note. I'll try to include it in a next release of changePitch.ly -- Gilles\include "changePitch.ly" %% to download here : %% http://gillesth.free.fr/Lilypond/changePitch/ %% LSR here : %% http://lsr.di.unimi.it/LSR/Item?id=654 checkForTies = #(define-music-function (parser location music) (ly:music?) "A tieded note will get automatically the same pitch than the previous note (= the note with the tie symbole)" (define (rel-callback x p); set pitch to the prev value (ly:prob-set-property! x 'pitch p) p) (let ((tieNote? #f) (startSamePich? #f) (stopSamePich? #f)) (map-some-music (lambda (x) (and (note-or-chord? x) (let ((tags (ly:music-property x 'tags))) (if (not (memq cPSamePitch tags)) (begin (set! tieNote? (pair? (extract-named-music x '(TieEvent (set! stopSamePich? (and startSamePich? (not tieNote?))) (set! startSamePich? (and tieNote? (not startSamePich?))) (cond (startSamePich? (ly:music-set-property! x 'tags (cons cPSamePitch (delq cPSamePitchEnd tags (stopSamePich? (ly:music-set-property! x 'to-relative-callback rel-callback) (if (not (memq cPSamePitchEnd tags)) (ly:music-set-property! x 'tags (cons cPSamePitchEnd tags (tieNote? (ly:music-set-property! x 'to-relative-callback rel-callback) (ly:music-set-property! x 'tags (cons cPSamePitch (delq cPSamePitchEnd tags))) (set! startSamePich? #t) x))) music))) %%% %% test 1 \changePitch \checkForTies { c4 c4~ \tuplet 3/2 { c8 c8 c8 } c4 | } \relative c' { c d e f g a b c d e } %% test 2 (with \samePitch) \changePitch \checkForTies { c4 c4~ \tuplet 3/2 \samePitch { c8 c8 c8 } c4 | } \relative c' { c d e f g a b c d e }___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: changePitch and ties
Gilles THIBAULT wrote >>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. > > Sorry to answer so late. > With changePitch and ties, you can use the function \samePitch. > It is ( shortly ) discribed in section 6) of the doc of \changePitch : > http://gillesth.free.fr/Lilypond/changePitch/change-pitch-doc.pdf > > > %%% > \include "changePitch.ly" > > pattern = { \samePitch {c2 ~ c8} c4. } > > \changePitch \pattern >{ <c'e'>^\markup{Ok now} <d'f'> <e'g'> <f'a'> > } > > > %% > > Gilles > > > > ___ > lilypond-user mailing list > lilypond-user@ > http://lists.gnu.org/mailman/listinfo/lilypond-user I just found out that changePitch is very useful to write homophonic passages in \parallelMusic! %% \version "2.19.32" \include "changePitch.ly" \parallelMusic #'(one two three) { \changePitch { 4 8 \samePitch { 8~ 8 } 8 8 8 | } { c'' d'' e'' f'' g'' a'' a' b' c'' d'' c'' cis'' f' g' a' b' as' ges' } } << \one \two \three >> %% But there is still a small problem with ties. It's not always possible to use \samePitch. %%%%%%%% { 4 4~ \tuplet 3/2 { 8 8 8 } 4 | } Would it be possible to tell changePitch to automatically repeat the pitch of a tied note? I tried to understand the scheme code to find a solution by myself. But once again I discovered the limits of my scheme-abilities very soon.. -- View this message in context: http://lilypond.1069038.n5.nabble.com/changePitch-and-ties-tp35389p184634.html Sent from the User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: changePitch and ties
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. Sorry to answer so late. With changePitch and ties, you can use the function \samePitch. It is ( shortly ) discribed in section 6) of the doc of \changePitch : http://gillesth.free.fr/Lilypond/changePitch/change-pitch-doc.pdf %%% \include "changePitch.ly" pattern = { \samePitch {c2 ~ c8} c4. } \changePitch \pattern { ^\markup{Ok now}} %% Gilles ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
changePitch and ties
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 { ^\markup{OK} } \rhyA { b'^\markup{unis} c'' } } { \rhyB { ^\markup{Mishandles the tie}} \rhyB { b'^\markup{unis} c'' } } %% ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user