[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving objects using "wrong" extent --- a question, valid solution n

From: Dmytro O. Redchuk
Subject: Re: Moving objects using "wrong" extent --- a question, valid solution needed!
Date: Tue, 18 May 2010 08:23:28 +0300
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon 17 May 2010, 21:43 Mark Polesky wrote:
> Dmytro O. Redchuk wrote:


Thank You very much for your time and explanation!

Everything is clear, beautiful and "funny" :-)

> Anyway, once you've overridden the DynamicLineSpanner, then you
> can adjust the #'Y-offset, though I'd suggest overriding the
> #'Y-offset for the Hairpin grob instead of the DynamicLineSpanner:
>   \override DynamicLineSpanner #'Y-extent = #'(0 . 0)
>   \override Hairpin #'Y-offset = #0.6666
> So setting the Hairpin grob's #'Y-offset to its height value
> (0.6666) centers the tip on the bottom staff-line.
_In this case_

Having used "ugly" extents i could count offset from the middle line. Anyway,
i agree that those offsets are rather ugly and i agree that in every case i
can put proper value for offset.

> If you want to be really fancy, you could write a music function
> to do all the work for you:
Great! Thank You for this job.

> setHairpinPosition =
> #(define-music-function
>      (parser location staff-position)
>      (number?)
>    #{
>       \once \override DynamicLineSpanner #'Y-extent = #'(0 . 0)
>       \once \override Hairpin #'Y-offset =
>         #(lambda (hairpin-grob)
>            (let ((hairpin-height
>                   (ly:grob-property hairpin-grob 'height)))
>              (+ 2 hairpin-height (/ $staff-position 2))))
>    #})

> I also recommend using \once (as I've done in the above music
> function).  Things get really confusing when an override is still
> in effect from 4 pages ago.
Yes, thanks, i understand, i've just "omitted" it in that "example".

> grobs, but unfortunately also the DynamicText grobs, and off the
> top of my head, I don't see a trivial way around this.  This means
> that if you do:
>   \setHairpinPosition #0 c4\f\> c c c\!
Yes, i see, DynamicText's offset should be adjusted for every one of \f, \p,
\mf to align with hairpin properly...

(Btw, those ugly offsets do handle this situation... But, really, i wish i
could... and i hope i would, in other words,-)

Well, why not --- now i "guessed" that DynamicText is height-centered with
Hairpin's center line --- is that true?

If so, i guess i can modify your function ...

> Well, hopefully this points you in a better direction at least.
> It's a bad idea to get in the habit of abusing syntax.
Thank You A LOT.

> Hope this helps.
> - Mark

  Dmytro O. Redchuk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]