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

2016-09-16 Thread David Kastrup
tisimst  writes:

> On Fri, Sep 16, 2016 at 3:50 PM, Thomas Morley-2 [via Lilypond] <
> ml-node+s1069038n194649...@n5.nabble.com> 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

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


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

2016-09-16 Thread tisimst
On Fri, Sep 16, 2016 at 3:50 PM, Thomas Morley-2 [via Lilypond] <
ml-node+s1069038n194649...@n5.nabble.com> 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: 
http://lilypond.1069038.n5.nabble.com/Using-startTextSpan-and-stopTextSpan-in-separate-music-functions-tp194647p194650.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


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

2016-09-16 Thread Thomas Morley
2016-09-16 23:20 GMT+02:00 Abraham Lee :
> All,
>
> Going off the of the thread here:
>
> http://lists.gnu.org/archive/html/lilypond-user/2016-09/msg00374.html
>
> and some personal email exchanges, I tried out a few things (found a working
> solution, though not ideal) and ran into something curious. I'd like to do
> something like the following, but it doesn't seem to work:
>
> %
>
> \version "2.19.36"
>
> myStartTextSpan = #(define-music-function (mus) (ly:music?)
> #{
>   \once \override TextSpanner.bound-details.left.text = "rit."
>   $mus \startTextSpan
> #})
>
> myStopTextSpan = #(define-music-function (mus) (ly:music?)
> #{
>   $mus \stopTextSpan
>   <>^\markup \italic "a tempo"
> #})
>
> \relative c' {
>   \myStartTextSpan b'1
>   c1
>   \myStopTextSpan e,1
>   g1
> }
>
> %
>
> This results in "unexpected EVENT_IDENTIFIER" errors at both
>
>   $mus \startTextSpan
>
> and
>
>   $mus \stopTextSpan
>
> When I put everything into a single expression without using music
> functions, it works as expected:
>
> %
>
> \version "2.19.36"
>
> \relative c' {
>   \override TextSpanner.bound-details.left.text = "rit."
>   b'1\startTextSpan
>   c1
>   e,1\stopTextSpan
>   <>^\markup \italic "a tempo"
>   g1
> }
>
> %
>
> This is just a simple example. The real use-case has numerous other
> \override statements that should occur prior to \startTextSpan, but the
> general idea is the same.
>
> Anyone know what's going on here?
>
> Best,
> Abraham


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
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Using \startTextSpan and \stopTextSpan in separate music functions

2016-09-16 Thread Abraham Lee
All,

Going off the of the thread here:

http://lists.gnu.org/archive/html/lilypond-user/2016-09/msg00374.html

and some personal email exchanges, I tried out a few things (found a
working solution, though not ideal) and ran into something curious. I'd
like to do something like the following, but it doesn't seem to work:

%

\version "2.19.36"

myStartTextSpan = #(define-music-function (mus) (ly:music?)
#{
  \once \override TextSpanner.bound-details.left.text = "rit."
  $mus \startTextSpan
#})

myStopTextSpan = #(define-music-function (mus) (ly:music?)
#{
  $mus \stopTextSpan
  <>^\markup \italic "a tempo"
#})

\relative c' {
  \myStartTextSpan b'1
  c1
  \myStopTextSpan e,1
  g1
}

%

This results in "unexpected EVENT_IDENTIFIER" errors at both

  $mus \startTextSpan

and

  $mus \stopTextSpan

When I put everything into a single expression without using music
functions, it works as expected:

%

\version "2.19.36"

\relative c' {
  \override TextSpanner.bound-details.left.text = "rit."
  b'1\startTextSpan
  c1
  e,1\stopTextSpan
  <>^\markup \italic "a tempo"
  g1
}

%

This is just a simple example. The real use-case has numerous other
\override statements that should occur prior to \startTextSpan, but the
general idea is the same.

Anyone know what's going on here?

Best,
Abraham
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user