Re: Reverting TextSpanner properties
Hi Reggie, This is just my personal code for a string quartet I am doing, and my use case may be a little different to normal, as I have to set it all up to be able to do SP->NAT->SP continuous as well as plain SP->NAT, and ST->NAT, and so on, so there are more parts to this than just my initial query MWE. The code was not really proposed as a general purpose solution for this string playing technique. You're more than welcome to it, but perhaps we should work this up into a more robust and well thought out design pattern for inclusion in the LSR? Also needs to be parameterized to accept sul ponticello or sul tasto. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
On 2019-02-07 9:06 am, Reggie wrote: David Kastrup wrote Andrew Bernard andrew.bernard@ writes: Hi David, Really great advice and useful to know. However, I have a long section run of spanners for sul ponticello to natural. I did'nt want to tweak every occurrence for literally a hundred times, or call a function for each spanner each time. So it's kind of 'semi-permanent'. Well, it's a matter of sulPont = -\single \spToNatSpan \startTextSpan stopSulPont = -\endTextSpan And then you use \sulPont and \stopSulPont where you now use \startTextSpan and \stopTextSpan . I find that more straightforward than what you use but of course it is slightly less efficient. But probably not a measurable difference. -- David Kastrup ___ lilypond-user mailing list lilypond-user@ https://lists.gnu.org/mailman/listinfo/lilypond-user Hello David. I added your suggestions but nothing compiles correctly even after I replaced the functions you speak of. How can this be fixed to use your suggestion correctly? :)) It's \stopTextSpan, not \endTextSpan. Note that if you use \sulPont and \stopSulPont, you would no longer need (or want) to use \spToNatSpan explicitly. Also, you would still need to use \startTextSpan and \stopTextSpan to get the basic spanner. \version "2.19.82" spToNatSpan = { \override TextSpanner.font-size = #-4 \override TextSpanner.bound-padding = #1.0 \override TextSpanner.style = #'line \override TextSpanner.bound-details.right.arrow = ##t \override TextSpanner.bound-details.left.text = #"SP" \override TextSpanner.bound-details.right.text = #"NAT" \override TextSpanner.bound-details.right.padding = #0.6 \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left-broken.text = ##f \override TextSpanner.bound-details.right-broken.text = ##f } sulPont = -\single \spToNatSpan \startTextSpan stopSulPont = -\stopTextSpan treble = { \time 4/4 %% \spToNatSpan %% <== NOT NEEDED c''4\sulPont c'' c'' c''\stopSulPont | c'' c'' c''\sulPont c'' | c'' c'' c'' c'' | \break c'' c''\stopSulPont c'' c''\sulPont | \break c''\stopSulPont c'' c'' c'' | \break % how to revert to basic TextSpanner here? %% \revert TextSpanner.bound-details %% <== NOT NEEDED c''\startTextSpan c''\stopTextSpan c'' c'' | } \score { \new Staff \treble \layout {} } -- Aaron Hill ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
David Kastrup wrote > Andrew Bernard > andrew.bernard@ > writes: > >> Hi David, >> >> Really great advice and useful to know. However, I have a long section >> run >> of spanners for sul ponticello to natural. I did'nt want to tweak every >> occurrence for literally a hundred times, or call a function for each >> spanner each time. So it's kind of 'semi-permanent'. > > Well, it's a matter of > > sulPont = -\single \spToNatSpan \startTextSpan > stopSulPont = -\endTextSpan > > And then you use \sulPont and \stopSulPont where you now use > \startTextSpan and \stopTextSpan . I find that more straightforward > than what you use but of course it is slightly less efficient. But > probably not a measurable difference. > > -- > David Kastrup > > ___ > lilypond-user mailing list > lilypond-user@ > https://lists.gnu.org/mailman/listinfo/lilypond-user Hello David. I added your suggestions but nothing compiles correctly even after I replaced the functions you speak of. How can this be fixed to use your suggestion correctly? :)) % \version "2.19.82" spToNatSpan = { \override TextSpanner.font-size = #-4 \override TextSpanner.bound-padding = #1.0 \override TextSpanner.style = #'line \override TextSpanner.bound-details.right.arrow = ##t \override TextSpanner.bound-details.left.text = #"SP" \override TextSpanner.bound-details.right.text = #"NAT" \override TextSpanner.bound-details.right.padding = #0.6 \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left-broken.text = ##f \override TextSpanner.bound-details.right-broken.text = ##f } sulPont = -\single \spToNatSpan \startTextSpan stopSulPont = -\endTextSpan treble = { \time 4/4 \spToNatSpan c''4\sulPont c'' c'' c''\stopSulPont | c'' c'' c''\sulPont c'' | c'' c'' c'' c'' | \break c'' c''\stopSulPont c'' c''\sulPont | \break c''\stopSulPont c'' c'' c'' | \break % how to revert to basic TextSpanner here? \revert TextSpanner.bound-details c''\sulPont c''\stopSulPont c'' c'' | } \score { \new Staff \treble \layout {} } % -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Thank you everybody for all this help. It's fantastic, many ideas here, and I have learned so much. All good! Andrew On Thu, 7 Feb 2019 at 20:45, David Kastrup wrote: > Andrew Bernard writes: > > > Hi David, > > > > Really great advice and useful to know. However, I have a long section > run > > of spanners for sul ponticello to natural. I did'nt want to tweak every > > occurrence for literally a hundred times, or call a function for each > > spanner each time. So it's kind of 'semi-permanent'. > > Well, it's a matter of > > sulPont = -\single \spToNatSpan \startTextSpan > stopSulPont = -\endTextSpan > > And then you use \sulPont and \stopSulPont where you now use > \startTextSpan and \stopTextSpan . I find that more straightforward > than what you use but of course it is slightly less efficient. But > probably not a measurable difference. > > -- > David Kastrup > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Andrew Bernard writes: > Hi David, > > Really great advice and useful to know. However, I have a long section run > of spanners for sul ponticello to natural. I did'nt want to tweak every > occurrence for literally a hundred times, or call a function for each > spanner each time. So it's kind of 'semi-permanent'. Well, it's a matter of sulPont = -\single \spToNatSpan \startTextSpan stopSulPont = -\endTextSpan And then you use \sulPont and \stopSulPont where you now use \startTextSpan and \stopTextSpan . I find that more straightforward than what you use but of course it is slightly less efficient. But probably not a measurable difference. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Hi David, Really great advice and useful to know. However, I have a long section run of spanners for sul ponticello to natural. I did'nt want to tweak every occurrence for literally a hundred times, or call a function for each spanner each time. So it's kind of 'semi-permanent'. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Hello Pierre, This is helpful. I deduce from this that you can only use revert on bound-details as a while if you override it as a complete alist to begin with, not as separate overrides for each sub-property as I had. That's an important thing to know. Of course, to revert the other overrides, such as font-size, back to the system default, that would need a separate revert as well for these. I can find all the system defaults in the lilypond source code. I was hoping there may be some sort of \reset command, but this is a figment of my imagination. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Andrew Bernard writes: > I have a text spanner set up nicely to do sul ponticello -> nat. All works > beautifully. But how does one revert the overrides use to achieve this to > go back to a plain text spanner without undoing each and every line? \undo \spToNatSpan ? Personally, I'd rather tweak \startTextSpan rather than set properties permanently but that's likely a matter of taste. > Can't you just revert bound-details? > > Searching the list archives did not reveal anything for me. Perhaps a poor > choice of search keywords. > > I hope this is not one of those cases again where I should not be using > braces in the definition, but it won't compile if I don't. > > > Andrew > > > % > > \version "2.19.82" > > spToNatSpan = { > \override TextSpanner.font-size = #-4 > \override TextSpanner.bound-padding = #1.0 > \override TextSpanner.style = #'line > \override TextSpanner.bound-details.right.arrow = ##t > \override TextSpanner.bound-details.left.text = #"SP" > \override TextSpanner.bound-details.right.text = #"NAT" > \override TextSpanner.bound-details.right.padding = #0.6 > \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER > \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER > \override TextSpanner.bound-details.left-broken.text = ##f > \override TextSpanner.bound-details.right-broken.text = ##f > } > > treble = { > \time 4/4 > > \spToNatSpan > c''4\startTextSpan c'' c'' c''\stopTextSpan | > c'' c'' c''\startTextSpan c'' | > c'' c'' c'' c'' | > \break > c'' c''\stopTextSpan c'' c''\startTextSpan | > \break > c''\stopTextSpan c'' c'' c'' | > \break > % how to revert to basic TextSpanner here? > \revert TextSpanner.bound-details > c''\startTextSpan c''\stopTextSpan c'' c'' | > } > > \score { > \new Staff \treble > \layout {} > } > > % > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Reverting TextSpanner properties
Hi Andrew, How about: %% \version "2.19.82" spToNatSpanOld = { \override TextSpanner.font-size = #-4 \override TextSpanner.bound-padding = #1.0 \override TextSpanner.style = #'line \override TextSpanner.bound-details = #`((right (Y . 0) (arrow . #t) (text . ,#{ \markup "NAT"#}) (padding . 0.6) (stencil-align-dir-y . CENTER)) (left (Y . 0) (text . ,#{ \markup "SP" #}) (stencil-align-dir-y . CENTER)) (right-broken (text . #f)) (left-broken (text . #f))) } treble = { \time 4/4 \spToNatSpanOld c''4\startTextSpan c'' c'' c''\stopTextSpan | c'' c'' c''\startTextSpan c'' | c'' c'' c'' c'' | \break c'' c''\stopTextSpan c'' c''\startTextSpan | \break c''\stopTextSpan c'' c'' c'' | \break % how to revert to basic TextSpanner here? \revert TextSpanner.bound-details c''\startTextSpan c''\stopTextSpan c'' c'' | } \score { \new Staff \treble \layout {} } %% Cheers, Pierre Le jeu. 7 févr. 2019 à 08:58, Andrew Bernard a écrit : > I have a text spanner set up nicely to do sul ponticello -> nat. All works > beautifully. But how does one revert the overrides use to achieve this to > go back to a plain text spanner without undoing each and every line? Can't > you just revert bound-details? > > Searching the list archives did not reveal anything for me. Perhaps a poor > choice of search keywords. > > I hope this is not one of those cases again where I should not be using > braces in the definition, but it won't compile if I don't. > > > Andrew > > > % > > \version "2.19.82" > > spToNatSpan = { > \override TextSpanner.font-size = #-4 > \override TextSpanner.bound-padding = #1.0 > \override TextSpanner.style = #'line > \override TextSpanner.bound-details.right.arrow = ##t > \override TextSpanner.bound-details.left.text = #"SP" > \override TextSpanner.bound-details.right.text = #"NAT" > \override TextSpanner.bound-details.right.padding = #0.6 > \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER > \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER > \override TextSpanner.bound-details.left-broken.text = ##f > \override TextSpanner.bound-details.right-broken.text = ##f > } > > treble = { > \time 4/4 > > \spToNatSpan > c''4\startTextSpan c'' c'' c''\stopTextSpan | > c'' c'' c''\startTextSpan c'' | > c'' c'' c'' c'' | > \break > c'' c''\stopTextSpan c'' c''\startTextSpan | > \break > c''\stopTextSpan c'' c'' c'' | > \break > % how to revert to basic TextSpanner here? > \revert TextSpanner.bound-details > c''\startTextSpan c''\stopTextSpan c'' c'' | > } > > \score { > \new Staff \treble > \layout {} > } > > % > > > > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Reverting TextSpanner properties
I have a text spanner set up nicely to do sul ponticello -> nat. All works beautifully. But how does one revert the overrides use to achieve this to go back to a plain text spanner without undoing each and every line? Can't you just revert bound-details? Searching the list archives did not reveal anything for me. Perhaps a poor choice of search keywords. I hope this is not one of those cases again where I should not be using braces in the definition, but it won't compile if I don't. Andrew % \version "2.19.82" spToNatSpan = { \override TextSpanner.font-size = #-4 \override TextSpanner.bound-padding = #1.0 \override TextSpanner.style = #'line \override TextSpanner.bound-details.right.arrow = ##t \override TextSpanner.bound-details.left.text = #"SP" \override TextSpanner.bound-details.right.text = #"NAT" \override TextSpanner.bound-details.right.padding = #0.6 \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER \override TextSpanner.bound-details.left-broken.text = ##f \override TextSpanner.bound-details.right-broken.text = ##f } treble = { \time 4/4 \spToNatSpan c''4\startTextSpan c'' c'' c''\stopTextSpan | c'' c'' c''\startTextSpan c'' | c'' c'' c'' c'' | \break c'' c''\stopTextSpan c'' c''\startTextSpan | \break c''\stopTextSpan c'' c'' c'' | \break % how to revert to basic TextSpanner here? \revert TextSpanner.bound-details c''\startTextSpan c''\stopTextSpan c'' c'' | } \score { \new Staff \treble \layout {} } % ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user