2012/11/28 Nick Payne <nick.pa...@internode.on.net>: > On 28/11/12 09:35, Thomas Morley wrote: > > Although I can confirm your observation, I asked myself: How would I > use a TextSpanner to span a repeat-unfold-expression with pure > LilyPond-syntax? > > I couldn't find any reasonable method. > > The following doesn't work (ofcourse not): > > \relative c { > \clef "treble_8" > \override TextSpanner #'(bound-details left text) = #"B V" > \startTextSpan > \repeat unfold 24 { c4 } \stopTextSpan > } > > How to do? > > > My previous example was quite artificial, but here's part of an actual score > where I would want to indicate a barre - it's from a transcription of > Haydn's string quartet Op 2 No 1, transcribed for guitar duet by the 19th > century guitarist François de Fossa. Guitar 2 plays a lot of repeated chords > like this, sometimes the same chord for several bars. Here the console > doesn't indicate any error, but the barre doesn't display. > > \version "2.16.0" > > beamTuplets = \set beamExceptions = > #'((end . (((1 . 24) . (3 3 3 3))))) > > > > #(define (text-spanner-start-stop mus) > (let ((elts (extract-typed-music mus 'rhythmic-event))) > (for-each > (lambda (sel) > (let ((m (sel elts))) > (set! (ly:music-property m 'articulations) > (cons (make-music 'TextSpanEvent > 'span-direction (sel '(-1 1))) > (ly:music-property m 'articulations))))) > (list last first))) > mus) > > barre = > #(define-music-function (parser location strg music)(string? ly:music?) > (let ((arg (string-append "B " strg))) > #{ > \override TextSpanner #'(bound-details left text) = $arg > #(text-spanner-start-stop music) > #})) > > \relative c' { > \clef "treble_8" > \time 2/4 > \key d \major > << > { > \beamTuplets > \set tupletSpannerDuration = #(ly:make-moment 1 8) > \barre II { \times 2/3 { \repeat unfold 12 { <a e>16 } } } > } > \\ > { > \beamTuplets > \set fingeringOrientations = #'(left) > \set tupletSpannerDuration = #(ly:make-moment 1 8) > \times 2/3 { <cis,-4> \repeat unfold 11 { cis16 } } > } > >> > } > > > _______________________________________________ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user >
Hi Nick, apart from the repeat-unfold-problem there's an additional one, due to the chord at the end of the TextSpanner. Compare the output of: \displayMusic { \override TextSpanner #'(bound-details left text) = #"II" c1\startTextSpan <d f>\stopTextSpan } \displayMusic { \barre II { c1 <d f> } } and you'll see that (list (make-music 'TextSpanEvent 'span-direction 1)) is placed differently. But I doubt I can work on this the next days. Regards, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user