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: David Kastrup
Subject: Re: unicode fractions for barre indications
Date: Mon, 24 Dec 2012 00:42:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Nick Payne <address@hidden> writes:

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

How about

#(define (text-spanner-start-stop mus)
  (let* ((l (extract-typed-music mus '(event-chord rhythmic-event)))
         (b (first l))
         (e (last l)))
     (set! (ly:music-property e 'articulations)
           (cons (make-music 'TextSpanEvent 'span-direction STOP)
                 (ly:music-property e 'articulations)))
     (set! (ly:music-property b 'articulations)
           (cons (make-music 'TextSpanEvent 'span-direction START)
                 (ly:music-property b 'articulations)))
     mus))

?

This should have a better hit/miss ratio.

-- 
David Kastrup




reply via email to

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