lilypond-user
[Top][All Lists]
Advanced

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

Re: unicode fractions for barre indications


From: Nick Payne
Subject: Re: unicode fractions for barre indications
Date: Mon, 24 Dec 2012 10:07:29 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 24/12/12 08:27, Federico Bruni wrote:
Il 23/12/2012 21:06, Nick Payne ha scritto:

I believe only 1/6 and 5/6 exist as Unicode characters. In mathematical
notation one would use 1/3, 2/3, and 1/2, so 2/6, 4/6, and 3/6 are not
provided.

I notate a barre with a partial indicator like so:

Thanks for the reminder... I remember you had already posted it, lazy me!
It's quite nice, even if you always have to specify the number of strings even for the default barré (6 strings).

Can it be adapted to this function?
http://lists.gnu.org/archive/html/lilypond-user/2012-12/msg00825.html

I see that $strg must be replaced by $fretnum, but I don't know how to handle ly:music? and $music.

Yes, you can do it like so:

#(define (text-spanner-start-stop mus)
  (let ((elts (ly:music-property mus '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))))))

bbarre = #(define-music-function (parser location fretnum partial music)
  (number? number? ly:music?)
  #{
\once\override TextSpanner.bound-details.left.text = \markup\small\bold\concat { #(format #f "address@hidden" fretnum) \raise #0.8 \sub #(number->string partial) }
    \once\override TextSpanner.font-shape = #'upright
    \once\override TextSpanner.style = #'line
\once\override TextSpanner.bound-details.right.text = \markup { \draw-line #'(0 . -1) } \once\override TextSpanner.bound-details.left.stencil-align-dir-y = #0.35
    \once\override TextSpanner.bound-details.left.padding = #-0.25
    \once\override TextSpanner.bound-details.right.padding = #-1
    \once\override TextSpanner.bound-details.right-broken.padding = #0.5
    \once\override TextSpanner.bound-details.left-broken.padding = #2
    \once\override TextSpanner.bound-details.left-broken.text = ##f
    \once\override TextSpanner.bound-details.right-broken.text = ##f
    #(text-spanner-start-stop music)
  #}
)

But that barre function doesn't work correctly in several situations. If you try to notate the first barre in my example using the function above:

\barre2 3 { c4 c c \times 2/3 { c8 c c\stopTextSpan } }

what happens is that rather than continuing to the end of the tuplet, the barre indication terminates on the first note of the tuplet. So even though the version above gives a more compact and less cluttered source file, I've continued to use the version with \startTextSpan and \stopTextSpan.



reply via email to

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