lilypond-user
[Top][All Lists]
Advanced

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

Re: Using \startTextSpan and \stopTextSpan in separate music functions


From: tisimst
Subject: Re: Using \startTextSpan and \stopTextSpan in separate music functions
Date: Fri, 16 Sep 2016 15:22:49 -0700 (MST)

On Fri, Sep 16, 2016 at 3:50 PM, Thomas Morley-2 [via Lilypond] <[hidden email]> 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
  #})

\relative c' {
  \myStartTextSpan b'1
  c \stopTextSpan
}

Brilliant, Harm! I figured I just wasn't understanding the mechanism correctly. Now a similar function is easily created to do the custom termination:

myStopTextSpan = #(define-music-function (mus) (ly:music?)
  (ly:music-set-property! mus 'articulations
    (cons #{ \stopTextSpan #}
      (ly:music-property mus 'articulations)))
  #{
    #mus
    <>^\markup \italic "a tempo"
  #})

to get

\relative c' {
  \myStartTextSpan b'1
  \myStopTextSpan c1
  d1
}

Thanks for the explanation and a usable solution!

Best,
Abraham


View this message in context: Re: Using \startTextSpan and \stopTextSpan in separate music functions
Sent from the User mailing list archive at Nabble.com.

reply via email to

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