lilypond-user
[Top][All Lists]
Advanced

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

Re: review of a Mutopia file (why TabStaff gives error here?)


From: Nick Payne
Subject: Re: review of a Mutopia file (why TabStaff gives error here?)
Date: Wed, 28 Nov 2012 10:19:23 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

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 } }
    }
  >>
}


reply via email to

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