[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using \startTextSpan and \stopTextSpan in separate music functions
From: |
David Kastrup |
Subject: |
Re: Using \startTextSpan and \stopTextSpan in separate music functions |
Date: |
Sat, 17 Sep 2016 00:48:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
tisimst <address@hidden> writes:
> On Fri, Sep 16, 2016 at 3:50 PM, Thomas Morley-2 [via Lilypond] <
> address@hidden> wrote:
>
>>
>> Your function doesn't integrate \start/stopTextSpan into the
>> 'articulations of the music-arg, which is needed.
>> A most boiled down example would be:
>>
>> mus = c'1
>> { \mus \tenuto }
>>
>>
>> Would be probably nice to have it work, but I seem to remember there
>> are some problems, forgot what exactly though.
>>
>> Your function could be done at the lines of:
>>
>> myStartTextSpan = #(define-music-function (mus) (ly:music?)
>> (ly:music-set-property! mus 'articulations
>> (cons #{ \startTextSpan #}
>> (ly:music-property mus 'articulations)))
>> #{
>> \override TextSpanner.color = #red
>> #mus
>> #})
That assumes that $mus is an actual expression capable of accepting
articulations (which { c } wouldn't).
I'd rather write
#{
<>-\tweak color #red \startTextSpan
$mus
#}
and then that begs the question why to use a music function in the first
place rather than just writing
myStartTextSpan = <>-\tweak color #red \startTextSpan
--
David Kastrup