TextSpanner: Change text at automatic line break?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TextSpanner: Change text at automatic line break?

James Harkins-4
Hi,

Using a TextSpanner, is there a way to change the text in the middle, so that the new text appears at the next system break (whichever bar that is)?

\version "2.19.80"
\language "english"

\relative c' {
  \override TextSpanner.bound-details.left.text = "abc"
  c1 \startTextSpan
  \repeat unfold 20 { c1 }
  c1\stopTextSpan
}

With default settings, LP engraves 11 bars on the first line, putting bar 12 on the next. I know I could stop the spanner at the end of bar 11 and start a new one on bar 12, but future changes might move the line breaks, so I would rather not have to hardcode. I would like to set some property in the middle of the spanner and have it take effect at the next automatic system break.

I tried overriding TextSpanner.bound-details.left.text -- no difference on the second line.

Same for TextSpanner.bound-details.left-broken.text -- if "left-broken" has a text property, it's ignored for rendering.

If it's too hard, I can change the notation style. (It's a score for computer ensemble. The text indicates which patch and which variant to play. The variant might change in the middle. I'd like the text to change accordingly. If it isn't possible, I'll use the spanner only for the patch name, and put the variant underneath.)

Thanks,
James


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: TextSpanner: Change text at automatic line break?

Thomas Morley-2
2018-05-21 12:28 GMT+02:00 James Harkins <[hidden email]>:

> Hi,
>
> Using a TextSpanner, is there a way to change the text in the middle, so that the new text appears at the next system break (whichever bar that is)?
>
> \version "2.19.80"
> \language "english"
>
> \relative c' {
>   \override TextSpanner.bound-details.left.text = "abc"
>   c1 \startTextSpan
>   \repeat unfold 20 { c1 }
>   c1\stopTextSpan
> }
>
> With default settings, LP engraves 11 bars on the first line, putting bar 12 on the next. I know I could stop the spanner at the end of bar 11 and start a new one on bar 12, but future changes might move the line breaks, so I would rather not have to hardcode. I would like to set some property in the middle of the spanner and have it take effect at the next automatic system break.
>
> I tried overriding TextSpanner.bound-details.left.text -- no difference on the second line.
>
> Same for TextSpanner.bound-details.left-broken.text -- if "left-broken" has a text property, it's ignored for rendering.
>
> If it's too hard, I can change the notation style. (It's a score for computer ensemble. The text indicates which patch and which variant to play. The variant might change in the middle. I'd like the text to change accordingly. If it isn't possible, I'll use the spanner only for the patch name, and put the variant underneath.)
>
> Thanks,
> James


Hi,

  \relative c' {
    \override TextSpanner.bound-details.left.text = "abc"
    \override TextSpanner.bound-details.left-broken.text = "foo"
    c1 \startTextSpan
    \repeat unfold 20 { c1 }
    c1\stopTextSpan
  }

works here. A typo somewhere?


Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: TextSpanner: Change text at automatic line break?

James Harkins-4
---- On Mon, 21 May 2018 19:12:56 +0800 Thomas Morley <[hidden email]> wrote ----
>   \relative c' {
>     \override TextSpanner.bound-details.left.text = "abc"
>     \override TextSpanner.bound-details.left-broken.text = "foo"
>     c1 \startTextSpan
>     \repeat unfold 20 { c1 }
>     c1\stopTextSpan
>   }
>  
> works here. A typo somewhere?

Oh, OK, I see -- I have to set the left-broken details before starting the text spanner, and those details can't change.

It's possible that I might have a spanner covering three or more systems, where the text might need to change twice (or more). So I was setting the left-broken details in the middle, hoping it would take effect at the next system break. But I guess the object is already created and its properties already determined, and there's no going back to modify the current instance (not without Scheme anyway, for which I don't have time, and it doesn't matter if I notate it this way or another way).

OK, I'll consider another strategy.

Thanks,
James


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: TextSpanner: Change text at automatic line break?

Kieren MacMillan
Hi James,

> It's possible that I might have a spanner covering three or more systems, where the text might need to change twice (or more).

You should look at David N's incredible spanner-with-inner-texts (or similarly named) — I'm pretty sure it’ll do all that (and more).

Hope this helps!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: TextSpanner: Change text at automatic line break?

James Harkins-4
On May 22, 2018 10:51:12 Kieren MacMillan <[hidden email]>
wrote:

> You should look at David N's incredible spanner-with-inner-texts (or
> similarly named) — I'm pretty sure it’ll do all that (and more).

Aha -- that just might be the droid I'm looking for. Will search.

Thanks!
James

Sent with AquaMail for Android
http://www.aqua-mail.com




_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user