Re: self-alignment-X on DynamicTextSpanner?

2022-01-30 Thread Jean Abou Samra

Le 30/01/2022 à 22:20, Simon Albrecht a écrit :

Hi List,

is there an equivalent to self-alignment-X for the left bound text of 
a DynamicTextSpanner? See below.


Best, Simon

\version "2.23.5"

{
  1-\tweak self-alignment-X 1 \fff
  1
  % this causes alignment to just fail indiscriminately
  % (not a surprise, because I couldn’t find out how to use this 
property)

  %-\tweak left-bound-info.self-alignment-X 0
  % this is simply an offset against the default placement (default 
#'(-.75 . -.5))

  %-\tweak bound-details.left.stencil-offset #'(-3 . 0)
  % I’m not sure what this does at all
  %-\tweak bound-details.left.attach-dir -3
  \cresc
  1
  1
  1
  1\!
}



To explain the behavior with left-bound-info: this is an
internal property that gets populated with values from
bound-details and values computed automatically.  If you
override a subproperty, since callbacks aren't supported
for subproperties, you just override the calculation of
this property from bound-details and logic, and there
is nothing in it but the suboverride you have done.
Then it's not surprising that everything starts going
wrong.

To answer the question: attach-dir is the equivalent of
parent-alignment-X, controlling where on the note head
(left, center, right, intermediate values) the reference
point of the text goes.  There is no direct equivalent
for self-alignment-X, but you can do

\version "2.22.1"

{
  1-\tweak self-alignment-X 1 \fff
  1\tweak bound-details.left.text \markup \general-align #X #0 "cresc." 
\cresc

  1
  1
  1
  1\!
}


Best regards,
Jean




Re: trillSpan question:

2022-01-30 Thread Kenneth Wolcott
Hi Lukas;

  Thank you so much for the syntactic sugar!

  Very nice.

Ken

On Sun, Jan 30, 2022 at 3:08 AM Lukas-Fabian Moser  wrote:
>
> Hi Ken,
>
> >I implemented the trill span; it was not intuitive to me to end the
> > trill span on the following note, but it seems to work.
>
> It's possible to add a little bit of syntactic sugar for this construction:
>
> \version "2.22"
>
> trillSpan =
> #(define-music-function (mus) (ly:music?)
> #{
>   <>\startTrillSpan
>   #mus
>   <>\stopTrillSpan
> #})
>
> \relative {
>d''2
>\trillSpan e4. d16 e
>\trillSpan { fis4 g gis4. } a8
>a2
> }
>
> Lukas
>



self-alignment-X on DynamicTextSpanner?

2022-01-30 Thread Simon Albrecht

Hi List,

is there an equivalent to self-alignment-X for the left bound text of a 
DynamicTextSpanner? See below.


Best, Simon

\version "2.23.5"

{
  1-\tweak self-alignment-X 1 \fff
  1
  % this causes alignment to just fail indiscriminately
  % (not a surprise, because I couldn’t find out how to use this property)
  %-\tweak left-bound-info.self-alignment-X 0
  % this is simply an offset against the default placement (default 
#'(-.75 . -.5))

  %-\tweak bound-details.left.stencil-offset #'(-3 . 0)
  % I’m not sure what this does at all
  %-\tweak bound-details.left.attach-dir -3
  \cresc
  1
  1
  1
  1\!
}




Re: trillSpan question:

2022-01-30 Thread Lukas-Fabian Moser

Hi Ken,


   I implemented the trill span; it was not intuitive to me to end the
trill span on the following note, but it seems to work.


It's possible to add a little bit of syntactic sugar for this construction:

\version "2.22"

trillSpan =
#(define-music-function (mus) (ly:music?)
   #{
 <>\startTrillSpan
 #mus
 <>\stopTrillSpan
   #})

\relative {
  d''2
  \trillSpan e4. d16 e
  \trillSpan { fis4 g gis4. } a8
  a2
}

Lukas