[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: barré variables and TextSpanner
From: |
Thomas Morley |
Subject: |
Re: barré variables and TextSpanner |
Date: |
Tue, 20 Nov 2012 00:34:28 +0100 |
2012/11/18 Federico Bruni <address@hidden>:
> 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
Hi Federico,
I made a template for creating a customized TextSpanner-function with
integrated \startTextSpan/\stopTextSpan-commands and added it to the
LSR:
http://lsr.dsi.unimi.it/LSR/Item?id=857
For 2.14.2 I used David Nalesnik's Code (linked in my previous mail).
For 2.16.0 I added my code above, commented.
Regards,
Harm
Re: barré variables and TextSpanner, Nick Payne, 2012/11/18