Re: textSpanner - disable repeat of text on new line

2023-10-07 Thread Bevan Broun
Thanks Leo - perfect.



On Sun, Oct 8, 2023 at 8:34 AM Leo Correia de Verdier <
leo.correia.de.verd...@gmail.com> wrote:

> Hi Bevan!
>
> I think what you are looking for is:
>
> \override TextSpanner.bound-details.left-broken.text = ##f
>
> HTH
> /Leo
>
> > 7 okt. 2023 kl. 21:13 skrev Bevan Broun :
> >
> > Hi All
> >
> > When using a text spanner I get the text repeated after a line break,
> followed by new dashes. Can I disable getting the repeat of the text and
> only get dashes on the new line? I have a case where the repeated text is
> banging up against some other text and it would be clearer with just dashes
> on the new line.
> >
> > Thanks
> >
> > \version "2.22.2"
> >
> > mybar = { c4 d c d }
> > \score {
> >   \relative c' {
> > \mybar \mybar \mybar
> > \override TextSpanner.bound-details.left.text = "poco a poco
> accelerando"
> > c \startTextSpan d c d
> > \mybar
> > \mybar \break
> > \mybar
> > \stopTextSpan
> > \tempo "Tempo I"
> > \mybar \mybar \mybar \mybar
> >   }
> > }
> >
> >
>
>


Re: textSpanner - disable repeat of text on new line

2023-10-07 Thread Knute Snortum
On Sat, Oct 7, 2023 at 1:39 PM Bevan Broun  wrote:

> Hi All
>
> When using a text spanner I get the text repeated after a line break,
> followed by new dashes. Can I disable getting the repeat of the text and
> only get dashes on the new line? I have a case where the repeated text is
> banging up against some other text and it would be clearer with just dashes
> on the new line.
>
> Thanks
>
> \version "2.22.2"
>
> mybar = { c4 d c d }
> \score {
>   \relative c' {
> \mybar \mybar \mybar
> \override TextSpanner.bound-details.left.text = "poco a poco
> accelerando"
> c \startTextSpan d c d
> \mybar
> \mybar \break
> \mybar
> \stopTextSpan
> \tempo "Tempo I"
> \mybar \mybar \mybar \mybar
>   }
> }
>

Try using:

 \override TextSpanner.bound-details.left-broken.text = ""

like this:

\version "2.22.2"

mybar = { c4 d c d }
\score {
  \relative c' {
\mybar \mybar \mybar
\override TextSpanner.bound-details.left.text = "poco a poco
accelerando"
\override TextSpanner.bound-details.left-broken.text = "" % <-- add this
c \startTextSpan d c d
\mybar
\mybar \break
\mybar
\stopTextSpan
\tempo "Tempo I"
\mybar \mybar \mybar \mybar
  }
}


--
Knute Snortum


Re: textSpanner - disable repeat of text on new line

2023-10-07 Thread Leo Correia de Verdier
Hi Bevan!

I think what you are looking for is:

\override TextSpanner.bound-details.left-broken.text = ##f

HTH
/Leo

> 7 okt. 2023 kl. 21:13 skrev Bevan Broun :
> 
> Hi All
> 
> When using a text spanner I get the text repeated after a line break, 
> followed by new dashes. Can I disable getting the repeat of the text and only 
> get dashes on the new line? I have a case where the repeated text is banging 
> up against some other text and it would be clearer with just dashes on the 
> new line.
> 
> Thanks
> 
> \version "2.22.2"
> 
> mybar = { c4 d c d }
> \score {
>   \relative c' {
> \mybar \mybar \mybar
> \override TextSpanner.bound-details.left.text = "poco a poco accelerando" 
> c \startTextSpan d c d
> \mybar
> \mybar \break
> \mybar
> \stopTextSpan 
> \tempo "Tempo I" 
> \mybar \mybar \mybar \mybar 
>   } 
> }
> 
> 




textSpanner - disable repeat of text on new line

2023-10-07 Thread Bevan Broun
Hi All

When using a text spanner I get the text repeated after a line break,
followed by new dashes. Can I disable getting the repeat of the text and
only get dashes on the new line? I have a case where the repeated text is
banging up against some other text and it would be clearer with just dashes
on the new line.

Thanks

\version "2.22.2"

mybar = { c4 d c d }
\score {
  \relative c' {
\mybar \mybar \mybar
\override TextSpanner.bound-details.left.text = "poco a poco
accelerando"
c \startTextSpan d c d
\mybar
\mybar \break
\mybar
\stopTextSpan
\tempo "Tempo I"
\mybar \mybar \mybar \mybar
  }
}


Re: \vshape and custom curve-stencil for TextSpanner

2022-07-23 Thread Thomas Morley
Am Sa., 23. Juli 2022 um 16:06 Uhr schrieb Jean Abou Samra :
>
> Hi Harm,
>
>
> Le 23/07/2022 à 10:59, Thomas Morley a écrit :
> > I'm attempting to create a s-curve stencil for TextSpanner.
> > While so far all works as wished and it is possibel to use \shape,
> > \vshape doesn't print the control-points.
> >
> > What am I missing?
>
>
> \shape works because it's an override/tweak to the control-points
> property, and your code reads this property.
>
> \vshape is implemented with separate grobs, ControlPoint and
> ControlPolygon. This is so that you can override their basic
> properties (color, layer, thickness, ...) independently from the
> bezier grob. They are created by the Show_control_points_engraver,
> which acknowledges bezier curve grobs and reads their
> show-control-points-property. Your custom TextSpanner isn't
> recognized because it doesn't have the bezier-curve-interface,
> and this is what Show_control_points_engraver acknowledges.

Thanks, for your detailed explanation.
To get around it one could do:

