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 08:06:59 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 27/11/12 11:52, David Kastrup wrote:
#(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)

Thanks. Substituting that works well except when \repeat unfold is used inside the braces holding the music for the barre, when the console contains

warning: cannot find start of text spanner
warning: unterminated text spanner.

and the output is not what is desired.

\version "2.16.0"

#(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"
        \barre V { \repeat unfold 24 { c4 } }
}

Attachment: test.png
Description: PNG image


reply via email to

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