lilypond-user
[Top][All Lists]
Advanced

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

Re: barré variables and TextSpanner


From: Federico Bruni
Subject: Re: barré variables and TextSpanner
Date: Sun, 18 Nov 2012 18:34:22 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.10) Gecko/20121028 Icedove/10.0.10

Il 18/11/2012 18:10, Thomas Morley ha scritto:
So see my own coding below.

\version "2.16.0"

barre =
#(define-music-function (parser location strg music)(string? ly:music?)
    (let ((arg (string-append "B " strg)))
       #{
          \override TextSpanner #'(bound-details left text) = $arg

          #(let ((elts (ly:music-property music 'elements)))
               (make-music 'SequentialMusic 'elements
                  (append
                     (list (make-music 'TextSpanEvent 'span-direction -1))
                     (reverse (cdr (reverse elts)))
                     (list (make-music 'TextSpanEvent 'span-direction 1))
                     (list (last elts)))))
       #}))

\relative c' {
         \barre I { c4  d e f }
         \barre II { g a b c }
}

Wonderful!
It reduces the width of the lines in the input and it's also more user-friendly.

Can you add it to the LSR?
.. maybe you have to wait for the LSR to be upgraded to 2.16?

I think that I'll use this snippet for a Mutopia file I'm updating to 2.16

Best,
--
Federico



reply via email to

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