#(define (add-to-interfaces iface name grob-descriptions-alist)
  (map
(lambda (x)
  (if (eq? (car x) name)
  (let* (;; Use `list-copy' like `completize-grob-entry' in
 ;; scm/define-grobs.scm
 (grob-entry (map list-copy (cdr x)))
 ;; Though why here again?
 (meta-entry (map list-copy (assoc-get 'meta grob-entry)))
 ;; and not here?
 (ifaces-entry
  (assoc-get 'interfaces meta-entry)))
(set! ifaces-entry (cons iface ifaces-entry))
(set! meta-entry (assoc-set! meta-entry 'interfaces ifaces-entry))
(set! grob-entry (assoc-set! grob-entry 'meta meta-entry))
(cons name grob-entry))
  x))
   grob-descriptions-alist))

\layout {
  \context {
\Global
\grobdescriptions
  #(add-to-interfaces
'bezier-curve-interface
'TextSpanner
    all-grob-descriptions)
  }
}

> Do you have a specific reason to use a TextSpanner? How
> about using a Slur?

Well, I need to directly connect two notes/rests, probably with a lot
of other stuff in between.
For this connection several styles are possible
(1) A straight line (maybe dashed or dotted)
Thus TextSpanner was my first thought. Alas, in most cases the line will
not be horizontal so I need some stencil override anyway.
Pretty simple, though, can be made to work automatically.
(2) A curve, probably a s-curve.
Thus current thread topic
(3) A multiple kneed line:
 
|___||
 v
(the graphic will likely not survive mail delivery unchanged, though
maybe you can imagine it)

To summarize, all three possibilities will need other stencils.
If control-points are available (Slur) it is probably not hard to get to (1).
For (2), a Slur may be good out of the box, otherwise vshape will always work.
For kneed lines (3), make connected-path-stencil may work.

All three possibilities can be made to work with TextSpanner and Slur.
I think I have to experiment, what works out better.

Thanks,
  Harm



Re: \vshape and custom curve-stencil for TextSpanner

2022-07-23 Thread Jean Abou Samra

Hi Harm,


Le 23/07/2022 à 10:59, Thomas Morley a écrit :

I'm attempting to create a s-curve stencil for TextSpanner.
While so far all works as wished and it is possibel to use \shape,
\vshape doesn't print the control-points.

What am I missing?



\shape works because it's an override/tweak to the control-points
property, and your code reads this property.

\vshape is implemented with separate grobs, ControlPoint and
ControlPolygon. This is so that you can override their basic
properties (color, layer, thickness, ...) independently from the
bezier grob. They are created by the Show_control_points_engraver,
which acknowledges bezier curve grobs and reads their
show-control-points-property. Your custom TextSpanner isn't
recognized because it doesn't have the bezier-curve-interface,
and this is what Show_control_points_engraver acknowledges.
Do you have a specific reason to use a TextSpanner? How
about using a Slur?



Code below.
Thanks to Jean how fixed make-path-stencil!



You're welcome :-)

Best,
Jean




\vshape and custom curve-stencil for TextSpanner

2022-07-23 Thread Thomas Morley
Hi,

I'm attempting to create a s-curve stencil for TextSpanner.
While so far all works as wished and it is possibel to use \shape,
\vshape doesn't print the control-points.

What am I missing?

Code below.
Thanks to Jean how fixed make-path-stencil!

Thanks,
  Harm

\version "2.23.11"

#(define (make-s-curve-stencil line-thickness thickness control-points)
  (let* ((start-pt (car control-points))
 (end-pt (last control-points))
 (lngth (- (car end-pt) (car start-pt)))
 (second-cp (second control-points))
 (third-cp (third control-points))
 (second-delta
   (* (- (car second-cp) (car start-pt)) (/ thickness (/ lngth 2
 (second-out
   (cons (car second-cp)
 (+ (cdr second-cp) second-delta)))
 (second-in
   (cons (car second-cp)
 (- (cdr second-cp) second-delta)))
 (third-delta
   (* (- (car end-pt) (car third-cp)) (/ thickness (/ lngth 2
 (third-out
   (cons (car third-cp)
 (+ (cdr third-cp) third-delta)))
 (third-in
   (cons (car third-cp)
 (- (cdr third-cp) third-delta)))
 (coord-list
   (list
 start-pt
 second-out
 third-out
 end-pt
 third-in
 second-in)))
((@@ (lily) make-bezier-sandwich-stencil) coord-list line-thickness)))

#(define horizontal-spanner-cps
  (lambda (grob)
(let* ((left-info (ly:grob-property grob 'left-bound-info))
   (right-info (ly:grob-property grob 'right-bound-info))
   (left-x (assoc-get 'X left-info))
   (right-x (assoc-get 'X right-info))
   (lngth (- right-x left-x))
   (height 2)
   (cp-2 (cons (* lngth 0.25) height))
   (cp-3 (cons (* lngth 0.75) (- height
  (list
'(0 . 0)
cp-2
cp-3
(cons (- right-x left-x) 0)

#(define text-spanner::s-curve-stencil
  (lambda (grob)
(let* ((layout (ly:grob-layout grob))
   (line-thick (ly:output-def-lookup layout 'line-thickness))
   (thickness (ly:grob-property grob 'thickness 1.2))
   (thick (* line-thick thickness)))
;(box-stencil
 (make-s-curve-stencil line-thick thick
   (ly:grob-property grob 'control-points))
; 0 0)
)))

{
  \override TextSpanner.control-points = #horizontal-spanner-cps
  \override TextSpanner.show-control-points = ##t
  \override TextSpanner.stencil = #text-spanner::s-curve-stencil

  \vshape #'((0 . 0)(0 . 10)(0 . -10)(0 . 0)) TextSpanner
  b1\startTextSpan
  b\stopTextSpan
}



Re: `TextSpanner` vs. `DynamicTextSpanner`

2022-03-05 Thread Jean Abou Samra

Le 05/03/2022 à 17:19, Werner LEMBERG a écrit :

Sometimes, this would be very helpful, yes (see attached image from
the last scene of 'Wozzeck').  I guess a possible work-around would
be to (ab)use `DynamicTextSpanner` for that.

[...] There is also this kind of code: [...]  See issue #3176.

Very nice, thanks!  Maybe this should be added?





Definitely, but I really, really have too many projects dragging
for months to personally look into it more closely before much
time, sorry. On the other hand, if someone wants to do it, I'll
be happy to assist.


Best,
Jean






Re: `TextSpanner` vs. `DynamicTextSpanner`

2022-03-05 Thread Werner LEMBERG


>> Sometimes, this would be very helpful, yes (see attached image from
>> the last scene of 'Wozzeck').  I guess a possible work-around would
>> be to (ab)use `DynamicTextSpanner` for that.
> 
> [...] There is also this kind of code: [...]  See issue #3176.

Very nice, thanks!  Maybe this should be added?


Werner



Re: `TextSpanner` vs. `DynamicTextSpanner`

2022-03-04 Thread Jean Abou Samra

Le 04/03/2022 à 05:00, Werner LEMBERG a écrit :

Is there a similar auxiliary grob for `TextSpanner`?

No, since consecutive text spanners are not aligned vertically.

{
   c'1\tweak bound-details.left.text "aaa" \startTextSpan
   c'1\stopTextSpan\tweak bound-details.left.text ""\startTextSpan
   c'1\stopTextSpan
}


Maybe they should be for tempo indications?

Sometimes, this would be very helpful, yes (see attached image from
the last scene of 'Wozzeck').  I guess a possible work-around would be
to (ab)use `DynamicTextSpanner` for that.




If you don't need dynamic spanners and tempo spanners at the
same time, that will work, yes. There is also this kind of code:

\version "2.22.1"

#(use-modules (ice-9 match)
  (srfi srfi-26))

#(define (define-grob! grob-name grob-entry)
   (set! all-grob-descriptions
 (cons ((@@ (lily) completize-grob-entry)
    (cons grob-name grob-entry))
   all-grob-descriptions)))

#(define-grob!
  'TempoLineSpanner
  `((axes . (,Y))
    (cross-staff . ,ly:side-position-interface::calc-cross-staff)
    (direction . ,UP)
    (minimum-space . 1.2)
    (outside-staff-priority . 250)
    (padding . 0.6)
    (side-axis . ,Y)
    (slur-padding . 0.3)
    (staff-padding . 0.1)
    (vertical-skylines . 
,grob::always-vertical-skylines-from-element-stencils)

    (X-extent . ,ly:axis-group-interface::width)
    (Y-extent . ,axis-group-interface::height)
    (Y-offset . ,side-position-interface::y-aligned-side)
    (meta . ((class . Spanner)
 (object-callbacks . ((pure-Y-common . 
,ly:axis-group-interface::calc-pure-y-common)
  (pure-relevant-grobs . 
,ly:axis-group-interface::calc-pure-relevant-grobs)))

 (interfaces . (axis-group-interface
    outside-staff-interface
    side-position-interface))

#(ly:add-interface 'text-spanner-interface "" '())

#(define (transform-in-path! alist path transformer)
   (match path
 (() (transformer alist))
 ((p . rest) (assq-set! alist p (transform-in-path! (assq-ref alist p)
    rest
transformer)

#(set! all-grob-descriptions
   (transform-in-path! all-grob-descriptions
   '(TextSpanner meta interfaces)
   (cute cons 'text-spanner-interface <>)))


#(define (Tempo_align_engraver context)
   (let ((baseline #f)
 (tempo-found #f)
 (last-tempo-active #f)
 (direction #f))
 (define (end-baseline!)
   (let ((column (ly:context-property context 'currentMusicalColumn)))
 (ly:spanner-set-bound! baseline RIGHT column)
 (if direction
 (begin
   (ly:grob-set-property! baseline 'direction direction)
   (set! direction #f)))
 (set! baseline #f)))
 (make-engraver
  (acknowledgers
   ((text-spanner-interface engraver grob source-engraver)
  (let ((ev (event-cause grob)))
    (if (ly:event-property ev 'is-tempo #f)
    (let ((d (ly:event-property ev 'direction #f))
  (column (ly:context-property context 
'currentMusicalColumn)))

  (set! tempo-found #t)
  (set! last-tempo-active #t)
  (ly:grob-set-property! grob 'Y-offset 0)
  (ly:grob-set-nested-property! grob
    '(bound-details right 
attach-dir)

    LEFT)
  (cond
   ((not baseline)
    (set! baseline (ly:engraver-make-grob engraver 
'TempoLineSpanner grob))

    (set! direction d)
    (ly:spanner-set-bound! baseline LEFT column)
    (ly:axis-group-interface::add-element baseline grob))
   ((and (not direction)
 d)
    ;; Adding spanner with forced direction to baseline
    ;; without forced direction, forcing the direction
    ;; of the baseline.
    (set! direction d)
    (ly:grob-set-property! baseline 'direction direction)
    (ly:axis-group-interface::add-element baseline grob))
   ((not direction)
    ;; No direction constraints
    (ly:axis-group-interface::add-element baseline grob))
   ((or (not d)
    (eqv? d direction))
    ;; Baseline has forced direction and the new tempo 
spanner's

    ;; is compatible with it.
    (ly:axis-group-interface::add-element baseline grob))
   (else
    ;; Incompatible directions, break baseline.
    (end-baseline!)
    (set! baseline (ly:

Re: `TextSpanner` vs. `DynamicTextSpanner`

2022-03-03 Thread Werner LEMBERG

>> Is there a similar auxiliary grob for `TextSpanner`?
> 
> No, since consecutive text spanners are not aligned vertically.
> 
> {
>   c'1\tweak bound-details.left.text "aaa" \startTextSpan
>   c'1\stopTextSpan\tweak bound-details.left.text ""\startTextSpan
>   c'1\stopTextSpan
> }
> 
> 
> Maybe they should be for tempo indications?

Sometimes, this would be very helpful, yes (see attached image from
the last scene of 'Wozzeck').  I guess a possible work-around would be
to (ab)use `DynamicTextSpanner` for that.

> But then, it's more a matter of adding dedicated grobs since I don't
> think it would be desirable to do this for all text spanners --
> nothing prevents overlapping text spanners, unlike, say, overlapping
> hairpins (in the same voice, that is), so I don't think there is a
> reason to make them continuous.

What do you mean with 'dedicated grobs'?

> What is the context of your question?

I'm working on documentation for all grobs, and I also add cross
references from one grob to similar grobs (if it makes sense).  While
doing that I noticed that `TextSpanner` has no auxiliary grob for
aligning.


Werner


Re: `TextSpanner` vs. `DynamicTextSpanner`

2022-03-03 Thread Jean Abou Samra

Le 03/03/2022 à 20:25, Werner LEMBERG a écrit :

For `DynamicTextSpanner` grobs there exists the auxiliary
`DynamicLineSpanner` grob, providing a vertical baseline to align
successive dynamic grobs within a staff.  LilyPond provides other such
pairs like `CenteredBarNumber` vs. `CenteredBarNumberLineSpanner`, or
`SostenutoPedal` vs. `SostenutoPedalLineSpanner`.

Is there a similar auxiliary grob for `TextSpanner`?



No, since consecutive text spanners are not aligned
vertically.


{
  c'1\tweak bound-details.left.text "aaa" \startTextSpan
  c'1\stopTextSpan\tweak bound-details.left.text ""\startTextSpan
  c'1\stopTextSpan
}


Maybe they should be for tempo indications? But then,
it's more a matter of adding dedicated grobs since
I don't think it would be desirable to do this for
all text spanners -- nothing prevents overlapping
text spanners, unlike, say, overlapping hairpins (in
the same voice, that is), so I don't think there is
a reason to make them continuous.

What is the context of your question?

Jean




`TextSpanner` vs. `DynamicTextSpanner`

2022-03-03 Thread Werner LEMBERG


For `DynamicTextSpanner` grobs there exists the auxiliary
`DynamicLineSpanner` grob, providing a vertical baseline to align
successive dynamic grobs within a staff.  LilyPond provides other such
pairs like `CenteredBarNumber` vs. `CenteredBarNumberLineSpanner`, or
`SostenutoPedal` vs. `SostenutoPedalLineSpanner`.

Is there a similar auxiliary grob for `TextSpanner`?  


Werner



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Jean Abou Samra



> Le 5 févr. 2022 à 17:34, Kenneth Wolcott  a écrit :
> 
> Hi Kevin;
> 
>  I commented that line out because I get an error when engraving it.
> 
> GNU LilyPond 2.22.1 (running Guile 2.2)
> Processing `Jeanie_With_The_Light_Brown_Hair.ly'
> Parsing...
> Jeanie_With_The_Light_Brown_Hair.ly:56:4: error: syntax error,
> unexpected MUSIC_FUNCTION, expecting UNSIGNED or NUMBER_IDENTIFIER or
> REAL
>  -
>   \tweak outside-staff-priority #605
> Jeanie_With_The_Light_Brown_Hair.ly:57:5: error: wrong type for
> argument 3.  Expecting music, found (markup #:line (#:bold (#:fontsize
> 4 "a tempo")))
> 
>\markup { \bold \fontsize #4 "a tempo" }



That sounds like you have

-\tweak outside-staff-priority #605 \markup { ... }

instead of

\tweak outside-staff-priority #605 -\markup { ... }

Jean



> Jeanie_With_The_Light_Brown_Hair.ly:173:3: error: errors found,
> ignoring music expression
> 
>  \new PianoStaff \with { instrumentName = "Piano" }
> Jeanie_With_The_Light_Brown_Hair.ly:182:3: error: errors found,
> ignoring music expression
> 
>  <<
> fatal error: failed files: "Jeanie_With_The_Light_Brown_Hair.ly"
> 
>> On Sat, Feb 5, 2022 at 2:42 AM Kevin Barry  wrote:
>> 
>> Hi Kenneth,
>> 
>> I think you can fix the problem with the relative positioning by
>> setting the 'outside-staff-priority, e.g.:
>> 
>> \tweak #'outside-staff-priority #0 \ottava 1
>> 
>> will cause the ottava marking to be put closer to the staff than the text 
>> span.
>> 
>> Kevin
>> 
>>> On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  
>>> wrote:
>>> 
>>> Hi;
>>> 
>>>  I figured out how to get the formatting of the "a tempo" and "rall."
>>> merged with the text spanning; but I still can't seem to figure out
>>> how to get the "a tempo" to be above the ottava marking.
>>> 
>>>  Updated screenshot attached.
>>> 
>>>  Attached full Lilypond code as well.
>>> 
>>> Thanks,
>>> Ken
>>> 
 On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  
 wrote:
 
 Hi;
 
  I know how to generate a bold and large "rall." and "a tempo".
 
  I know how to get a text span.
 
  How to merge these two concepts?
 
  Also I need to put the "a tempo" above the ottava.
 
  I think I now how to do that in a more simple context, but I'm
 struggling here.
 
  I have attached two screenshots.
 
  The example is the music I'm trying to engrave from while the other
 screenshot is what I've asked Lilypond to do,
 
 I have enclosed below an excerpt of my Lilypond code.
 
 Thanks in advance for your help.
 
 Ken Wolcott
 
 
 \version "2.22.0"
 ...
  \language "english"
 ...
 a_tempo = ^\markup { \bold "A tempo" }
 rall = ^\markup { \bold "rall." }
 rit = ^\markup { \bold "rit." }
 ...
 %\break
  bf'4. \( g'8 af' g' f' ef' | % m18
  \override TextSpanner.bound-details.left.text = "rall."
  g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
  f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
  g'4 g'8 f' ef'2\stopTextSpan \)| % m21
 %\break
  \ottava 1
\transpose c c' {
\override TextSpanner.bound-details.left.text = "a tempo"
\grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | % m22
c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | % m23
  }
  \ottava 0
  f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % m24
  g''4 g''8 f'' 4 \) s| % m25
  \bar "|."
 
> 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Jean Abou Samra



> Le 5 févr. 2022 à 11:42, Kevin Barry  a écrit :
> 
> Hi Kenneth,
> 
> I think you can fix the problem with the relative positioning by
> setting the 'outside-staff-priority, e.g.:
> 
> \tweak #'outside-staff-priority #0 \ottava 1


I think (cannot verify this weekend) that this is only going to work in 2.23 
thanks to \ottava having been converted to a stream event. In 2.22, try

\once \override Staff.OttavaSpanner.outside-staff-priority = 0
\ottava 1


Jean

> will cause the ottava marking to be put closer to the staff than the text 
> span.
> 
> Kevin
> 
>> On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  
>> wrote:
>> 
>> Hi;
>> 
>>  I figured out how to get the formatting of the "a tempo" and "rall."
>> merged with the text spanning; but I still can't seem to figure out
>> how to get the "a tempo" to be above the ottava marking.
>> 
>>  Updated screenshot attached.
>> 
>>  Attached full Lilypond code as well.
>> 
>> Thanks,
>> Ken
>> 
>>> On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  
>>> wrote:
>>> 
>>> Hi;
>>> 
>>>  I know how to generate a bold and large "rall." and "a tempo".
>>> 
>>>  I know how to get a text span.
>>> 
>>>  How to merge these two concepts?
>>> 
>>>  Also I need to put the "a tempo" above the ottava.
>>> 
>>>  I think I now how to do that in a more simple context, but I'm
>>> struggling here.
>>> 
>>>  I have attached two screenshots.
>>> 
>>>  The example is the music I'm trying to engrave from while the other
>>> screenshot is what I've asked Lilypond to do,
>>> 
>>> I have enclosed below an excerpt of my Lilypond code.
>>> 
>>> Thanks in advance for your help.
>>> 
>>> Ken Wolcott
>>> 
>>> 
>>> \version "2.22.0"
>>> ...
>>>  \language "english"
>>> ...
>>> a_tempo = ^\markup { \bold "A tempo" }
>>> rall = ^\markup { \bold "rall." }
>>> rit = ^\markup { \bold "rit." }
>>> ...
>>> %\break
>>>  bf'4. \( g'8 af' g' f' ef' | % m18
>>>  \override TextSpanner.bound-details.left.text = "rall."
>>>  g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
>>>  f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
>>>  g'4 g'8 f' ef'2\stopTextSpan \)| % m21
>>> %\break
>>>  \ottava 1
>>>\transpose c c' {
>>>\override TextSpanner.bound-details.left.text = "a tempo"
>>>\grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | % m22
>>>c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | % m23
>>>  }
>>>  \ottava 0
>>>  f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % m24
>>>  g''4 g''8 f'' 4 \) s| % m25
>>>  \bar "|."
>>> 
> 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Kenneth Wolcott
Ah!

Thank you, Kevin!

On Sat, Feb 5, 2022 at 8:58 AM Kevin Barry  wrote:
>
> Hi Kenneth,
>
> That line was in the file that you sent. I had to comment it out as
> well. It's not related to my suggestion.
>
> Kevin
>
> On Sat, 5 Feb 2022 at 16:34, Kenneth Wolcott  wrote:
> >
> > Hi Kevin;
> >
> >   I commented that line out because I get an error when engraving it.
> >
> > GNU LilyPond 2.22.1 (running Guile 2.2)
> > Processing `Jeanie_With_The_Light_Brown_Hair.ly'
> > Parsing...
> > Jeanie_With_The_Light_Brown_Hair.ly:56:4: error: syntax error,
> > unexpected MUSIC_FUNCTION, expecting UNSIGNED or NUMBER_IDENTIFIER or
> > REAL
> >   -
> >\tweak outside-staff-priority #605
> > Jeanie_With_The_Light_Brown_Hair.ly:57:5: error: wrong type for
> > argument 3.  Expecting music, found (markup #:line (#:bold (#:fontsize
> > 4 "a tempo")))
> >
> > \markup { \bold \fontsize #4 "a tempo" }
> > Jeanie_With_The_Light_Brown_Hair.ly:173:3: error: errors found,
> > ignoring music expression
> >
> >   \new PianoStaff \with { instrumentName = "Piano" }
> > Jeanie_With_The_Light_Brown_Hair.ly:182:3: error: errors found,
> > ignoring music expression
> >
> >   <<
> > fatal error: failed files: "Jeanie_With_The_Light_Brown_Hair.ly"
> >
> > On Sat, Feb 5, 2022 at 2:42 AM Kevin Barry  wrote:
> > >
> > > Hi Kenneth,
> > >
> > > I think you can fix the problem with the relative positioning by
> > > setting the 'outside-staff-priority, e.g.:
> > >
> > > \tweak #'outside-staff-priority #0 \ottava 1
> > >
> > > will cause the ottava marking to be put closer to the staff than the text 
> > > span.
> > >
> > > Kevin
> > >
> > > On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  
> > > wrote:
> > > >
> > > > Hi;
> > > >
> > > >   I figured out how to get the formatting of the "a tempo" and "rall."
> > > > merged with the text spanning; but I still can't seem to figure out
> > > > how to get the "a tempo" to be above the ottava marking.
> > > >
> > > >   Updated screenshot attached.
> > > >
> > > >   Attached full Lilypond code as well.
> > > >
> > > > Thanks,
> > > > Ken
> > > >
> > > > On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott 
> > > >  wrote:
> > > > >
> > > > > Hi;
> > > > >
> > > > >   I know how to generate a bold and large "rall." and "a tempo".
> > > > >
> > > > >   I know how to get a text span.
> > > > >
> > > > >   How to merge these two concepts?
> > > > >
> > > > >   Also I need to put the "a tempo" above the ottava.
> > > > >
> > > > >   I think I now how to do that in a more simple context, but I'm
> > > > > struggling here.
> > > > >
> > > > >   I have attached two screenshots.
> > > > >
> > > > >   The example is the music I'm trying to engrave from while the other
> > > > > screenshot is what I've asked Lilypond to do,
> > > > >
> > > > > I have enclosed below an excerpt of my Lilypond code.
> > > > >
> > > > > Thanks in advance for your help.
> > > > >
> > > > > Ken Wolcott
> > > > >
> > > > > 
> > > > > \version "2.22.0"
> > > > > ...
> > > > >   \language "english"
> > > > > ...
> > > > > a_tempo = ^\markup { \bold "A tempo" }
> > > > > rall = ^\markup { \bold "rall." }
> > > > > rit = ^\markup { \bold "rit." }
> > > > > ...
> > > > > %\break
> > > > >   bf'4. \( g'8 af' g' f' ef' | % m18
> > > > >   \override TextSpanner.bound-details.left.text = "rall."
> > > > >   g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
> > > > >   f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
> > > > >   g'4 g'8 f' ef'2\stopTextSpan \)| % m21
> > > > > %\break
> > > > >   \ottava 1
> > > > > \transpose c c' {
> > > > > \override TextSpanner.bound-details.left.text = "a tempo"
> > > > > \grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  
> > > > > | % m22
> > > > > c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r 
> > > > > | % m23
> > > > >   }
> > > > >   \ottava 0
> > > > >   f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| 
> > > > > % m24
> > > > >   g''4 g''8 f'' 4 \) s| 
> > > > > % m25
> > > > >   \bar "|."
> > > > > 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Kevin Barry
Hi Kenneth,

That line was in the file that you sent. I had to comment it out as
well. It's not related to my suggestion.

Kevin

On Sat, 5 Feb 2022 at 16:34, Kenneth Wolcott  wrote:
>
> Hi Kevin;
>
>   I commented that line out because I get an error when engraving it.
>
> GNU LilyPond 2.22.1 (running Guile 2.2)
> Processing `Jeanie_With_The_Light_Brown_Hair.ly'
> Parsing...
> Jeanie_With_The_Light_Brown_Hair.ly:56:4: error: syntax error,
> unexpected MUSIC_FUNCTION, expecting UNSIGNED or NUMBER_IDENTIFIER or
> REAL
>   -
>\tweak outside-staff-priority #605
> Jeanie_With_The_Light_Brown_Hair.ly:57:5: error: wrong type for
> argument 3.  Expecting music, found (markup #:line (#:bold (#:fontsize
> 4 "a tempo")))
>
> \markup { \bold \fontsize #4 "a tempo" }
> Jeanie_With_The_Light_Brown_Hair.ly:173:3: error: errors found,
> ignoring music expression
>
>   \new PianoStaff \with { instrumentName = "Piano" }
> Jeanie_With_The_Light_Brown_Hair.ly:182:3: error: errors found,
> ignoring music expression
>
>   <<
> fatal error: failed files: "Jeanie_With_The_Light_Brown_Hair.ly"
>
> On Sat, Feb 5, 2022 at 2:42 AM Kevin Barry  wrote:
> >
> > Hi Kenneth,
> >
> > I think you can fix the problem with the relative positioning by
> > setting the 'outside-staff-priority, e.g.:
> >
> > \tweak #'outside-staff-priority #0 \ottava 1
> >
> > will cause the ottava marking to be put closer to the staff than the text 
> > span.
> >
> > Kevin
> >
> > On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  
> > wrote:
> > >
> > > Hi;
> > >
> > >   I figured out how to get the formatting of the "a tempo" and "rall."
> > > merged with the text spanning; but I still can't seem to figure out
> > > how to get the "a tempo" to be above the ottava marking.
> > >
> > >   Updated screenshot attached.
> > >
> > >   Attached full Lilypond code as well.
> > >
> > > Thanks,
> > > Ken
> > >
> > > On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  
> > > wrote:
> > > >
> > > > Hi;
> > > >
> > > >   I know how to generate a bold and large "rall." and "a tempo".
> > > >
> > > >   I know how to get a text span.
> > > >
> > > >   How to merge these two concepts?
> > > >
> > > >   Also I need to put the "a tempo" above the ottava.
> > > >
> > > >   I think I now how to do that in a more simple context, but I'm
> > > > struggling here.
> > > >
> > > >   I have attached two screenshots.
> > > >
> > > >   The example is the music I'm trying to engrave from while the other
> > > > screenshot is what I've asked Lilypond to do,
> > > >
> > > > I have enclosed below an excerpt of my Lilypond code.
> > > >
> > > > Thanks in advance for your help.
> > > >
> > > > Ken Wolcott
> > > >
> > > > 
> > > > \version "2.22.0"
> > > > ...
> > > >   \language "english"
> > > > ...
> > > > a_tempo = ^\markup { \bold "A tempo" }
> > > > rall = ^\markup { \bold "rall." }
> > > > rit = ^\markup { \bold "rit." }
> > > > ...
> > > > %\break
> > > >   bf'4. \( g'8 af' g' f' ef' | % m18
> > > >   \override TextSpanner.bound-details.left.text = "rall."
> > > >   g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
> > > >   f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
> > > >   g'4 g'8 f' ef'2\stopTextSpan \)| % m21
> > > > %\break
> > > >   \ottava 1
> > > > \transpose c c' {
> > > > \override TextSpanner.bound-details.left.text = "a tempo"
> > > > \grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | 
> > > > % m22
> > > > c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | 
> > > > % m23
> > > >   }
> > > >   \ottava 0
> > > >   f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % 
> > > > m24
> > > >   g''4 g''8 f'' 4 \) s| % 
> > > > m25
> > > >   \bar "|."
> > > > 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Kenneth Wolcott
Hi Kevin;

  I commented that line out because I get an error when engraving it.

GNU LilyPond 2.22.1 (running Guile 2.2)
Processing `Jeanie_With_The_Light_Brown_Hair.ly'
Parsing...
Jeanie_With_The_Light_Brown_Hair.ly:56:4: error: syntax error,
unexpected MUSIC_FUNCTION, expecting UNSIGNED or NUMBER_IDENTIFIER or
REAL
  -
   \tweak outside-staff-priority #605
Jeanie_With_The_Light_Brown_Hair.ly:57:5: error: wrong type for
argument 3.  Expecting music, found (markup #:line (#:bold (#:fontsize
4 "a tempo")))

\markup { \bold \fontsize #4 "a tempo" }
Jeanie_With_The_Light_Brown_Hair.ly:173:3: error: errors found,
ignoring music expression

  \new PianoStaff \with { instrumentName = "Piano" }
Jeanie_With_The_Light_Brown_Hair.ly:182:3: error: errors found,
ignoring music expression

  <<
fatal error: failed files: "Jeanie_With_The_Light_Brown_Hair.ly"

On Sat, Feb 5, 2022 at 2:42 AM Kevin Barry  wrote:
>
> Hi Kenneth,
>
> I think you can fix the problem with the relative positioning by
> setting the 'outside-staff-priority, e.g.:
>
> \tweak #'outside-staff-priority #0 \ottava 1
>
> will cause the ottava marking to be put closer to the staff than the text 
> span.
>
> Kevin
>
> On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  wrote:
> >
> > Hi;
> >
> >   I figured out how to get the formatting of the "a tempo" and "rall."
> > merged with the text spanning; but I still can't seem to figure out
> > how to get the "a tempo" to be above the ottava marking.
> >
> >   Updated screenshot attached.
> >
> >   Attached full Lilypond code as well.
> >
> > Thanks,
> > Ken
> >
> > On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  
> > wrote:
> > >
> > > Hi;
> > >
> > >   I know how to generate a bold and large "rall." and "a tempo".
> > >
> > >   I know how to get a text span.
> > >
> > >   How to merge these two concepts?
> > >
> > >   Also I need to put the "a tempo" above the ottava.
> > >
> > >   I think I now how to do that in a more simple context, but I'm
> > > struggling here.
> > >
> > >   I have attached two screenshots.
> > >
> > >   The example is the music I'm trying to engrave from while the other
> > > screenshot is what I've asked Lilypond to do,
> > >
> > > I have enclosed below an excerpt of my Lilypond code.
> > >
> > > Thanks in advance for your help.
> > >
> > > Ken Wolcott
> > >
> > > 
> > > \version "2.22.0"
> > > ...
> > >   \language "english"
> > > ...
> > > a_tempo = ^\markup { \bold "A tempo" }
> > > rall = ^\markup { \bold "rall." }
> > > rit = ^\markup { \bold "rit." }
> > > ...
> > > %\break
> > >   bf'4. \( g'8 af' g' f' ef' | % m18
> > >   \override TextSpanner.bound-details.left.text = "rall."
> > >   g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
> > >   f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
> > >   g'4 g'8 f' ef'2\stopTextSpan \)| % m21
> > > %\break
> > >   \ottava 1
> > > \transpose c c' {
> > > \override TextSpanner.bound-details.left.text = "a tempo"
> > > \grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | % 
> > > m22
> > > c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | % 
> > > m23
> > >   }
> > >   \ottava 0
> > >   f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % m24
> > >   g''4 g''8 f'' 4 \) s| % m25
> > >   \bar "|."
> > > 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-05 Thread Kevin Barry
Hi Kenneth,

I think you can fix the problem with the relative positioning by
setting the 'outside-staff-priority, e.g.:

\tweak #'outside-staff-priority #0 \ottava 1

will cause the ottava marking to be put closer to the staff than the text span.

Kevin

On Sat, 5 Feb 2022 at 01:35, Kenneth Wolcott  wrote:
>
> Hi;
>
>   I figured out how to get the formatting of the "a tempo" and "rall."
> merged with the text spanning; but I still can't seem to figure out
> how to get the "a tempo" to be above the ottava marking.
>
>   Updated screenshot attached.
>
>   Attached full Lilypond code as well.
>
> Thanks,
> Ken
>
> On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  
> wrote:
> >
> > Hi;
> >
> >   I know how to generate a bold and large "rall." and "a tempo".
> >
> >   I know how to get a text span.
> >
> >   How to merge these two concepts?
> >
> >   Also I need to put the "a tempo" above the ottava.
> >
> >   I think I now how to do that in a more simple context, but I'm
> > struggling here.
> >
> >   I have attached two screenshots.
> >
> >   The example is the music I'm trying to engrave from while the other
> > screenshot is what I've asked Lilypond to do,
> >
> > I have enclosed below an excerpt of my Lilypond code.
> >
> > Thanks in advance for your help.
> >
> > Ken Wolcott
> >
> > 
> > \version "2.22.0"
> > ...
> >   \language "english"
> > ...
> > a_tempo = ^\markup { \bold "A tempo" }
> > rall = ^\markup { \bold "rall." }
> > rit = ^\markup { \bold "rit." }
> > ...
> > %\break
> >   bf'4. \( g'8 af' g' f' ef' | % m18
> >   \override TextSpanner.bound-details.left.text = "rall."
> >   g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
> >   f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
> >   g'4 g'8 f' ef'2\stopTextSpan \)| % m21
> > %\break
> >   \ottava 1
> > \transpose c c' {
> > \override TextSpanner.bound-details.left.text = "a tempo"
> > \grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | % m22
> > c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | % m23
> >   }
> >   \ottava 0
> >   f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % m24
> >   g''4 g''8 f'' 4 \) s| % m25
> >   \bar "|."
> > 



Re: How to do TextSpanner + markup + override vertical placement all at the same time?

2022-02-04 Thread Kenneth Wolcott
Hi;

  I figured out how to get the formatting of the "a tempo" and "rall."
merged with the text spanning; but I still can't seem to figure out
how to get the "a tempo" to be above the ottava marking.

  Updated screenshot attached.

  Attached full Lilypond code as well.

Thanks,
Ken

On Fri, Feb 4, 2022 at 5:05 PM Kenneth Wolcott  wrote:
>
> Hi;
>
>   I know how to generate a bold and large "rall." and "a tempo".
>
>   I know how to get a text span.
>
>   How to merge these two concepts?
>
>   Also I need to put the "a tempo" above the ottava.
>
>   I think I now how to do that in a more simple context, but I'm
> struggling here.
>
>   I have attached two screenshots.
>
>   The example is the music I'm trying to engrave from while the other
> screenshot is what I've asked Lilypond to do,
>
> I have enclosed below an excerpt of my Lilypond code.
>
> Thanks in advance for your help.
>
> Ken Wolcott
>
> 
> \version "2.22.0"
> ...
>   \language "english"
> ...
> a_tempo = ^\markup { \bold "A tempo" }
> rall = ^\markup { \bold "rall." }
> rit = ^\markup { \bold "rit." }
> ...
> %\break
>   bf'4. \( g'8 af' g' f' ef' | % m18
>   \override TextSpanner.bound-details.left.text = "rall."
>   g'4 bf8 c'\startTextSpan ef'2 \)   | % m19
>   f'8 \( g' ef''8. c''16 bf'8.\fermata c''16 ef'8. f'16  | % m20
>   g'4 g'8 f' ef'2\stopTextSpan \)| % m21
> %\break
>   \ottava 1
> \transpose c c' {
> \override TextSpanner.bound-details.left.text = "a tempo"
> \grace { af'16\startTextSpan } g'8 \( f' g' bf' bf' g'' g''4 \)  | % m22
> c''8 \( af'' ef'' f'' g''4\stopTextSpan \) r | % m23
>   }
>   \ottava 0
>   f''8\rall \( g'' ef''' c''' bf'' c'' ef'' f''| % m24
>   g''4 g''8 f'' 4 \) s| % m25
>   \bar "|."
> 


Jeanie_With_The_Light_Brown_Hair.ly
Description: Binary data


Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-30 Thread Jean Abou Samra




Le 30/11/2021 à 21:55, Jean Abou Samra a écrit :


Basically, extra-spacing-width etc. work on items, and
not on spanners. If you want a spanner to occupy space
at its bounds, the state of the art is that you have
to create "stub" items.

I won't have the time to work on it more, sorry.



PS: It might be a good idea to open a tracker issue.

Jean



Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-30 Thread Jean Abou Samra




Le 28/11/2021 à 16:10, Werner LEMBERG a écrit :

please have a look at this example

```
{
\set Score.skipBars = ##t
\override TextSpanner.bound-details.left.text = "poco a poco tempo I"
\override TextSpanner.bound-details.right.text = "Tempo I"
R1*4\startTextSpan |
R1\stopTextSpan
}
```

What is the equivalent of `\textLengthOn` for `TextSpanner` grobs so
that the multi-measure rest gets properly stretched horizontally?

Use

   \override TextSpanner.minimum-length = 30
   \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods

Thanks.  Alas, doesn't work correctly for broken spanners:

```
\paper {
   line-width = 100\mm
}

{
   \set Score.skipBars = ##t
   \override TextSpanner.bound-details.left.text = "poco a poco tempo I"
   \override TextSpanner.bound-details.left-broken.text = ""
   \override TextSpanner.bound-details.right.text = "Tempo I"
   \override TextSpanner.bound-details.right-broken.text = ""
   \override TextSpanner.minimum-length = 34
   \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods

   R1*4\startTextSpan | \break
   R1*4\stopTextSpan |
   R1 |
}
```

I also wonder whether there is a solution (or should be a solution)
that doesn't need manual entering of a minimum length value that can
only be found by trial and error.  For example, wouldn't it be
sensible to have the possibility of

```
\override TextSpanner.bound-details
 .left.extra-spacing-height = #'(-inf.0 . +inf.0)
\override TextSpanner.bound-details
 .right.extra-spacing-height = #'(-inf.0 . +inf.0)
```

in combination with the `extra-spacing-width` property to get
automatically the correct value(s)?


  Werner



Here is what I could arrive at this evening:

\version "2.23.6"

\paper {
  line-width = 100\mm
}

#(use-modules (ice-9 match)
  (srfi srfi-26))

#(define (define-grob! grob-name grob-entry)
   (let* ((meta-entry   (assoc-get 'meta grob-entry))
  (class    (assoc-get 'class meta-entry))
  (ifaces-entry (assoc-get 'interfaces meta-entry)))
 (set-object-property! grob-name 'translation-type? 
ly:grob-properties?)

 (set-object-property! grob-name 'is-grob? #t)
 (set! ifaces-entry (append (case class
  ((Item) '(item-interface))
  ((Spanner) '(spanner-interface))
  ((Paper_column) '((item-interface
paper-column-interface)))
  ((System) '((system-interface
spanner-interface)))
  (else '(unknown-interface)))
    ifaces-entry))
 (set! ifaces-entry (uniq-list (sort ifaces-entry symbol  (assoc-set! alist key (transform-nested-path! rest transform 
(assoc-get key alist))


#(transform-nested-path!
  '(TextSpanner meta interfaces)
  (cute cons 'text-spanner-interface <>)
  all-grob-descriptions)

#(define (Text_spanner_stub_engraver context)
   (let ((text-spanner #f))
 (define (get-details syms)
   (let ((bound-details (ly:grob-property text-spanner 
'bound-details)))

 (map (cute assoc-get <> bound-details '())
  syms)))
 (define (new-stub engraver)
   (let ((stub (ly:engraver-make-grob engraver 
'TextSpannerBoundStub '(

 (ly:grob-set-parent! stub Y text-spanner)
 stub))
 (make-engraver
   (acknowledgers
 ((text-spanner-interface engraver grob source-engraver)
    (set! text-spanner grob)
    (let ((stub (new-stub engraver)))
  (ly:grob-set-parent! stub Y grob)
  (ly:grob-set-property! stub 'direction LEFT)
  (ly:grob-set-property! stub 'bound-details (get-details 
'(left))

   ((process-music engraver)
  (if text-spanner
  (let ((column (ly:context-property context 
'currentCommandColumn))

    (stub-left (new-stub engraver))
    (stub-right (new-stub engraver)))
    (ly:grob-set-property! stub-left 'bound-details 
(get-details '(left-broken left)))

    (ly:grob-set-property! stub-left 'direction LEFT)
    (ly:grob-set-property! stub-left 'break-visibility #(#f 
#f #t))

    (ly:grob-set-property! stub-left 'non-musical #t)
    (ly:grob-set-property! stub-right 'bound-details 
(get-details '(right-broken right)))

    (ly:grob-set-property! stub-right 'direction RIGHT)
    (ly:grob-set-property! stub-right 'break-visibility 
#(#t #f #f))

    (ly:grob-set-property! stub-right 'non-musical #t
   (end-acknowledgers
  ((text-spanner-interface engraver grob source-engraver)
 (let ((stub (new-stub engraver)))
   (ly:grob-set-property! stub 'bound-details (get-details 
'(right)))

  

Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-30 Thread Werner LEMBERG


>>> Does David N's text-spanner work solve this problem, I wonder?
>> What are you referring to?
> 
> https://github.com/davidnalesnik/lilypond-text-spanner-inner-texts

This is veeery nice!  Thanks for the link.


Werner



Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Kieren MacMillan
Hi Werner,

>> Does David N's text-spanner work solve this problem, I wonder?
> What are you referring to?

https://github.com/davidnalesnik/lilypond-text-spanner-inner-texts

Cheers,
Kieren.



Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Werner LEMBERG

Hello Kieren,


>>> Use
>>>   \override TextSpanner.minimum-length = 30
>>>   \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods
>> Thanks.  Alas, doesn't work correctly for broken spanners
> 
> Yeah, I saw that coming… as well as the fundamental
> "trial-and-error" problem.

:-)

>> I also wonder whether there is a solution (or should be a solution)
>> that doesn't need manual entering of a minimum length value that
>> can only be found by trial and error.
> 
> Does David N's text-spanner work solve this problem, I wonder?

What are you referring to?


Werner


Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Kieren MacMillan
Hi Werner (et al.),

>> Use
>>   \override TextSpanner.minimum-length = 30
>>   \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods
> Thanks.  Alas, doesn't work correctly for broken spanners

Yeah, I saw that coming… as well as the fundamental "trial-and-error" problem.

> I also wonder whether there is a solution (or should be a solution)
> that doesn't need manual entering of a minimum length value that can
> only be found by trial and error.

Does David N's text-spanner work solve this problem, I wonder?

Cheers,
Kieren.


Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Werner LEMBERG
>> please have a look at this example
>>
>> ```
>> {
>>\set Score.skipBars = ##t
>>\override TextSpanner.bound-details.left.text = "poco a poco tempo I"
>>\override TextSpanner.bound-details.right.text = "Tempo I"
>>R1*4\startTextSpan |
>>R1\stopTextSpan
>> }
>> ```
>>
>> What is the equivalent of `\textLengthOn` for `TextSpanner` grobs so
>> that the multi-measure rest gets properly stretched horizontally?
>
> Use
>
>   \override TextSpanner.minimum-length = 30
>   \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods

Thanks.  Alas, doesn't work correctly for broken spanners:

```
\paper {
  line-width = 100\mm
}

{
  \set Score.skipBars = ##t
  \override TextSpanner.bound-details.left.text = "poco a poco tempo I"
  \override TextSpanner.bound-details.left-broken.text = ""
  \override TextSpanner.bound-details.right.text = "Tempo I"
  \override TextSpanner.bound-details.right-broken.text = ""
  \override TextSpanner.minimum-length = 34
  \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods

  R1*4\startTextSpan | \break
  R1*4\stopTextSpan |
  R1 |
}
```

I also wonder whether there is a solution (or should be a solution)
that doesn't need manual entering of a minimum length value that can
only be found by trial and error.  For example, wouldn't it be
sensible to have the possibility of

```
\override TextSpanner.bound-details
.left.extra-spacing-height = #'(-inf.0 . +inf.0)
\override TextSpanner.bound-details
.right.extra-spacing-height = #'(-inf.0 . +inf.0)
```

in combination with the `extra-spacing-width` property to get
automatically the correct value(s)?


 Werner


Re: `\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Jean Abou Samra

Le 28/11/2021 à 11:52, Werner LEMBERG a écrit :

Folks,


please have a look at this example

```
{
   \set Score.skipBars = ##t
   \override TextSpanner.bound-details.left.text = "poco a poco tempo I"
   \override TextSpanner.bound-details.right.text = "Tempo I"
   R1*4\startTextSpan |
   R1\stopTextSpan
}
```

What is the equivalent of `\textLengthOn` for `TextSpanner` grobs so
that the multi-measure rest gets properly stretched horizontally?


 Werner




Use

  \override TextSpanner.minimum-length = 30
  \override TextSpanner.springs-and-rods = #ly:spanner::set-spacing-rods

documented at
https://lilypond.org/doc/v2.22/Documentation/notation/spanners#using-the-spanner_002dinterface

Best,
Jean




`\textLengthOn` for `TextSpanner` grobs

2021-11-28 Thread Werner LEMBERG

Folks,


please have a look at this example

```
{
  \set Score.skipBars = ##t
  \override TextSpanner.bound-details.left.text = "poco a poco tempo I"
  \override TextSpanner.bound-details.right.text = "Tempo I"
  R1*4\startTextSpan |
  R1\stopTextSpan
}
```

What is the equivalent of `\textLengthOn` for `TextSpanner` grobs so
that the multi-measure rest gets properly stretched horizontally?


Werner



Re: TextSpanner to end of bar / end of piece

2021-05-24 Thread Lukas-Fabian Moser

Hi Harm,

So this seems to mean that right-broken.text should be changed by a 
hook that determines if we are at a line break. I'llt try to see if I 
can figure out how to do this.


It seems to suffice to copy right.text into right-broken.text only for 
the last bit of a broken TextSpanner:


   \override TextSpanner.after-line-breaking =
    #(lambda (grob)
   ; Copies bound-details.right settings to bound-details.right-broken
   ; for the last part of a broken spanner.
   ; This is needed because, if to-barline = ##t and the last part ends
   ; at a line break, the values from right-broken are used.
   (let*
    ((orig (ly:grob-original grob))
 (siblings (if (ly:grob? orig)
   (ly:spanner-broken-into orig)
   '(
    (if (not (null? siblings))
    (if (eq? grob (car (last-pair siblings)))
    (ly:grob-set-nested-property!
 grob
 '(bound-details right-broken)
 (ly:assoc-get 'right (ly:grob-property grob 
'bound-details)))




Thanks for the hint, Harm!

Lukas

\version "2.22"

spanTest = {
  \override TextSpanner.to-barline = ##t
  \override TextSpanner.bound-details.right-broken.text = ##f
  \override TextSpanner.after-line-breaking =
  #(lambda (grob)
 ; Copies bound-details.right settings to bound-details.right-broken
 ; for the last part of a broken spanner.
 ; This is needed because, if to-barline = ##t and the last part ends
 ; at a line break, the values from right-broken are used.
 (let*
  ((orig (ly:grob-original grob))
   (siblings (if (ly:grob? orig)
 (ly:spanner-broken-into orig)
 '(
  (if (not (null? siblings))
  (if (eq? grob (car (last-pair siblings)))
  (ly:grob-set-nested-property!
   grob
   '(bound-details right-broken)
   (ly:assoc-get 'right (ly:grob-property grob 'bound-details)))

  \override TextSpanner.bound-details.right.text = "R"

  \override TextSpanner.bound-details.left.text = "L"
  \override TextSpanner.bound-details.left-broken.text = \markup\right-align "(L)"

  <>\startTextSpan
  s1
  \break
  <>\stopTextSpan
  s1
  <>\startTextSpan
  s1 \break
  s1 \break
  s1
  <>\stopTextSpan
  <>\startTextSpan
  s1 \break
  s1 \break
  s1 \break
  <>\stopTextSpan
}

\new Staff {

  \spanTest

  s4 % makes last "right" appear (but extends piece)
}

Re: TextSpanner to end of bar / end of piece

2021-05-24 Thread Lukas-Fabian Moser

Hi Harm,



{
  \override TextSpanner.bound-details.right.text = "R"
  \override TextSpanner.bound-details.left.text = "L"
  \override TextSpanner.to-barline = ##t

  <>\startTextSpan
  s1
  \break
  <>\stopTextSpan
  s1
  <>\startTextSpan
  s1
  <>\stopTextSpan
}

Though, if the TextSpanner does not end at line-end you'll need 
different settings.

Probably doable by some scheme-coding ...


Ah, yes. It seems that with to-barline, the right-broken.text is used at 
the end of the line. Thanks!


So this seems to mean that right-broken.text should be changed by a hook 
that determines if we are at a line break. I'llt try to see if I can 
figure out how to do this.


Lukas



Re: TextSpanner to end of bar / end of piece

2021-05-24 Thread Thomas Morley
Am Mo., 24. Mai 2021 um 15:16 Uhr schrieb Lukas-Fabian Moser :

> Folks,
>
> two questions about the behaviour of textSpanners:
>
> First question:
>
> If a TextSpanner ends at the beginning at a bar which happens to be a line
> break, then
>
> - with TextSpanner.to-barline = ##f, I get the left-broken.text and the
> right.text immediately after one another at the beginning of the second
> system,
>
> - with TextSpanner.to-barline = ##t, I get no artifacts in the next line,
> but right.text is missing in the first system.
>
> What I want: The text spanner should end at the last barline of the first
> system, but right.text should be printed.
>
> Second question: Is it possible to let a TextSpanner end precisely at the
> end of a piece (last barline) with right.text being printed?
>
> I can approximate the desired behaviour in both cases by letting the
> TextSpanner end a very short amount of time before the actual end of the
> bar, but that feels conceptually wrong and also does not yield the correct
> position of "R".
>
> Lukas
>

Hi Lukas,

below works for me:

{
  \override TextSpanner.bound-details.right.text = "R"
  \override TextSpanner.bound-details.left.text = "L"
  \override TextSpanner.to-barline = ##t

  <>\startTextSpan
  s1
  \break
  <>\stopTextSpan
  s1
  <>\startTextSpan
  s1
  <>\stopTextSpan
}

Though, if the TextSpanner does not end at line-end you'll need different
settings.
Probably doable by some scheme-coding ...

Cheers,
  Harm


TextSpanner to end of bar / end of piece

2021-05-24 Thread Lukas-Fabian Moser

Folks,

two questions about the behaviour of textSpanners:

First question:

If a TextSpanner ends at the beginning at a bar which happens to be a 
line break, then


- with TextSpanner.to-barline = ##f, I get the left-broken.text and the 
right.text immediately after one another at the beginning of the second 
system,


- with TextSpanner.to-barline = ##t, I get no artifacts in the next 
line, but right.text is missing in the first system.


What I want: The text spanner should end at the last barline of the 
first system, but right.text should be printed.


Second question: Is it possible to let a TextSpanner end precisely at 
the end of a piece (last barline) with right.text being printed?


I can approximate the desired behaviour in both cases by letting the 
TextSpanner end a very short amount of time before the actual end of the 
bar, but that feels conceptually wrong and also does not yield the 
correct position of "R".


Lukas

\version "2.22"

spanTest = {
\override TextSpanner.bound-details.right-broken.text = ##f
\override TextSpanner.bound-details.right.text = "R"

\override TextSpanner.bound-details.left.text = "L"
\override TextSpanner.bound-details.left-broken.text = \markup\right-align "(L)"

<>\startTextSpan
s1
\break
<>\stopTextSpan
s1
<>\startTextSpan
s1
<>\stopTextSpan
  }

\new Staff {
  \spanTest
}

\new Staff {
  \override TextSpanner.to-barline = ##t
  % removes spurious "(L)__R", but fails to create "R"

  \spanTest

  s4 % makes last "right" appear (but extends piece)
}

Re: broken TextSpanner

2021-03-21 Thread bobr...@centrum.is
Hi Kieren,

Thank you!  Now I get it.

-David

- Original Message -
> From: "Kieren MacMillan" 
> To: "bobroff" 
> Cc: "Lillypond Users Mailing List" 
> Sent: Saturday, March 20, 2021 11:43:14 PM
> Subject: Re: broken TextSpanner

> Hi David,
> 
>> Thanks for chiming in.  I don’t really follow, though.  I poked around a bit 
>> and
>> see that left/right-broken seems to be associated with line-spanners.  I
>> thought I was dealing with a text spanner.
> 
> TextSpanner implements the same [relevant] interfaces:
> 
> %%%  SNIPPET BEGINS  %%%
> justLR = {
>  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
>  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
>  \override TextSpanner.breakable = ##t
> }
> brokenLR = {
>  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
>  \override TextSpanner.bound-details.right-broken.text = ##f
>  \override TextSpanner.bound-details.left-broken.text = ##f
>  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
>  \override TextSpanner.breakable = ##t
> }
> 
> { \justLR c''1\startTextSpan \break c''2 c''\stopTextSpan }
> 
> { \brokenLR c''1\startTextSpan \break c''2 c''\stopTextSpan }
> %%%  SNIPPET ENDS  %%%
> 
> Hope that helps!
> Kieren.
> 
> 
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info



Re: broken TextSpanner

2021-03-20 Thread Kieren MacMillan
Hi David,

> Thanks for chiming in.  I don’t really follow, though.  I poked around a bit 
> and see that left/right-broken seems to be associated with line-spanners.  I 
> thought I was dealing with a text spanner.  

TextSpanner implements the same [relevant] interfaces:

%%%  SNIPPET BEGINS  %%%
justLR = {
  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
  \override TextSpanner.breakable = ##t
}
brokenLR = {
  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
  \override TextSpanner.bound-details.right-broken.text = ##f
  \override TextSpanner.bound-details.left-broken.text = ##f
  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
  \override TextSpanner.breakable = ##t
}

{ \justLR c''1\startTextSpan \break c''2 c''\stopTextSpan }

{ \brokenLR c''1\startTextSpan \break c''2 c''\stopTextSpan }
%%%  SNIPPET ENDS  %%%

Hope that helps!
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: broken TextSpanner

2021-03-20 Thread bobr...@centrum.is
Kieren,

Thanks for chiming in.  I don’t really follow, though.  I poked around a bit 
and see that left/right-broken seems to be associated with line-spanners.  I 
thought I was dealing with a text spanner.  

-David
  
- Kieren MacMillan  wrote:
> Hi David,
> 
> You need to adjust the left-broken and right-broken parameters.
> 
> Hope that helps!
> Kieren.
> 
> > On Mar 20, 2021, at 1:03 PM, bobr...@centrum.is wrote:
> > 
> > Somewhere in the docs I ran across this structure (v2.20 or v2.22).  I have 
> > not been able to find it again:
> > 
> >  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" 
> > "dim."}
> >  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
> >  \override TextSpanner.breakable = ##t
> > 
> > An example showed how this produced a mezzo-forte with 'dim.' at 
> > \startTextSpan and after the line break the end note with 'pp' at 
> > \stopTextSpan.
> > 
> > What I get is "mf dim."..'pp'
> > 
> > line break
> > 
> > 'mfdimpp' all jammed together and overlapping under the note after the 
> > break.
> > 
> > Is such a thing possible as in the above code or do I need to work around 
> > this some other way?
> > 
> > -David
> 
> 
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info
> 




Re: broken TextSpanner

2021-03-20 Thread Kieren MacMillan
Hi David,

You need to adjust the left-broken and right-broken parameters.

Hope that helps!
Kieren.

> On Mar 20, 2021, at 1:03 PM, bobr...@centrum.is wrote:
> 
> Somewhere in the docs I ran across this structure (v2.20 or v2.22).  I have 
> not been able to find it again:
> 
>  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
>  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
>  \override TextSpanner.breakable = ##t
> 
> An example showed how this produced a mezzo-forte with 'dim.' at 
> \startTextSpan and after the line break the end note with 'pp' at 
> \stopTextSpan.
> 
> What I get is "mf dim."..'pp'
> 
> line break
> 
> 'mfdimpp' all jammed together and overlapping under the note after the break.
> 
> Is such a thing possible as in the above code or do I need to work around 
> this some other way?
> 
> -David


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




broken TextSpanner

2021-03-20 Thread bobr...@centrum.is
Somewhere in the docs I ran across this structure (v2.20 or v2.22).  I have not 
been able to find it again:


  \override TextSpanner.bound-details.left.text = \markup{\dynamic "mf" "dim."}
  \override TextSpanner.bound-details.right.text = \markup{ \dynamic "pp" }
  \override TextSpanner.breakable = ##t

An example showed how this produced a mezzo-forte with 'dim.' at \startTextSpan 
and after the line break the end note with 'pp' at \stopTextSpan.

What I get is "mf dim."..'pp'

line break

'mfdimpp' all jammed together and overlapping under the note after the break.


Is such a thing possible as in the above code or do I need to work around this 
some other way?

-David




Re: TextSpanner custom line

2021-02-17 Thread Artur Wrona
Dnia 2021-02-17, o godz. 16:41:24
David Nalesnik  napisał(a):

> Don't forget to "reply all"
> 

Sorry...
I'll reply all. Write me, that well or wrong...

Well... thank you - very helpful people I prepared line spanner useful
to drum part. Bravura font is required because special symbol. I think,
that best will if I share this code for other users.

%%%

\version "2.21.5"
%%%
wiggleCircularChar = \markup {
  \concat
  {
\scale #'(1.5 . 1)
\override #'(font-name . "Bravura")  \char ##xEAC3
  }
}

#(define (wiggleCircular grob)
   (if (ly:stencil? (ly:line-spanner::print grob))
   (let* ((stencil (ly:line-spanner::print grob))
  ;(dot (ly:font-get-glyph (ly:grob-default-font grob)
"scripts.turn")) (X-ext (ly:stencil-extent stencil X))
  (Y-ext (ly:stencil-extent stencil Y))
  ;(width 0.1)
  (len (interval-length X-ext))
  (sym-stencil (grob-interpret-markup grob
wiggleCircularChar)) (sym-X-ext (ly:stencil-extent sym-stencil X))
  (sym-len (interval-length sym-X-ext)))
 (ly:stencil-translate
  (grob-interpret-markup grob
(markup
 (#:pattern (inexact->exact (round (/ len sym-len)))
   X 0
   (markup #:scale (cons 1 1) wiggleCircularChar
  (cons (interval-start X-ext) (interval-start Y-ext
   #f))

{
  \override Score.TextSpanner.stencil = #wiggleCircular
  \override Score.TextSpanner.to-barline = ##t
  c'1\startTextSpan
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'\stopTextSpan
}

%%%
\version "2.21.5"
%%%
wiggleCircularChar = \markup {
  \concat
  {
\scale #'(1.5 . 1)
\override #'(font-name . "Bravura")  \char ##xEAC3
  }
}

#(define (wiggleCircular grob)
   (if (ly:stencil? (ly:line-spanner::print grob))
   (let* ((stencil (ly:line-spanner::print grob))
  ;(dot (ly:font-get-glyph (ly:grob-default-font grob) "scripts.turn"))
  (X-ext (ly:stencil-extent stencil X))
  (Y-ext (ly:stencil-extent stencil Y))
  ;(width 0.1)
  (len (interval-length X-ext))
  (sym-stencil (grob-interpret-markup grob wiggleCircularChar))
  (sym-X-ext (ly:stencil-extent sym-stencil X))
  (sym-len (interval-length sym-X-ext)))
 (ly:stencil-translate
  (grob-interpret-markup grob
(markup
 (#:pattern (inexact->exact (round (/ len sym-len)))
   X 0
   (markup #:scale (cons 1 1) wiggleCircularChar
  (cons (interval-start X-ext) (interval-start Y-ext
   #f))

{
  \override Score.TextSpanner.stencil = #wiggleCircular
  \override Score.TextSpanner.to-barline = ##t
  c'1\startTextSpan
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'
 c'\stopTextSpan
}

Re: TextSpanner custom line

2021-02-17 Thread David Nalesnik
Hi again,

On Wed, Feb 17, 2021 at 11:16 AM Pierre Perol-Schneider
 wrote:
>
> Hi Artur,
> This is not exactly what you ask for but you could do something like:
>
> \version "2.22.0"
> {
>   c'1
>   -\tweak X-extent #'(0 . 0)
>   ^\markup\pattern #25 #X #0 \musicglyph #"scripts.turn"
>   1 1 1 1 1 1 1 1 1
> }
>
> Cheers,
> Pierre
>

I'm a little out of practice, but here's my attempt at automating:
\version "2.21.5"

#(define (patterned-markup glyph)
   (lambda (grob)
 (let* ((stil (ly:line-spanner::print grob))
(spanner-extent-X (ly:stencil-extent stil X))
(spanner-extent-Y (ly:stencil-extent stil Y))
(spanner-length-X (interval-length spanner-extent-X))
(spanner-angle (atan (/ (interval-length spanner-extent-Y)
   spanner-length-X)))
(spanner-angle (degrees->radians spanner-angle))
(glyph-stil (ly:font-get-glyph (ly:grob-default-font grob) glyph))
(glyph-stil (ly:stencil-rotate glyph-stil spanner-angle 0 0))
(glyph-extent-X (ly:stencil-extent glyph-stil X))
(glyph-length-X (interval-length glyph-extent-X))
(reps (round (/ spanner-length-X glyph-length-X
   (let loop ((x 0) (new-stil empty-stencil))
 (if (> x reps)
 (ly:grob-set-property! grob 'stencil new-stil)
 (loop
  (1+ x)
  (ly:stencil-combine-at-edge new-stil X RIGHT glyph-stil 0.0)))


{
  \override TextSpanner.after-line-breaking = #(patterned-markup "scripts.turn")
  c'1\startTextSpan
  e'1
  g'1
  c''1\stopTextSpan
  \override TextSpanner.rotation = #'(5 -1 0)
  c'1\startTextSpan
  e'1
  g'1
  c''1\stopTextSpan

}



Re: TextSpanner custom line

2021-02-17 Thread Pierre Perol-Schneider
Hi Artur,
This is not exactly what you ask for but you could do something like:

\version "2.22.0"
{
  c'1
  -\tweak X-extent #'(0 . 0)
  ^\markup\pattern #25 #X #0 \musicglyph #"scripts.turn"
  1 1 1 1 1 1 1 1 1
}

Cheers,
Pierre

Le mer. 17 févr. 2021 à 16:48, Artur Wrona  a
écrit :

> Hi, dear Lilypond users. I ask at forum very rarement, always first
> find at Google, DuckDuck.. but now I didn't found solution for one
> thing. So... Is anybody, who knows, how to creat own symbol for
> textspanner? I would like for example use chars pattern instead line. I
> know that I must use \override TextSpanner.stencil or \override
> TextSpanner.style . I didn't found, how to define own line style. In
> future I'm going to use segment symbols from Bravura font (I know how
> to input Unicode symbols - rather easy to find).
> Thanks in advance.
> Artur Wrona.
>
>


Re: TextSpanner custom line

2021-02-17 Thread David Nalesnik
Hi Artur,

On Wed, Feb 17, 2021 at 9:48 AM Artur Wrona  wrote:
>
> Hi, dear Lilypond users. I ask at forum very rarement, always first
> find at Google, DuckDuck.. but now I didn't found solution for one
> thing. So... Is anybody, who knows, how to creat own symbol for
> textspanner? I would like for example use chars pattern instead line. I
> know that I must use \override TextSpanner.stencil or \override
> TextSpanner.style . I didn't found, how to define own line style. In
> future I'm going to use segment symbols from Bravura font (I know how
> to input Unicode symbols - rather easy to find).
> Thanks in advance.
> Artur Wrona.
>

This topic came up recently at
https://www.mail-archive.com/lilypond-user@gnu.org/msg143436.html

Hope this gets you started!

Best,
David



TextSpanner custom line

2021-02-17 Thread Artur Wrona
Hi, dear Lilypond users. I ask at forum very rarement, always first
find at Google, DuckDuck.. but now I didn't found solution for one
thing. So... Is anybody, who knows, how to creat own symbol for
textspanner? I would like for example use chars pattern instead line. I
know that I must use \override TextSpanner.stencil or \override
TextSpanner.style . I didn't found, how to define own line style. In
future I'm going to use segment symbols from Bravura font (I know how
to input Unicode symbols - rather easy to find). 
Thanks in advance.
Artur Wrona.



Add a vertical line to TextSpanner

2021-01-05 Thread Thomas Morley
Hi,

I'm trying to add a vertical line to the left side of a TextSpanner.
This line should connect the TextSpanner with the middle line of the
StaffSymbol.

Here a manual done example code:

{
  \once \override TextSpanner.bound-details.left.text =
\markup
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \draw-line #'(0 . -2.85)
  b1\startTextSpan
  b1\stopTextSpan

  \once \override TextSpanner.bound-details.left.text =
\markup
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \draw-line #'(0 . -4.5)
  b1\startTextSpan
  b''1\stopTextSpan

  \once \override TextSpanner.bound-details.left.text =
\markup
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \draw-line #'(0 . -5.7)
  b1\startTextSpan
  b''1^!\stopTextSpan
}

Could this be done automagically?

Thanks,
  Harm



Re: Problem positioning TextSpanner

2020-11-11 Thread Aaron Hill

On 2020-11-11 4:06 am, Victor Olaya wrote:
I am trying to create a text spanner that groups several notes, in such 
a
way that the end of the spanner falls exactly on the last note, so 
another
one can start right after that and convey the idea the note also 
belongs to

that other group.

An image might help to clarify it. I want to do something like this:

https://www.maqamworld.com/es/maqam/rast.php

I haven't found a way of doing it, and the \startTextSpan \stopTextSpan
syntax doesn't seem to allow a note to be part of two spans.


This is where providing an example of what you have tried would be 
useful.


A note is allowed to be the end of one span and the beginning of 
another:



\version "2.20.0"

{ b'2 \startTextSpan 4 4 \stopTextSpan \startTextSpan | 4 2. 
\stopTextSpan }




-- Aaron Hill



Re: Problem positioning TextSpanner

2020-11-11 Thread Andrew Bernard
Simply adjust the left and/or right padding of the spanner. You can
look it up in the NR and Internals reference.

Andrew



Problem positioning TextSpanner

2020-11-11 Thread Victor Olaya
Hi

I am trying to create a text spanner that groups several notes, in such a
way that the end of the spanner falls exactly on the last note, so another
one can start right after that and convey the idea the note also belongs to
that other group.

An image might help to clarify it. I want to do something like this:

https://www.maqamworld.com/es/maqam/rast.php

I haven't found a way of doing it, and the \startTextSpan \stopTextSpan
syntax doesn't seem to allow a note to be part of two spans.

Any idea on how to solve this?

Thanks in advance.


Re: TextSpanner usability improvements

2020-09-25 Thread Martín Rincón Botero
Dear all,

in case there are people like me interested in having a basic syntax for
inputting text spanners, I wrote three simple functions for that matter:
\textSpan, \textSpanArrow and \textSpanDoubleArrow. They replace in
practice following overrides with user input:

\override TextSpanner.bound-details.left.text
\override TextSpanner.bound-details.right.text
\override TextSpanner.style
\override TextSpanner.bound-details.right.arrow
\override TextSpanner.bound-details.left.arrow

The syntax of these three functions is:
\textSpan "text" #'linestyle "text", and are used in combination with
\startTextSpan and \stopTextSpan. Overrides and tweaks can still be used,
preferably after and not before, so that what you change is not changed
again by these functions.

\version "2.20.0"

textSpan = #(define-music-function
   (parser location leftmarkup style rightmarkup)
   (markup? symbol? markup?)
   #{
\override TextSpanner.bound-details.left.text = \markup { \upright
#leftmarkup }
\override TextSpanner.bound-details.right.text = \markup { \upright
#rightmarkup }
\override TextSpanner.bound-details.left-broken.text = ##f
\override TextSpanner.bound-details.right-broken.text = ##f
\override TextSpanner.style = #style
\override TextSpanner.bound-details.right.arrow = ##f
\override TextSpanner.bound-details.left.arrow = ##f
   #})

textSpanArrow = #(define-music-function
   (parser location leftmarkup style rightmarkup)
   (markup? symbol? markup?)
   #{
\override TextSpanner.style = #style
\override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
\override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
\override TextSpanner.bound-details.right.arrow = ##t
\override TextSpanner.bound-details.left.text = \markup { \upright
#leftmarkup }
\override TextSpanner.bound-details.right.text = \markup { \upright
#rightmarkup }
\override TextSpanner.bound-details.left-broken.text = ##f
\override TextSpanner.bound-details.right-broken.text = ##f
\override TextSpanner.dash-period = 1.0
   #})

textSpanDoubleArrow = #(define-music-function
   (parser location leftmarkup style rightmarkup)
   (markup? symbol? markup?)
   #{
\override TextSpanner.style = #style
\override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
\override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
\override TextSpanner.bound-details.right.arrow = ##t
\override TextSpanner.bound-details.left.arrow = ##t
\override TextSpanner.bound-details.left.text = \markup { \upright
#leftmarkup }
\override TextSpanner.bound-details.right.text = \markup { \upright
#rightmarkup }
\override TextSpanner.bound-details.left-broken.text = ##f
\override TextSpanner.bound-details.right-broken.text = ##f
\override TextSpanner.dash-period = 1.0
   #})

%EXAMPLE

\relative c' {
  \textSpan \markup { \bold "press." } #'trill \markup { \italic
\center-align "norm." }
  c1\startTextSpan
  c1
  c1\stopTextSpan
  \textSpanArrow "m. vib." #'dashed-line \markup { \center-align "senza
vib."}
  \break
  c1\startTextSpan
  c1
  c1\stopTextSpan
  \break
  \textSpanDoubleArrow \markup { \box "sul pont."} #'line "sul tasto"
  c1\startTextSpan
  c1
  c1
  c1\stopTextSpan
  \textSpan \markup {\italic "air"} #'zigzag " "
  c1\startTextSpan
  c4 c2.\stopTextSpan
}

[image: image.png]

Cheers,
Martín.




Am So., 20. Sept. 2020 um 18:57 Uhr schrieb Thomas Morley <
thomasmorle...@gmail.com>:

> Am So., 20. Sept. 2020 um 17:30 Uhr schrieb Xavier Scheuer
> :
> >
> > On Sun, 20 Sep 2020 at 13:03, Thomas Morley 
> wrote:
> > >
> > > Hi Martin,
> > >
> > > in general I'm more with Aaron.
> > > P.e., I have no clue which default text one could think of for
> > > TextSpanner's left/right-text!?
> > > Otoh, I'd wish we'd have a LilyPond-data-structure to assign a list of
> > > key/value pairs in ly-syntax to a variable. Right now we can do so at
> > > top-level, in layout, paper and \with.
> > >
> > > That said, find attached a TempoSpanner-coding.
> > > I'm not sure it's the best approach at all. For sure there's wide room
> > > for improvements.
> > > Probably the best one could say: it's a proof of concept.
> >
> > Hi,
> >
> > Great! Could you add this to issue 3176 (a proof of concept is not yet a
> proper solution, but is anyway better than nothing, especially for a 7
> years old issue)?
> > https://gitlab.com/lilypond/lilypond/-/issues/3176
> >
> > Thank you!
> >
> > Cheers,
> > Xavier
> >
> > --
> > Xavier Scheuer 
> >
>
> Done, with a slightly improved and commented code:
> https://gitlab.com/lilypond/lilypond/-/issues/3176#note_415526421
>
> Cheers,
>   Harm
>


-- 
www.martinrinconbotero.com


Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-20 Thread Thomas Morley
Am So., 20. Sept. 2020 um 17:30 Uhr schrieb Xavier Scheuer
:
>
> On Sun, 20 Sep 2020 at 13:03, Thomas Morley  wrote:
> >
> > Hi Martin,
> >
> > in general I'm more with Aaron.
> > P.e., I have no clue which default text one could think of for
> > TextSpanner's left/right-text!?
> > Otoh, I'd wish we'd have a LilyPond-data-structure to assign a list of
> > key/value pairs in ly-syntax to a variable. Right now we can do so at
> > top-level, in layout, paper and \with.
> >
> > That said, find attached a TempoSpanner-coding.
> > I'm not sure it's the best approach at all. For sure there's wide room
> > for improvements.
> > Probably the best one could say: it's a proof of concept.
>
> Hi,
>
> Great! Could you add this to issue 3176 (a proof of concept is not yet a 
> proper solution, but is anyway better than nothing, especially for a 7 years 
> old issue)?
> https://gitlab.com/lilypond/lilypond/-/issues/3176
>
> Thank you!
>
> Cheers,
> Xavier
>
> --
> Xavier Scheuer 
>

Done, with a slightly improved and commented code:
https://gitlab.com/lilypond/lilypond/-/issues/3176#note_415526421

Cheers,
  Harm



Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-20 Thread Xavier Scheuer
On Sun, 20 Sep 2020 at 13:03, Thomas Morley 
wrote:
>
> Hi Martin,
>
> in general I'm more with Aaron.
> P.e., I have no clue which default text one could think of for
> TextSpanner's left/right-text!?
> Otoh, I'd wish we'd have a LilyPond-data-structure to assign a list of
> key/value pairs in ly-syntax to a variable. Right now we can do so at
> top-level, in layout, paper and \with.
>
> That said, find attached a TempoSpanner-coding.
> I'm not sure it's the best approach at all. For sure there's wide room
> for improvements.
> Probably the best one could say: it's a proof of concept.

Hi,

Great! Could you add this to issue 3176 (a proof of concept is not yet a
proper solution, but is anyway better than nothing, especially for a 7
years old issue)?
https://gitlab.com/lilypond/lilypond/-/issues/3176

Thank you!

Cheers,
Xavier

-- 
Xavier Scheuer 


Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-20 Thread Martín Rincón Botero
Hi Thomas,

thank you for your interest in this very constructive discussion with Aaron!
> in general I'm more with Aaron.
> P.e., I have no clue which default text one could think of for
> TextSpanner's left/right-text!?

Exactly, me neither. Forcing the default to be empty text without giving the 
user the chance to give input right there where the music is, is almost as 
undesirable as having “left text” and “right text” as defaults that you have to 
manually override.
> Otoh, I'd wish we'd have a LilyPond-data-structure to assign a list of
> key/value pairs in ly-syntax to a variable. Right now we can do so at
> top-level, in layout, paper and \with.

In principle, I would support this as well.
> That said, find attached a TempoSpanner-coding.
> I'm not sure it's the best approach at all. For sure there's wide room
> for improvements.
> Probably the best one could say: it's a proof of concept.

Wow! I can’t wait to start playing with this! I’ll certainly report later, 
perhaps in a different thread, my observations. Thank you!

Best regards,
Martín.
On 20. Sep 2020, 13:02 +0200, Thomas Morley , wrote:
>
> That


Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-20 Thread Thomas Morley
Am So., 20. Sept. 2020 um 12:05 Uhr schrieb Martín Rincón Botero
:
>
> In short, you and I simply
>
> disagree on what is satisfactory for syntax.
>
>
> Well, it seems we already agreed on one satisfactory syntax with the way you 
> finished the script in the other thread, so I suppose it’s not impossible to 
> agree on something ;-).
>
> We just come to LilyPond from two different perspectives. Folks
>
> like me will try to make the best of the existing system, and folks like
>
> you will contribute to improving its syntactic elegance.
>
>
> I hadn’t thought about it that way. I certainly give a lot of importance to 
> syntax. Perhaps I should try to contribute in that territory somehow. Not a 
> being a Scheme wizard limits my powers though.
>
> That said, \with is a powerful construct that need not be relegated to
>
> just context modification.
>
>
> I suppose the \with construct could be extended to uses it doesn’t have right 
> now. But I guess one would need to understand first why isn’t that 
> construction so often required in the first place.
>
>  It is good to have the "non-programmer" perspective.
>
>
> I’m glad that’s the case. Thank you for being so helpful with non-programmers 
> like me! :-).
>
> Best regards,
> Martín.
> On 19. Sep 2020, 17:41 +0200, Aaron Hill , wrote:
>
>
> existing

Hi Martin,

in general I'm more with Aaron.
P.e., I have no clue which default text one could think of for
TextSpanner's left/right-text!?
Otoh, I'd wish we'd have a LilyPond-data-structure to assign a list of
key/value pairs in ly-syntax to a variable. Right now we can do so at
top-level, in layout, paper and \with.

That said, find attached a TempoSpanner-coding.
I'm not sure it's the best approach at all. For sure there's wide room
for improvements.
Probably the best one could say: it's a proof of concept.

Cheers,
  Harm
\version "2.20.0"

#(define-event-class 'tempo-span-event 'span-event)

#(define (add-grob-definition grob-name grob-entry)
   (let* ((meta-entry   (assoc-get 'meta grob-entry))
  (class(assoc-get 'class meta-entry))
  (ifaces-entry (assoc-get 'interfaces meta-entry)))
 (set-object-property! grob-name 'translation-type? ly:grob-properties?)
 (set-object-property! grob-name 'is-grob? #t)
 (set! ifaces-entry (append (case class
  ((Item) '(item-interface))
  ((Spanner) '(spanner-interface))
  ((Paper_column) '((item-interface
 paper-column-interface)))
  ((System) '((system-interface
   spanner-interface)))
  (else '(unknown-interface)))
ifaces-entry))
 (set! ifaces-entry (uniq-list (sort ifaces-entry symbolspanner-text
  (lambda (grob)
(let* ((bound-left (ly:spanner-bound grob LEFT))
   (bound-right (ly:spanner-bound grob RIGHT))
   (bound-left-ext (ly:grob-extent bound-left bound-left X))
   (bound-left-center (interval-center bound-left-ext))
   (bound-right-ext (ly:grob-extent bound-right bound-right X))
   (bound-right-center (interval-center bound-right-ext))
   (bound-details (ly:grob-property grob 'bound-details))
   (details-right (assoc-get 'right bound-details))
   (details-left (assoc-get 'left bound-details))
   (text-padding-left (assoc-get 'text-padding details-left))
   (text-padding-right (assoc-get 'text-padding details-right))
   (left-bound-text (ly:grob-property bound-left 'text))
   (right-bound-text (ly:grob-property bound-right 'text)))
   
 (ly:grob-set-nested-property! grob '(bound-details left text) 
   #{ \markup { #left-bound-text \hspace #text-padding-left } #})
 (ly:grob-set-nested-property! grob '(bound-details right text) 
   #{ \markup { \hspace #text-padding-right #right-bound-text } #})
   
 (ly:grob-set-nested-property! grob '(bound-details left padding) 
   (-  bound-left-center))
 (ly:grob-set-nested-property! grob '(bound-details right padding) 
   (+ text-padding-right bound-right-center))
   
 (ly:side-position-interface::move-to-extremal-staff grob

#(add-grob-definition
  'TempoSpanner
  `((after-line-breaking . ,tempo-text->spanner-text)
(bound-details . ((left . ((Y . 0)
   (padding . 0.25)
   (text-padding . 0.4)
   (stencil-offset . (0 . -0.5))
   ))
  (right . ((Y . 0)
(padding . 0.25)
(stencil-offset . (0 . -0.5))
(text-padding . 0.4)
))
  ))
(dash-fraction . 0.4)
(dash-period . 

Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-20 Thread Martín Rincón Botero
> In short, you and I simply
> disagree on what is satisfactory for syntax.

Well, it seems we already agreed on one satisfactory syntax with the way you 
finished the script in the other thread, so I suppose it’s not impossible to 
agree on something ;-).
> We just come to LilyPond from two different perspectives. Folks
> like me will try to make the best of the existing system, and folks like
> you will contribute to improving its syntactic elegance.

I hadn’t thought about it that way. I certainly give a lot of importance to 
syntax. Perhaps I should try to contribute in that territory somehow. Not a 
being a Scheme wizard limits my powers though.
> That said, \with is a powerful construct that need not be relegated to
> just context modification.

I suppose the \with construct could be extended to uses it doesn’t have right 
now. But I guess one would need to understand first why isn’t that construction 
so often required in the first place.
>  It is good to have the "non-programmer" perspective.

I’m glad that’s the case. Thank you for being so helpful with non-programmers 
like me! :-).

Best regards,
Martín.
On 19. Sep 2020, 17:41 +0200, Aaron Hill , wrote:
>
> existing


Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-19 Thread Aaron Hill

On 2020-09-19 12:31 am, Martín Rincón Botero wrote:

[ . . . ]


I was going to comment on your reply in greater detail, but I realized 
it would not be terribly productive.  In short, you and I simply 
disagree on what is satisfactory for syntax.  And that is not a bad 
thing.  We just come to LilyPond from two different perspectives.  Folks 
like me will try to make the best of the existing system, and folks like 
you will contribute to improving its syntactic elegance.


That said, \with is a powerful construct that need not be relegated to 
just context modification.  Also, this Kool-Aid(tm) is really quite 
refreshing!




Yes, the script I started writing and that you splendidly finished is
a workaround, not a solution. I’m not a programmer, so the day I can
actually make a pull request for issues like these might never come.
It would be great if such spanners can be implemented!


It is good to have the "non-programmer" perspective.  Mind you, I would 
argue your use of LilyPond and interest in Scheme means you have already 
begun your journey as a programmer.  (:



-- Aaron Hill



Re: TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-19 Thread Martín Rincón Botero
> I am uncertain what you mean by "proper" markup syntax.

Sorry, I meant syntax for markup tagging.
> while interesting, is invalid syntax and surely not proper. Perhaps
> you simply meant something that *looks* like it could be valid LilyPond.

how can a proposed syntax (for which functions have to be written yet) as 
example be invalid? It surely has to look like it could be valid Lilypond!
> Including all of these as
> parameters to a function could make the function unwieldy to use when
> one only needs to specify a few values. Optional arguments help to some
> degree, but they aren't perfect especially when there is ambiguity of
> types.

At no point is my suggestion to “all” of these parameters in a function. My 
suggestion is to have a basic function with “sensible” defaults. They can 
always be tweaked or overridden by the user as desired. That’s what \override 
and \tweak are for.
> And users of TextSpanners should invest in creating
> their own wrappers for commonly used items.

No they shouldn’t. They have to if they want to have a legible code with a 
proper markup tagging.
> b'4 a' g'2\startTextSpan \with { left-text = "rit."
>  to-barline = ##t } |
>  f'4 g'8 a' g'2 | a'1\stopTextSpan }

I also was thinking of the better possibility that \startTextSpan can take 
arguments. The \with function is not meant for data input but for changing 
context properties. And if we’re starting to put text where it actually belongs 
in the music, certainly saying “left-text” for the \startTextSpan function is 
redundant. If \startTextSpan accepts text, \stopTextSpan should accept the 
right part of the text, so that it appears in the correct place in the music. A 
basic (hypothetical) c1\startTextSpan "left" c1 c1\stopTextSpan "right" would 
be a massive improvement in readability. If this function could stop being 
“misused” for tempo variations (if we had tempo spanners), then I suppose the 
italics by default could go away (I can’t think of other reason why they have 
to be italics by default!)
> That approach would better preserve the semantics of the underlying
> elements. Consuming a \tempo command only to produce a \markup that
> *looks* like a MetronomeMark but is not one leads to issues as you found
> with MIDI. The Tempo_performer cannot do what it needs to do as it does
> not understand what the \markup means. That is not to mention that the
> use of \tempo occurs at the wrong moment in the music. Such a proposed
> MetronomeSpanner would terminate with an actual \tempo command on either
> end at the correct moments. And the Tempo_performer could be improved
> to understand how to interpolate tempos that are connected by spanners.

Yes, the script I started writing and that you splendidly finished is a 
workaround, not a solution. I’m not a programmer, so the day I can actually 
make a pull request for issues like these might never come. It would be great 
if such spanners can be implemented!
> I wonder if the parser's \etc could support defining new functions that
> borrow the syntax from built-in ones:

That would be nice as well :-).
On 19. Sep 2020, 07:01 +0200, Aaron Hill , wrote:
>
> I am uncertain what you mean by "proper" markup syntax.


TextSpanner usability improvements (was Re: Scheme predicative types)

2020-09-18 Thread Aaron Hill

On 2020-09-18 2:06 pm, Martín Rincón Botero wrote:

[...] There are two
unsatisfactory problems for usability involved from my point of view. 
One

is the impossibility to use proper markup syntax for text spanners.


I am uncertain what you mean by "proper" markup syntax.  Even though 
they are called "TextSpanners", the text can be any markup? value:



{ b'4 -\tweak bound-details.left.text \markup \box ?
  -\tweak bound-details.right.text \markup \circle !
  -\tweak font-series #'bold
  -\tweak font-shape #'upright
  \startTextSpan
  a' g'2 | f'4 g'8 a' g'2 | a'1\stopTextSpan }


Your proposed...


\markupSpan { "sul pont." \arrow "sul tasto" }


...while interesting, is invalid syntax and surely not proper.  Perhaps 
you simply meant something that *looks* like it could be valid LilyPond.




[...] In the case of
text spanners, the default has no musical use: a dashed line with no 
text
on either side. The syntax of a text spanner has the serious omission 
of
starting something without user input (\startTextSpan starts what? The 
user

should have an "interface" to give an initial input.


Consider a \textSpan function that has you specify the left and right 
text.  What happens when you only need left-side text?  Is it 
satisfactory for a user to have to say \textSpan "left" ""?  Next, there 
are options for padding and whether the side of the spanner terminates 
in an arrow.  What happens when you need to specify the padding on one 
side and the arrow-type on the other?  Including all of these as 
parameters to a function could make the function unwieldy to use when 
one only needs to specify a few values.  Optional arguments help to some 
degree, but they aren't perfect especially when there is ambiguity of 
types.


The existing interface for TextSpanners requires that one manually 
\override or \tweak properties so that you only specify what you need.  
This may seem cumbersome when adjusting many things, but it is at least 
very clear what is going on.  You certainly don't have to remember which 
argument is which.  And users of TextSpanners should invest in creating 
their own wrappers for commonly used items.  Consider something like 
this:



startRitSpan =
  -\tweak bound-details.left.text "rit."
  -\tweak to-barline ##t
  \startTextSpan

{ b'4 a' g'2\startRitSpan |
  f'4 g'8 a' g'2 | a'1\stopTextSpan }


The result is something that is more succinct to use within the actual 
music, uncluttered by \overrides and \tweaks.  And being reusable 
assists in keeping the overall score consistent.  (It is mildly annoying 
though to have to use \stopTextSpan, but it is probably better than 
polluting the namespace with a whole host of \stop*Span aliases that all 
do the same thing.)


While the above is some defense of the existing interface, there could 
be ways to improve the experience.  For instance, imagine this:



{ b'4 a' g'2\startTextSpan \with { left-text = "rit."
   to-barline = ##t } |
  f'4 g'8 a' g'2 | a'1\stopTextSpan }


I do wonder if my obsession with ly:context-mod? goes too far, but I 
keep finding that the \with {} construct is a great alternative to 
variable argument lists.  There is never any confusion as properties are 
well-named; plus, the construct is quite extensible.




[...] The second issue is the mentioned 2013
issue. Lilypond lacks the possibility of using text spanners not only 
with

a \tempo syntax (which thanks to your script is very well solved now!),
something that makes the "music" in the code more legible (because 
there is
proper markup of musical events) but also to format the whole thing as 
a

\tempo marking in the score (tempo indications are not attached to the
staff but to the system, and horizontally metronome marks are not 
attached
to the first note of the measure but to the time signature above which 
they

are centered, that's why I included \halign properties in the script as
workaround).


That would point to TextSpanners not being the right fit/tool for the 
job.  What we perhaps need is something like a MetronomeSpanner and 
possibly a RehearsalSpanner--connecting MetronomeMarks and 
RehearsalMarks, respectively.  And then we need a way to attach the 
spanner to \tempos or \marks in an equivalent manner as you attach 
TextSpanners to notes.


That approach would better preserve the semantics of the underlying 
elements.  Consuming a \tempo command only to produce a \markup that 
*looks* like a MetronomeMark but is not one leads to issues as you found 
with MIDI.  The Tempo_performer cannot do what it needs to do as it does 
not understand what the \markup means.  That is not to mention that the 
use of \tempo occurs at the wrong moment in the music.  Such a proposed 
MetronomeSpanner would terminate with an actual \tempo command on either 
end at the correct moments.  And the Tempo_performer could be improved 
to understand how to interpolate tempos that are 

Re: TextSpanner shortcut

2020-03-18 Thread foxfanfare
Aaron Hill wrote
> No worries.  Does this help?

That's perfect! Thank you very much :)




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



Re: TextSpanner shortcut

2020-03-18 Thread Aaron Hill

On 2020-03-18 3:51 am, foxfanfare wrote:
Thank you Aaron for the explanation. I was trying the make-music 
solution as

I was also trying to make a generic function, something like:

c4-\mySpan "molto rit." d e f g1\stopTextSpan


No worries.  Does this help?


\version "2.20.0"

startTextSpanWithLeftText =
  #(define-music-function (text) (markup?)
#{ -\tweak bound-details.left.text #text
\startTextSpan #})

% startTextSpanWithLeftText =
%   #(define-music-function (text) (markup?)
% (make-music
%   'TextSpanEvent
%   'tweaks `(((#t bound-details left text) . ,text))
%   'span-direction START))

rit = \startTextSpanWithLeftText "rit."

{ a'4\rit g'8 f' b'2\stopTextSpan }


NOTE: I provided a version that shows the equivalent make-music usage.


-- Aaron Hill



Re: TextSpanner shortcut

2020-03-18 Thread foxfanfare
Aaron Hill wrote
> span-type and span-text are for dynamic text spanners (e.g. 
> CrescendoEvent).  You can set these music properties for a 
> TextSpanEvent, but Text_spanner_engraver will just ignore them.
> 
> Instead, you should \override or \tweak the bound-details of TextSpanner 
> to attach text to the left or right end of the span.  Something like 
> this avoids the need to use make-music:

Thank you Aaron for the explanation. I was trying the make-music solution as
I was also trying to make a generic function, something like:

c4-\mySpan "molto rit." d e f g1\stopTextSpan

Unfortunately, your solution doesn't allow that:
mySpan = -\tweak bound-details.left.text \etc \startTextSpan

I'm curretly re-writing my shortcuts and configuration files in lilypond. I
try to rationalize it and avoid the massive recourse of independent
shortcuts (for instance, rit=... , moltoRit=... etc.). Maybe that has
already been discussed somewhere else but I wasn't able to find the
solution?



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



Re: TextSpanner shortcut

2020-03-17 Thread Aaron Hill

On 2020-03-17 10:05 am, foxfanfare wrote:

Hi all,

Could anyone could tell me what's wrong with my shortcut?
It's printing the spanner correctly but not the text:

rit =
  #(make-music 'TextSpanEvent
   'span-direction -1
   'span-type 'text
   'span-text "rit.")

\score {
  \new Staff \relative c'' {
c4\<\rit
d e f
g1\!\stopTextSpan
  }
}


span-type and span-text are for dynamic text spanners (e.g. 
CrescendoEvent).  You can set these music properties for a 
TextSpanEvent, but Text_spanner_engraver will just ignore them.


Instead, you should \override or \tweak the bound-details of TextSpanner 
to attach text to the left or right end of the span.  Something like 
this avoids the need to use make-music:



\version "2.20.0"

rit = -\tweak bound-details.left.text "rit." \startTextSpan

{ a'4\rit g'8 f' b'2\stopTextSpan }



-- Aaron Hill



TextSpanner shortcut

2020-03-17 Thread foxfanfare
Hi all,

Could anyone could tell me what's wrong with my shortcut?
It's printing the spanner correctly but not the text:

rit =
  #(make-music 'TextSpanEvent
   'span-direction -1
   'span-type 'text
   'span-text "rit.")

\score {
  \new Staff \relative c'' {
c4\<\rit
d e f
g1\!\stopTextSpan
  }
}



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



Re: Allowing TextSpanner lines to collide, but not the end text

2019-09-13 Thread michaellee94
I'm going to bump this, if that's alright. Is there a way to disable
collision avoidance for just the line of a TextSpanner, not the ends? Maybe
ditch the TextSpanner idea altogether? Is there a clever use of
staff-padding?



--
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


Allowing TextSpanner lines to collide, but not the end text

2019-09-06 Thread michaellee94
I'm in the middle of editing a score that uses custom TextSpanners (the
Haupstimme and Nebenstimme spanners constructed in
http://lsr.di.unimi.it/LSR/Item?id=843). Sometimes the melodic lines go
above the staff, and in this case, I'd like to make sure that the glyphs
don't collide with the notes, but I don't really care about the invisible
line in between them. I've attached an example of the typical behavior. If
possible, I'd like the positioning of the H and bracket in the right-hand
case to match the positioning in the left-hand case. Would anybody know how
to achieve this? I assume there's a general property of TextSpanners that
allows for it. Thank you for your help!

test.ly   


 



--
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: Finetuning TextSpanner beginning and end positions?

2019-05-10 Thread Stefano Troncaro
Hi Harm, I looked at it quickly and it's an amazing change! I'm not a
native speaker either but I will think about it later today and see if I
can come up with any improvement of the kind you mentioned. Thank you!

El jue., 9 may. 2019 a las 20:49, Thomas Morley ()
escribió:

> Hi Stefano,
>
> Am Mi., 8. Mai 2019 um 05:16 Uhr schrieb Stefano Troncaro
> :
>
> > my workflow in these scenarios is to go to the description of the object
> which is giving me trouble, see what interfaces and properties it has, and
> from there work out what I need to do. This is also what the Lilypond
> manuals suggest. So, if the purpose of the Internals Reference is "to
> present information precisely and concisely", for me a precise description
> would be at the very least to have a list of it's sub-properties.
> >
> > I think someone explained to me some time ago (in a similar situation
> with an alist of properties although I don't remember specifically with
> what) that this is not possible because of the way the documentation is
> automatically generated.
>
> Well, putting stuff into IR is different from usual doc-work, but not
> impossible.
> I created
> #5518 Document bound-details (sub-)properties in line-spanner-cc for IR
> https://sourceforge.net/p/testlilyissues/issues/5518/
>
> Patch is up for review here:
> https://codereview.appspot.com/560670043/
>
> Descriptions are mostly taken from NR.
> Though, I'm not a native speaker. Any suggestions for better wording,
> grammar, syntax etc is welcome.
>
> I think with your google-account you can log in there and do any
> inline-comments you wish.
>
> Attached, an excerpt from internals.pdf showing how it looks after patch.
>
> Cheers,
>   Harm
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-09 Thread Thomas Morley
Hi Stefano,

Am Mi., 8. Mai 2019 um 05:16 Uhr schrieb Stefano Troncaro
:

> my workflow in these scenarios is to go to the description of the object 
> which is giving me trouble, see what interfaces and properties it has, and 
> from there work out what I need to do. This is also what the Lilypond manuals 
> suggest. So, if the purpose of the Internals Reference is "to present 
> information precisely and concisely", for me a precise description would be 
> at the very least to have a list of it's sub-properties.
>
> I think someone explained to me some time ago (in a similar situation with an 
> alist of properties although I don't remember specifically with what) that 
> this is not possible because of the way the documentation is automatically 
> generated.

Well, putting stuff into IR is different from usual doc-work, but not
impossible.
I created
#5518 Document bound-details (sub-)properties in line-spanner-cc for IR
https://sourceforge.net/p/testlilyissues/issues/5518/

Patch is up for review here:
https://codereview.appspot.com/560670043/

Descriptions are mostly taken from NR.
Though, I'm not a native speaker. Any suggestions for better wording,
grammar, syntax etc is welcome.

I think with your google-account you can log in there and do any
inline-comments you wish.

Attached, an excerpt from internals.pdf showing how it looks after patch.

Cheers,
  Harm


internals-excerpt.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-07 Thread Stefano Troncaro
Admittedly, as opposed to other Grob.padding settings no object is
> moved, instead the TextSpanner itself changes its appearance.
>
I think you nailed the root of why I think the naming is confusing. Funnily
enough I do think that the name "padding" is appropriate for Glissandos,
where it is a measure of how much white-space there is between the end of
the glissando and it's notehead. I just don't find it intuitive for
TextSpanners in particular. I agree however that this ship has sailed.

Werner, I looked at the documentation trying to see what I would have
needed to be different in order to be able to find this knowledge on my
own. For me personally it would have been to have the Internals Reference
offer a very concise yet detailed description of the sub-properties of the
bound-details property of the line-spanner-interface
<http://lilypond.org/doc/v2.19/Documentation/internals/line_002dspanner_002dinterface>
.
This is because my workflow in these scenarios is to go to the description
of the object which is giving me trouble, see what interfaces and
properties it has, and from there work out what I need to do. This is also
what the Lilypond manuals suggest
<http://lilypond.org/doc/v2.19/Documentation/learning/properties-of-layout-objects>.
So, if the purpose of the Internals Reference is "to present information
precisely and concisely", for me a precise description would be at the very
least to have a list of it's sub-properties.

I think someone explained to me some time ago (in a similar situation with
an alist of properties although I don't remember specifically with what)
that this is not possible because of the way the documentation is
automatically generated. If this is not possible then a visual example in
this verbose description
<http://lilypond.org/doc/v2.19/Documentation/notation/spanners#using-the-line_002dspanner_002dinterfacehttp://lilypond.org/doc/v2.19/Documentation/notation/spanners#using-the-line_002dspanner_002dinterface>
of the line-spanner-interface would be my next bet: a short snippet that
shows it's effect in a few different grobs would probably be enough to be
able to find it when hunting for a solution.

Do any of the above seem feasible?

El mar., 7 may. 2019 a las 6:53, Thomas Morley ()
escribió:

> Am Di., 7. Mai 2019 um 01:53 Uhr schrieb Stefano Troncaro
> :
> >
> > Hi Harm, honestly because I generally understand "padding" as the amount
> of whitespace that should be reserved between objects.
>
> Well, that's exactly what happens here.
> bound-details.right.padding is the amount of white-space between the
> end of the TextSpanner and its right-bound.
> Thus the negative value, as opposed to your code going for 'X.
> Admittedly, as opposed to other Grob.padding settings no object is
> moved, instead the TextSpanner itself changes its appearance.
>
> I _guess_ (without having researched) it's also due to historical reasons:
> Going for 'shorten-pair for TextSpanner would have needed additional
> code to limit it to certain parts of a broken spanner, whereas
> bound-details.left/right/left-broken/right-broken.padding
> offers the user a direct method to set whats wished for each end of a
> broken TextSpanner.
> Thus, replacing the values of
> bound-details.left/right/left-broken/right-broken.padding by those
> from shorten-pair is not that straight-forward.
> Probably the name of the padding-_sub_-property is unfortunate.
> Though, I think this ship sailed long time ago.
>
> Btw
> \override TextSpanner.padding = 10
> _moves_ the TextSpanner, nothing else, as everyone would expect.
>
>
> Cheers,
>   Harm
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-07 Thread Thomas Morley
Am Di., 7. Mai 2019 um 01:53 Uhr schrieb Stefano Troncaro
:
>
> Hi Harm, honestly because I generally understand "padding" as the amount of 
> whitespace that should be reserved between objects.

Well, that's exactly what happens here.
bound-details.right.padding is the amount of white-space between the
end of the TextSpanner and its right-bound.
Thus the negative value, as opposed to your code going for 'X.
Admittedly, as opposed to other Grob.padding settings no object is
moved, instead the TextSpanner itself changes its appearance.

I _guess_ (without having researched) it's also due to historical reasons:
Going for 'shorten-pair for TextSpanner would have needed additional
code to limit it to certain parts of a broken spanner, whereas
bound-details.left/right/left-broken/right-broken.padding
offers the user a direct method to set whats wished for each end of a
broken TextSpanner.
Thus, replacing the values of
bound-details.left/right/left-broken/right-broken.padding by those
from shorten-pair is not that straight-forward.
Probably the name of the padding-_sub_-property is unfortunate.
Though, I think this ship sailed long time ago.

Btw
\override TextSpanner.padding = 10
_moves_ the TextSpanner, nothing else, as everyone would expect.


Cheers,
  Harm

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


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Werner LEMBERG


> [...] I generally understand "padding" as the amount of whitespace
> that should be reserved between objects.  I never even noticed that
> property since in my mind I was looking for something that could in
> no way have something to do with it.  Anyways, it's not the first
> time I find some of the Lilypond naming misleading, it's probably
> not going to be the last, but after you explained I can *kind of*
> see why it was named like that.

Can you accordingly make suggestions to improve the documentation?


Werner

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


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Andrew Bernard
Hi Stefano,

There are many threads in the archives about this inconsistency with text
spanners. It's very confusing for users, nad ends up wasting lots of time.
It would be great if this could be unified with the 'shorten' commands of
other objects, but I realise the developers are hugely constrained for time
and resources. Maybe one day.

Andrew


On Tue, 7 May 2019 at 09:53, Stefano Troncaro 
wrote:

> Hi Harm, honestly because I generally understand "padding" as the amount
> of whitespace that should be reserved between objects. I never even noticed
> that property since in my mind I was looking for something that could in no
> way have something to do with it. Anyways, it's not the first time I find
> some of the Lilypond naming misleading, it's probably not going to be the
> last, but after you explained I can *kind of* see why it was named like
> that.
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Stefano Troncaro
Hi Harm, honestly because I generally understand "padding" as the amount of
whitespace that should be reserved between objects. I never even noticed
that property since in my mind I was looking for something that could in no
way have something to do with it. Anyways, it's not the first time I find
some of the Lilypond naming misleading, it's probably not going to be the
last, but after you explained I can *kind of* see why it was named like
that.

As always, thank you for your input!
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Thomas Morley
Am Di., 7. Mai 2019 um 00:23 Uhr schrieb Stefano Troncaro
:
>
> Hi Rick,
>
> Thank you for your answer. I didn't know that 'bound-details had an X 
> property. It does what I need but it can get tedious to use because I need to 
> specify a number from the start of the spanner (or the system if the spanner 
> is broken into many systems). It takes some trial and error to find the right 
> number and all that work is undone if the spacing changes.
>
> That however led me to writing this function that offsets the 'X value of the 
> 'right-bound-info property, which is the procedure that calculates where the 
> spanner ends. I'm copying it here so it can be used if someone finds it 
> useful or is searching for a similar question in the future.
>
>> \version "2.19.83"
>>
>> ALB-OffsetRBNfo-X =
>> #(define-scheme-function (n) (number?)
>>"Offset the X position at the end of a breakable object that determines 
>> its X position
>> through the 'right-bound-info procedure."
>>(lambda (grob)
>>  (let* ((bound-right (ly:spanner-bound grob RIGHT))
>> (broken-right (= (ly:item-break-dir bound-right) CENTER)))
>>(if broken-right
>>(let* ((rbnfo (ly:grob-property grob 'right-bound-info #f))
>>   (rbnfo (map (lambda (pair)
>> (if (eq? 'X (car pair))
>> (cons 'X (+ (cdr pair) n))
>> pair))
>>rbnfo)))
>>  (ly:grob-set-property! grob 'right-bound-info rbnfo))
>>
>> \relative {
>>   \override TextSpanner.bound-details.left.text = "sample spanner"
>>   \override TextSpanner.after-line-breaking = \ALB-OffsetRBNfo-X 15
>>   c'\startTextSpan d e f | g a g f \break | e f e d | c1\stopTextSpan
>> }

Why not:

  \override TextSpanner.bound-details.right-broken.padding = 0.25
  \override TextSpanner.bound-details.right.padding = -15

The first to keep the default for right-broken TextSpanner.
(Per default bound-details.right-broken is unset for TextSpanners and
thus copies bound-details.right)
The second to affect bound-details.right.padding as wished.


Cheers,
  Harm

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


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Stefano Troncaro
Hi Rick,

Thank you for your answer. I didn't know that 'bound-details had an X
property. It does what I need but it can get tedious to use because I need
to specify a number from the start of the spanner (or the system if the
spanner is broken into many systems). It takes some trial and error to find
the right number and all that work is undone if the spacing changes.

That however led me to writing this function that offsets the 'X value of
the 'right-bound-info property, which is the procedure that calculates
where the spanner ends. I'm copying it here so it can be used if someone
finds it useful or is searching for a similar question in the future.

\version "2.19.83"
>
> ALB-OffsetRBNfo-X =
> #(define-scheme-function (n) (number?)
>"Offset the X position at the end of a breakable object that determines
> its X position
> through the 'right-bound-info procedure."
>(lambda (grob)
>  (let* ((bound-right (ly:spanner-bound grob RIGHT))
> (broken-right (= (ly:item-break-dir bound-right) CENTER)))
>(if broken-right
>(let* ((rbnfo (ly:grob-property grob 'right-bound-info #f))
>   (rbnfo (map (lambda (pair)
> (if (eq? 'X (car pair))
> (cons 'X (+ (cdr pair) n))
> pair))
>rbnfo)))
>  (ly:grob-set-property! grob 'right-bound-info rbnfo))
>
> \relative {
>   \override TextSpanner.bound-details.left.text = "sample spanner"
>   \override TextSpanner.after-line-breaking = \ALB-OffsetRBNfo-X 15
>   c'\startTextSpan d e f | g a g f \break | e f e d | c1\stopTextSpan
> }
>



El lun., 6 may. 2019 a las 17:27, Rick Kimpel ()
escribió:

> Stefano,
> Have you tried bound-details? I use this for glissandi, and it works well.
> http://lilypond.org/doc/v2.19/Documentation/internals/textspanner
> Rick
>
> --
> *From:* lilypond-user  outlook@gnu.org> on behalf of Stefano Troncaro <
> stefanotronc...@gmail.com>
> *Sent:* Monday, May 6, 2019 11:50 AM
> *To:* lilypond-user Mailinglist
> *Subject:* Finetuning TextSpanner beginning and end positions?
>
> Hello again everyone,
>
> I was expecting to be able to use shorten-pair for this in the same way
> that is used with Hairpins, but it doesn't seem to work and I can't seem to
> find what property I need to tweak.
>
> Any pointers?
> Thanks for your help,
> Stéfano
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Rick Kimpel
Stefano,
Have you tried bound-details? I use this for glissandi, and it works well.
http://lilypond.org/doc/v2.19/Documentation/internals/textspanner
Rick


From: lilypond-user  on 
behalf of Stefano Troncaro 
Sent: Monday, May 6, 2019 11:50 AM
To: lilypond-user Mailinglist
Subject: Finetuning TextSpanner beginning and end positions?

Hello again everyone,

I was expecting to be able to use shorten-pair for this in the same way that is 
used with Hairpins, but it doesn't seem to work and I can't seem to find what 
property I need to tweak.

Any pointers?
Thanks for your help,
Stéfano
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Finetuning TextSpanner beginning and end positions?

2019-05-06 Thread Stefano Troncaro
Hello again everyone,

I was expecting to be able to use shorten-pair for this in the same way
that is used with Hairpins, but it doesn't seem to work and I can't seem to
find what property I need to tweak.

Any pointers?
Thanks for your help,
Stéfano
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Reverting TextSpanner properties

2019-02-07 Thread Andrew Bernard
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

2019-02-07 Thread Aaron Hill

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

2019-02-07 Thread Reggie
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

2019-02-07 Thread Andrew Bernard
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

2019-02-07 Thread David Kastrup
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

2019-02-07 Thread Andrew Bernard
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

2019-02-07 Thread Andrew Bernard
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

2019-02-07 Thread David Kastrup
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

2019-02-07 Thread Pierre Perol-Schneider
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

2019-02-06 Thread Andrew Bernard
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


Re: Shorten TextSpanner dashed line

2018-12-30 Thread Andrew Bernard
Hi Davide,

You could play with this:

  \override TextSpanner.bound-details.right.padding = 1

Have a look at the internals reference.

Andrew

On Mon, 31 Dec 2018 at 09:47, Davide Liessi  wrote:

> Is it possible to automatically shorten the dashed line in
> TextSpanners so that the line of the first TextSpanner ends before the
> left text of the second TextSpanner (and thus the two TextSpanners can
> align vertically)?
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Shorten TextSpanner dashed line

2018-12-30 Thread Davide Liessi
Hi all.
Is it possible to automatically shorten the dashed line in
TextSpanners so that the line of the first TextSpanner ends before the
left text of the second TextSpanner (and thus the two TextSpanners can
align vertically)?

\version "2.19.82"
{
  \override TextSpanner.bound-details.left.text = "test"
  b1\startTextSpan
  b1\stopTextSpan\startTextSpan
  b1\stopTextSpan
}

In alternative, is it possible to shorten the TextSpanners' X-extent
by the appropriate amount?

Best wishes.
Davide

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


Re: Baseline align in TextSpanner

2018-10-17 Thread Trevor Bača
Hi Davide,

Avoid the the LilyPond \tempo command entirely: then use markup (in text
spanner bound-details) for everything. Alignment (baseline and otherwise)
can then be controlled with text spanner bound-details.

If you need an empty region of of whitespace between two elements in your
(possibly enchained) text spanners, play with the dash fraction / dash
period of the text spanner to make the dashes disappear, leaving only your
markup visible.

Trevor.



On Sun, Oct 14, 2018 at 2:17 PM Davide Liessi 
wrote:

> Dear Kieren,
>
> Il giorno ven 5 ott 2018 alle ore 15:11 Kieren MacMillan
>  ha scritto:
> > This works for me:
> [...]
>
> your solution works well to keep all TextSpanners baseline-aligned,
> but it still does not solve my real problem, which indeed was not
> apparent in my first message.
> I'm trying to make TextSpanners and tempo markings look the same,
> including being aligned at the same baseline.
> The reason is to follow the recommendations of Gould for tempo
> alteration markings (example at page 184).
>
> A slightly more realistic example follows: I would like to align
> \tempo markings and TextSpanners to the same baseline.
> As you can see using your trick on both does achieve the desired result.
> I renamed the \test function to a more specific \baseline-align.
> I'm cc-ing also Harm / Thomas Morley because I'm using his code, so he
> may have some insights or suggestions.
>
> Thanks for your help so far.
> Best wishes!
> Davide
>
> %%% new example
> \version "2.19.81"
>
> #(define (lists-map function ls)
>"Apply @var{function} to @var{ls} and all of it sublists.
> First it recurses over the children, then the function is applied to
> @var{ls}."
>(if (list? ls)
>(set! ls (map (lambda (y) (lists-map function y)) ls))
>ls)
>(function ls))
>
> #(define baseline-align-proc
>(lambda (e)
>  (if (and (list? e) (member 'glyph-string e))
>  (begin
>   (for-each
>(lambda (x)
>  (begin
>   (set-car! (cadr x) 0)
>   x))
>(cadr (last e)))
>   e)
>  e)))
>
> #(define-markup-command (baseline-align layout props glyph-name)
>(markup?)
>(let* ((stil (interpret-markup layout props glyph-name))
>   (new-stile-expr
>(lists-map
> baseline-align-proc
> (ly:stencil-expr stil
>
>  (ly:make-stencil
>   new-stile-expr
>   (ly:stencil-extent stil X)
>   ;(cons 0 (cdr (ly:stencil-extent stil Y)))
>   (ly:stencil-extent stil Y)
>   )))
>
> startTempoSpan =
> #(define-event-function
>   (left-text)
>   (markup?)
>   #{
> \tweak bound-details.left.text \markup {
>   \combine \transparent "Tj"
>   #left-text
> }
> \tweak font-shape #'upright
> \tweak font-size 1
> \tweak font-series #'bold
> \startTextSpan
>   #})
> stopTempoSpan = \stopTextSpan
>
> {
>   R1 |
>   \tempo \markup { \baseline-align \large "a" }
>   R1 |
>   \tempo \markup { \baseline-align \large "p" }
>   R1 |
>   <>\startTempoSpan "a"
>   R1
>   <>\stopTempoSpan |
>   R1 |
>   <>\startTempoSpan "p"
>   R1
>   <>\stopTempoSpan |
>   R1
>   \tempo \markup { \large \combine \transparent "Tj" "a" }
>   R1 |
>   \tempo \markup { \large \combine \transparent "Tj" "p" }
>   R1 |
> }
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: textSpanner at arbitrary positions independent of music

2018-10-14 Thread Ryan Michael
I figured it out, I had to make a spacer notes in a seperate voice to cover
the system break. e.g.

%
<<
\new Voice {
\once
\override TextSpanner.bound-details.left.text =
  \markup { \upright \huge "molto rit." }
s1\startTextSpan s1 s8 s8 s8 s8 s8 s8 s8 s8 s8\stopTextSpan %here is where
the system break occured

}
\new Voice {
r1 r1 r1
}
>>

r1\startTextSpan r1\stopTextSpan


On Sun, Oct 14, 2018 at 2:27 AM Ryan Michael 
wrote:

> THank you Pierre,
> exactly what i was looking for. However, how can i turn off the left
> textSpan property if i want to span four bars which is broken over two
> systems, and i don't wish to repeat the "molto rit" for the left attribute
> of the span in the second system?
>
> On Sun, Oct 14, 2018 at 1:34 AM Pierre Perol-Schneider <
> pierre.schneider.pa...@gmail.com> wrote:
>
>> Hi Ryan,
>> Your example does not compile.
>> How about putting the text into the sapnner ?
>> Cf.
>> http://lilypond.org/doc/v2.18/Documentation/notation/writing-text.html#text-spanners
>> Cheers,
>> Pierre
>>
>> Le dim. 14 oct. 2018 à 09:38, Ryan Michael  a
>> écrit :
>>
>>> Hi all
>>>
>>> So i have a scenario where I want a textSpanner to follow a heading i
>>> have
>>> over the treble clef of a system where there is only action in the left
>>> hand (Bass clef). e.g.
>>>
>>> %
>>> \version "2.18.2"
>>> up = \new Staff = "up" {
>>> r1/^\markup{\huge "molto rit."}  r1\startTextSpanner r1
>>> r1\stopTextSpanner
>>> }
>>>
>>> down = \new Staff = "down" {
>>> c,,4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4
>>> }
>>> {
>>>   \new PianoStaff <<
>>>  \up
>>>\down
>>>   >>
>>> }
>>> 
>>>
>>> my issues is that i want the spanner to really start immediately after
>>> the markup. do i have to make some fake notes in the right hand to anchor
>>> the spanner or can i just move it around by other means?
>>>
>>> best,
>>> ryan.
>>> --
>>> ॐ नमः शिवाय
>>> ___
>>> 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


Re: Baseline align in TextSpanner

2018-10-14 Thread Davide Liessi
Dear Kieren,

Il giorno ven 5 ott 2018 alle ore 15:11 Kieren MacMillan
 ha scritto:
> This works for me:
[...]

your solution works well to keep all TextSpanners baseline-aligned,
but it still does not solve my real problem, which indeed was not
apparent in my first message.
I'm trying to make TextSpanners and tempo markings look the same,
including being aligned at the same baseline.
The reason is to follow the recommendations of Gould for tempo
alteration markings (example at page 184).

A slightly more realistic example follows: I would like to align
\tempo markings and TextSpanners to the same baseline.
As you can see using your trick on both does achieve the desired result.
I renamed the \test function to a more specific \baseline-align.
I'm cc-ing also Harm / Thomas Morley because I'm using his code, so he
may have some insights or suggestions.

Thanks for your help so far.
Best wishes!
Davide

%%% new example
\version "2.19.81"

#(define (lists-map function ls)
   "Apply @var{function} to @var{ls} and all of it sublists.
First it recurses over the children, then the function is applied to
@var{ls}."
   (if (list? ls)
   (set! ls (map (lambda (y) (lists-map function y)) ls))
   ls)
   (function ls))

#(define baseline-align-proc
   (lambda (e)
 (if (and (list? e) (member 'glyph-string e))
 (begin
  (for-each
   (lambda (x)
 (begin
  (set-car! (cadr x) 0)
  x))
   (cadr (last e)))
  e)
 e)))

#(define-markup-command (baseline-align layout props glyph-name)
   (markup?)
   (let* ((stil (interpret-markup layout props glyph-name))
  (new-stile-expr
   (lists-map
baseline-align-proc
(ly:stencil-expr stil

 (ly:make-stencil
  new-stile-expr
  (ly:stencil-extent stil X)
  ;(cons 0 (cdr (ly:stencil-extent stil Y)))
  (ly:stencil-extent stil Y)
  )))

startTempoSpan =
#(define-event-function
  (left-text)
  (markup?)
  #{
\tweak bound-details.left.text \markup {
  \combine \transparent "Tj"
  #left-text
}
\tweak font-shape #'upright
\tweak font-size 1
\tweak font-series #'bold
\startTextSpan
  #})
stopTempoSpan = \stopTextSpan

{
  R1 |
  \tempo \markup { \baseline-align \large "a" }
  R1 |
  \tempo \markup { \baseline-align \large "p" }
  R1 |
  <>\startTempoSpan "a"
  R1
  <>\stopTempoSpan |
  R1 |
  <>\startTempoSpan "p"
  R1
  <>\stopTempoSpan |
  R1
  \tempo \markup { \large \combine \transparent "Tj" "a" }
  R1 |
  \tempo \markup { \large \combine \transparent "Tj" "p" }
  R1 |
}

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


Re: textSpanner at arbitrary positions independent of music

2018-10-14 Thread Ryan Michael
THank you Pierre,
exactly what i was looking for. However, how can i turn off the left
textSpan property if i want to span four bars which is broken over two
systems, and i don't wish to repeat the "molto rit" for the left attribute
of the span in the second system?

On Sun, Oct 14, 2018 at 1:34 AM Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com> wrote:

> Hi Ryan,
> Your example does not compile.
> How about putting the text into the sapnner ?
> Cf.
> http://lilypond.org/doc/v2.18/Documentation/notation/writing-text.html#text-spanners
> Cheers,
> Pierre
>
> Le dim. 14 oct. 2018 à 09:38, Ryan Michael  a
> écrit :
>
>> Hi all
>>
>> So i have a scenario where I want a textSpanner to follow a heading i
>> have
>> over the treble clef of a system where there is only action in the left
>> hand (Bass clef). e.g.
>>
>> %
>> \version "2.18.2"
>> up = \new Staff = "up" {
>> r1/^\markup{\huge "molto rit."}  r1\startTextSpanner r1 r1\stopTextSpanner
>> }
>>
>> down = \new Staff = "down" {
>> c,,4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4
>> }
>> {
>>   \new PianoStaff <<
>>  \up
>>\down
>>   >>
>> }
>> 
>>
>> my issues is that i want the spanner to really start immediately after
>> the markup. do i have to make some fake notes in the right hand to anchor
>> the spanner or can i just move it around by other means?
>>
>> best,
>> ryan.
>> --
>> ॐ नमः शिवाय
>> ___
>> 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


Re: textSpanner at arbitrary positions independent of music

2018-10-14 Thread Pierre Perol-Schneider
Hi Ryan,
Your example does not compile.
How about putting the text into the sapnner ?
Cf.
http://lilypond.org/doc/v2.18/Documentation/notation/writing-text.html#text-spanners
Cheers,
Pierre

Le dim. 14 oct. 2018 à 09:38, Ryan Michael  a
écrit :

> Hi all
>
> So i have a scenario where I want a textSpanner to follow a heading i have
> over the treble clef of a system where there is only action in the left
> hand (Bass clef). e.g.
>
> %
> \version "2.18.2"
> up = \new Staff = "up" {
> r1/^\markup{\huge "molto rit."}  r1\startTextSpanner r1 r1\stopTextSpanner
> }
>
> down = \new Staff = "down" {
> c,,4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4
> }
> {
>   \new PianoStaff <<
>  \up
>\down
>   >>
> }
> 
>
> my issues is that i want the spanner to really start immediately after the
> markup. do i have to make some fake notes in the right hand to anchor the
> spanner or can i just move it around by other means?
>
> best,
> ryan.
> --
> ॐ नमः शिवाय
> ___
> 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


textSpanner at arbitrary positions independent of music

2018-10-14 Thread Ryan Michael
Hi all

So i have a scenario where I want a textSpanner to follow a heading i have
over the treble clef of a system where there is only action in the left
hand (Bass clef). e.g.

%
\version "2.18.2"
up = \new Staff = "up" {
r1/^\markup{\huge "molto rit."}  r1\startTextSpanner r1 r1\stopTextSpanner
}

down = \new Staff = "down" {
c,,4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4
}
{
  \new PianoStaff <<
 \up
   \down
  >>
}


my issues is that i want the spanner to really start immediately after the
markup. do i have to make some fake notes in the right hand to anchor the
spanner or can i just move it around by other means?

best,
ryan.
-- 
ॐ नमः शिवाय
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Baseline align in TextSpanner

2018-10-05 Thread Kieren MacMillan
Hi Davide,

> I want to align TextSpanner texts to baseline.

This works for me:

{
 \override TextSpanner.bound-details.left.text = \markup { \combine 
\transparent "Tj" \test "a" }
 b2\startTextSpan b2\stopTextSpan
 \override TextSpanner.bound-details.left.text = \markup { \combine 
\transparent "Tj" \test "p" }
 b2\startTextSpan b2\stopTextSpan
}

Of course, I prefer to bury the \combine inside any custom markup functions, so 
that I don’t have to remember to add it every time.

Hope that helps!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Baseline align in TextSpanner

2018-10-05 Thread Davide Liessi
Hi everyone.
Maybe my previous message [1] went unnoticed.
I would really appreciate any hint.
Best wishes.
Davide

[1] http://lists.gnu.org/archive/html/lilypond-user/2018-09/msg00455.html

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


Baseline align in TextSpanner

2018-09-28 Thread Davide Liessi
Hi all.
I want to align TextSpanner texts to baseline.
I'm trying to use the code provided by Thomas Morley / Harm in
http://lists.gnu.org/archive/html/lilypond-user/2016-10/msg00365.html
which works very well e.g. with \tempo, but applying \test to
TextSpanner.bound-details.left.text has no effect.
I also tried replacing ly:line-spanner::print in TextSpanner.stencil
with a new function but I couldn't make it work.
An example follows, including Harm's code.
Is there a way to adapt it to my case?
Best wishes.
Davide

\version "2.19.82"

#(define (lists-map function ls)
   "Apply @var{function} to @var{ls} and all of it sublists.
First it recurses over the children, then the function is applied to
@var{ls}."
   (if (list? ls)
   (set! ls (map (lambda (y) (lists-map function y)) ls))
   ls)
   (function ls))

#(define test-proc
   (lambda (e)
 (if (and (list? e) (member 'glyph-string e))
 (begin
  (for-each
   (lambda (x)
 (begin
  (set-car! (cadr x) 0)
  x))
   (cadr (last e)))
  e)
 e)))

#(define-markup-command (test layout props glyph-name)
   (markup?)
   (let* ((stil (interpret-markup layout props glyph-name))
  (new-stile-expr
   (lists-map
test-proc
(ly:stencil-expr stil

 (ly:make-stencil
  new-stile-expr
  (ly:stencil-extent stil X)
  ;(cons 0 (cdr (ly:stencil-extent stil Y)))
  (ly:stencil-extent stil Y)
  )))

{
  \override TextSpanner.bound-details.left.text = \markup { \test "a" }
  b2\startTextSpan b2\stopTextSpan
  \override TextSpanner.bound-details.left.text = \markup { \test "p" }
  b2\startTextSpan b2\stopTextSpan
}

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


Re: Suppressing TextSpanner right boundary text at a system break

2018-09-21 Thread foxfanfare
Thomas Morley-2 wrote
> Isn't
> http://lilypond.org/doc/v2.19/Documentation/notation-big-page#using-the-line_002dspanner_002dinterface
> sufficient?
> 
> Cheers,
>   Harm

Yes you may be right. There is also this:
http://lilypond.org/doc/v2.19/Documentation/snippets-big-page.html#pitches-modifying-the-ottava-spanner-slope

Though I don't know why in the case of octava-bracket and not for the
TextSpanner, there is a need to override Staff.OttavaBracket.stencil =
#ly:line-spanner::print ?




--
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: Suppressing TextSpanner right boundary text at a system break

2018-09-20 Thread Thomas Morley
2018-09-20 10:37 GMT+02:00 foxfanfare :
> James Harkins-4 wrote
>> That's exactly it. Thanks!
>>
>> Would be useful as a snippet perhaps... this totally eluded me in the
>> manual. I tried to find info about bound-details but missed it somehow.
>>
>> hjh
>
> I agree, I learnt more about bound-details in this forum. The internal
> references page is maybe misleading because
> (http://lilypond.org/doc/v2.19/Documentation/internals-big-page#textspanner)
> will show all the bound-details that are currently used, not all which are
> available.
>
> Many properties can be changed, Y, padding, text, attach-dir,
> stencil-align-dir-Y, sencil-offset, etc... left, left-broken, right, etc.
> and I also don't know where all of those are listed in the documentation!


Isn't
http://lilypond.org/doc/v2.19/Documentation/notation-big-page#using-the-line_002dspanner_002dinterface
sufficient?

Cheers,
  Harm

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


Re: Suppressing TextSpanner right boundary text at a system break

2018-09-20 Thread foxfanfare
James Harkins-4 wrote
> That's exactly it. Thanks!
> 
> Would be useful as a snippet perhaps... this totally eluded me in the
> manual. I tried to find info about bound-details but missed it somehow.
> 
> hjh

I agree, I learnt more about bound-details in this forum. The internal
references page is maybe misleading because
(http://lilypond.org/doc/v2.19/Documentation/internals-big-page#textspanner)
will show all the bound-details that are currently used, not all which are
available. 

Many properties can be changed, Y, padding, text, attach-dir,
stencil-align-dir-Y, sencil-offset, etc... left, left-broken, right, etc.
and I also don't know where all of those are listed in the documentation!



--
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: Suppressing TextSpanner right boundary text at a system break

2018-09-19 Thread James Harkins
 On Thu, 20 Sep 2018 01:17:57 +0800  wrote 
 
> From: foxfanfare
>  
> James Harkins-4 wrote 
> > I have many text spanners with text for both the left and right bounds. 
> >  
> > If a spanner crosses a system break, I would like the right-hand text to 
> > be hidden at the end of the first system. 
>  
> I think you'll have to play with "right-broken" and "left-broken". 
>   \override TextSpanner.bound-details.right-broken.text = ##f 

That's exactly it. Thanks!

Would be useful as a snippet perhaps... this totally eluded me in the manual. I 
tried to find info about bound-details but missed it somehow.

hjh


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


Re: Suppressing TextSpanner right boundary text at a system break

2018-09-19 Thread foxfanfare
James Harkins-4 wrote
> Apologies if this is a basic question. I've searched but I didn't find the
> answer.
> 
> I have many text spanners with text for both the left and right bounds.
> 
> If a spanner crosses a system break, I would like the right-hand text to
> be hidden at the end of the first system.
> 
> The spanner represents an instruction for computer ensemble performance:
> at the left bound, begin transitioning to the next state; at the right
> bound, you should have arrived but not before.
> 
> Currently I'm getting "arrive" printed to the right of the last bar line
> of the system break. The performers should not arrive at this point! The
> score is misleading if it suggests that performers should have arrived at
> the end of the system.
> 
> I searched the manual and didn't find it. An LSR search for "spanner"
> finds a technique that is supposed to hide the spanner /line/ after a
> break (not what I want). I haven't found anything about controlling
> boundary text visibility.
> 
> Thanks,
> hjh
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi,

I think you'll have to play with "right-broken" and "left-broken".

Maybe this would help:

\version "2.19.81"

\new Staff \relative c'' {
  
  \override TextSpanner.bound-details.left.text = 
\markup { \small \bold Start }

  \override TextSpanner.bound-details.right.text = 
\markup { \small \bold STOP! }
  \override TextSpanner.bound-details.left-broken.text = ##f
  \override TextSpanner.bound-details.right-broken.text = ##f
  
  c\startTextSpan d e f 
  \break 
  g a b c 
  d1\stopTextSpan
  
}



--
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


  1   2   3   4   >