Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
Ralph Palmer writes: On Sun, Dec 16, 2012 at 1:11 PM, Ben Rudiak-Gould benrud...@gmail.comwrote: I have hacked something up (see code below), but it doesn't work very well: Greetings, Ben Rudiak-Gould - I was hoping someone else would respond, but I haven't seen anything, so here goes . . . I know almost nothing about Scheme, so I won't try to evaluate your snippet. However, the function would be valuable, so I would encourage you to submit your snippet to the Snippet Repository so that others can use it. Do you want to make this a feature request? It's OK, Ralph, a feature request tracker has been created in response to this thread, and Ben's post of his prototype is linked from the tracker. See: http://code.google.com/p/lilypond/issues/detail?id=3014 Cheers, Colin. -- Colin Hall ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
On Sun, Dec 16, 2012 at 1:11 PM, Ben Rudiak-Gould benrud...@gmail.comwrote: I have hacked something up (see code below), but it doesn't work very well: * It works for slurs on either end as long as they span at least two notes. I can get it to work with single-note slurs at the end of the line by writing c'( s1*0) or c'( ), but I get the warning programming error: bounds of this piece aren't breakable. I haven't found a way to make it work with single-note slurs at the beginning of the line. * It works for lyric hyphens and extenders if there's an extra note with no lyric to extend to. I have to use as the lyric for this note, not _. This has the side effect that the lyric syllable isn't aligned properly at the end of the line (it's centered under the note instead of left-aligned). * I can't get it to work for ties in either direction no matter what I try. * It doesn't do anything to explicit beams (not that I suppose anyone would want to break beams this way), and it doesn't work properly with ligature brackets or tuplet brackets -- the bracket extends to the bar line but appears to begin/end there instead of being broken. MS, I hope you can tell me if there's a way to work around these problems in Scheme alone. -- Ben 8 \version 2.17.9 % This is necessary to avoid a warning #(set-object-property! 'fake-break-left 'backend-type? boolean?) #(set-object-property! 'fake-break-right 'backend-type? boolean?) #(define (fake-break-engraver score-context) (let ((last-barline #f) (open-spanners '())) (define (handle-barline barline) (set! last-barline barline) (set! open-spanners (filter try-extend-right open-spanners)) ) (define (try-extend-right spanner) (let ((still-open (null? (ly:spanner-bound spanner RIGHT (if (not still-open) (ly:spanner-set-bound! spanner RIGHT last-barline) ) still-open )) (define (handle-spanner-start spanner) (if (eq? #t (ly:grob-property spanner 'fake-break-left)) (if last-barline (ly:spanner-set-bound! spanner LEFT last-barline) )) (if (eq? #t (ly:grob-property spanner 'fake-break-right)) (set! open-spanners (cons spanner open-spanners)) )) `((acknowledgers (paper-column-interface . ,(lambda (engraver grob source-engraver) (if (and (eq? 'NonMusicalPaperColumn (assoc-ref (ly:grob-property grob 'meta) 'name) ) (not (null? (ly:grob-property grob 'measure-length))) ) (handle-barline grob) ))) (spanner-interface . ,(lambda (engraver grob source-engraver) (handle-spanner-start grob) )) \layout { \context { \Score \consists #fake-break-engraver } } \paper { ragged-right = ##t } \score { \new Staff { c' d' \once \override PhrasingSlur #'fake-break-right = ##t e'\( f'\) } \addlyrics { First to \once \override LyricHyphen #'fake-break-right = ##t sec -- } \new Staff { \once \override Slur #'fake-break-left = ##t g'( a') b'2 } \addlyrics { \once \override LyricHyphen #'fake-break-left = ##t _ -- ond. } \new Staff { c'16 c' c' c' c'4 c' c'16 c' c' c' } } 8 Greetings, Ben Rudiak-Gould - I was hoping someone else would respond, but I haven't seen anything, so here goes . . . I know almost nothing about Scheme, so I won't try to evaluate your snippet. However, the function would be valuable, so I would encourage you to submit your snippet to the Snippet Repository so that others can use it. Do you want to make this a feature request? All the best, Ralph ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
I have hacked something up (see code below), but it doesn't work very well: * It works for slurs on either end as long as they span at least two notes. I can get it to work with single-note slurs at the end of the line by writing c'( s1*0) or c'( ), but I get the warning programming error: bounds of this piece aren't breakable. I haven't found a way to make it work with single-note slurs at the beginning of the line. * It works for lyric hyphens and extenders if there's an extra note with no lyric to extend to. I have to use as the lyric for this note, not _. This has the side effect that the lyric syllable isn't aligned properly at the end of the line (it's centered under the note instead of left-aligned). * I can't get it to work for ties in either direction no matter what I try. * It doesn't do anything to explicit beams (not that I suppose anyone would want to break beams this way), and it doesn't work properly with ligature brackets or tuplet brackets -- the bracket extends to the bar line but appears to begin/end there instead of being broken. MS, I hope you can tell me if there's a way to work around these problems in Scheme alone. -- Ben 8 \version 2.17.9 % This is necessary to avoid a warning #(set-object-property! 'fake-break-left 'backend-type? boolean?) #(set-object-property! 'fake-break-right 'backend-type? boolean?) #(define (fake-break-engraver score-context) (let ((last-barline #f) (open-spanners '())) (define (handle-barline barline) (set! last-barline barline) (set! open-spanners (filter try-extend-right open-spanners)) ) (define (try-extend-right spanner) (let ((still-open (null? (ly:spanner-bound spanner RIGHT (if (not still-open) (ly:spanner-set-bound! spanner RIGHT last-barline) ) still-open )) (define (handle-spanner-start spanner) (if (eq? #t (ly:grob-property spanner 'fake-break-left)) (if last-barline (ly:spanner-set-bound! spanner LEFT last-barline) )) (if (eq? #t (ly:grob-property spanner 'fake-break-right)) (set! open-spanners (cons spanner open-spanners)) )) `((acknowledgers (paper-column-interface . ,(lambda (engraver grob source-engraver) (if (and (eq? 'NonMusicalPaperColumn (assoc-ref (ly:grob-property grob 'meta) 'name) ) (not (null? (ly:grob-property grob 'measure-length))) ) (handle-barline grob) ))) (spanner-interface . ,(lambda (engraver grob source-engraver) (handle-spanner-start grob) )) \layout { \context { \Score \consists #fake-break-engraver } } \paper { ragged-right = ##t } \score { \new Staff { c' d' \once \override PhrasingSlur #'fake-break-right = ##t e'\( f'\) } \addlyrics { First to \once \override LyricHyphen #'fake-break-right = ##t sec -- } \new Staff { \once \override Slur #'fake-break-left = ##t g'( a') b'2 } \addlyrics { \once \override LyricHyphen #'fake-break-left = ##t _ -- ond. } \new Staff { c'16 c' c' c' c'4 c' c'16 c' c' c' } } 8 ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
On Mon, Dec 10, 2012 at 10:59 PM, m...@mikesolomon.org m...@mikesolomon.org wrote: The website says that the file cannot be accessed for copyright reasons. Could you post a public-domain score on a site that can be accessed by any user? It must be restricted by country since I can view it without any special privileges. It's the Works of Henry Purcell vol. 22: Catches, Rounds, Two-part and Three-part songs, published 1922. Here's another example: http://archive.org/stream/nationalsongbook00stan#page/n255/mode/2up She weepeth sore (middle right) has a tie and a lyric extender across parts, and a final half measure. -- Ben ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
On 11 déc. 2012, at 18:56, Ben Rudiak-Gould benrud...@gmail.com wrote: On Mon, Dec 10, 2012 at 10:59 PM, m...@mikesolomon.org m...@mikesolomon.org wrote: The website says that the file cannot be accessed for copyright reasons. Could you post a public-domain score on a site that can be accessed by any user? It must be restricted by country since I can view it without any special privileges. It's the Works of Henry Purcell vol. 22: Catches, Rounds, Two-part and Three-part songs, published 1922. Here's another example: http://archive.org/stream/nationalsongbook00stan#page/n255/mode/2up She weepeth sore (middle right) has a tie and a lyric extender across parts, and a final half measure. -- Ben Got it. In theory all of this is hackable via Scheme. What you'd wanna do is create custom engravers for both lyric extenders and ties. The engravers would attach these Spanners to the targeted note as well as the next or previous NonMusicalPaperColumn (and broken variants thereof). By attach I mean use them as left and right bounds. The rest should take care of itself - LilyPond already knows how to engrave most spanners between a NonMusicalPaperColumn and a note. Cheers, MS ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
On Tue, Dec 11, 2012 at 11:11:08PM +0100, Mike Solomon wrote: On 11 déc. 2012, at 22:58, Colin Hall colingh...@gmail.com wrote: On Tue, Dec 11, 2012 at 07:14:33PM +0100, Mike Solomon wrote: On 11 déc. 2012, at 18:56, Ben Rudiak-Gould benrud...@gmail.com wrote: On Mon, Dec 10, 2012 at 10:59 PM, m...@mikesolomon.org m...@mikesolomon.org wrote: The website says that the file cannot be accessed for copyright reasons. Could you post a public-domain score on a site that can be accessed by any user? It must be restricted by country since I can view it without any special privileges. It's the Works of Henry Purcell vol. 22: Catches, Rounds, Two-part and Three-part songs, published 1922. Here's another example: http://archive.org/stream/nationalsongbook00stan#page/n255/mode/2up She weepeth sore (middle right) has a tie and a lyric extender across parts, and a final half measure. -- Ben Got it. In theory all of this is hackable via Scheme. What you'd wanna do is create custom engravers for both lyric extenders and ties. The engravers would attach these Spanners to the targeted note as well as the next or previous NonMusicalPaperColumn (and broken variants thereof). By attach I mean use them as left and right bounds. The rest should take care of itself - LilyPond already knows how to engrave most spanners between a NonMusicalPaperColumn and a note. Cheers, MS Thanks for the suggestion, Ben. Mike, Ben, do you want a tracker for this? Are you going to design a custom engraver, Ben, using Mike's suggestion above, and try it out on your score first? Give me a title for the tracker that makes sense to you. I think perhaps Allow for non-continuing broken spanners. What would be awesome is to find a generic way to implement this for all spanners. Thanks, Mike, I've created a new tracker here: http://code.google.com/p/lilypond/issues/detail?id=3014 Cheers, Colin. -- Colin Hall ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond
Re: Feature request: some way of manually breaking slurs, ties and lyric extenders
On Tue, Dec 11, 2012 at 2:11 PM, m...@mikesolomon.org m...@mikesolomon.org wrote: I'll be able to work on it in 2026 - if someone wants it done before then, I can give pointers! Unless someone with more experience volunteers I'll try to hack together a Scheme proof of concept this weekend. I would definitely like those pointers. I know Scheme well but LilyPond guts hardly at all. -- Ben ___ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond