[Top][All Lists]

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

pointAndClick coordinate in 2.15.41 less edit friedly than 2.14.2

From: ArnoldTheresius
Subject: pointAndClick coordinate in 2.15.41 less edit friedly than 2.14.2
Date: Mon, 16 Jul 2012 01:53:51 -0700 (PDT)

The pointAndClick location of chord repeats is now pointing to the orignial
Is 2.14.x it was pointing to your 'q' entry in the input file.
Especially with a lot of rhythmic repeats the old pointAndClick is much more
{ <c' e'>8. q16 q8-. q ~ q q16 q \times 2/3 { q8 q q } }

Is there a new option which I dit not realize?

Well, as a workaround I can apply a variant of \chordRepeats to get the
benefit back I had when editing using 2.14.2:

-#(define-public (expand-repeat-chords! event-types music)
+#(define-public (expand-repeat-chords-loc! event-types music)
   "Walks through @var{music} and fills repeated chords (notable by
 having a duration in @code{duration}) with the notes from their
 respective predecessor chord."
   (let loop ((music music) (last-chord #f))
     (if (music-is-of-type? music 'event-chord)
         (let ((chord-repeat (ly:music-property music 'duration)))
             ((not (ly:duration? chord-repeat))
             (if (any (lambda (m) (ly:duration?
                                   (ly:music-property m 'duration)))
                      (ly:music-property music 'elements))
             (set! (ly:music-property music 'duration) '())
             (copy-repeat-chord last-chord music chord-repeat event-types)
+            (let ((rep-loc (ly:music-property music 'origin)))
+             (for-each (lambda (nev)
+               (if (music-is-of-type? nev 'note-event)
+                (ly:music-set-property! nev 'origin rep-loc)))
+              (ly:music-property music 'elements)))
             (ly:music-warning music (_ "Bad chord repetition"))
         (let ((elt (ly:music-property music 'element)))
           (fold loop (if (ly:music? elt) (loop elt last-chord) last-chord)
                 (ly:music-property music 'elements)))))

-chordRepeats =
+chordRepeatsLoc =
 #(define-music-function (parser location event-types music)
    ((list? '()) ly:music?)
    "Walk through @var{music} putting the notes of the previous chord
 into repeat chords, as well as an optional list of @var{event-types}
-such as @code{#'(string-number-event)}."
-   (expand-repeat-chords! (cons 'rhythmic-event event-types) music))
+such as @code{#'(string-number-event)}. Finally set the origin of the
+repeated @var{note-event}s to be the origin of the @var{q} entry."
+   (expand-repeat-chords-loc! (cons 'rhythmic-event event-types) music))

It could be worth to integrate a similar addition into the standard
\chordRepeats command,
e.g. turned on /off with an extra optional parameter.

View this message in context: 
Sent from the Gnu - Lilypond - Bugs mailing list archive at Nabble.com.

reply via email to

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