[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anybody has a good explanation for _this_ use of grob-transformer?
From: |
Thomas Morley |
Subject: |
Re: Anybody has a good explanation for _this_ use of grob-transformer? |
Date: |
Mon, 29 Jan 2018 23:52:12 +0100 |
2018-01-28 18:07 GMT+01:00 David Kastrup <address@hidden>:
>
> The result is that all the beams are smashed up in the left border and
> the tuplet numbers appear over the respective first notes. All of which
> seems like a seriously messed up X offset rather than the Y offset that
> should not even have been changed.
Hi David,
I never got to grips with that unpure-pure stuff.
>From IR:
Function: ly:make-unpure-pure-container unpure pure
Make an unpure-pure container. unpure should be an unpure expression,
and pure should be a pure expression. If pure is omitted, the value of
unpure will be used twice, except that a callback is given two extra
arguments that are ignored for the sake of pure calculations.
I mean, really?
In german I'd say: Verarschen kann ich mich alleine...
Granted, we have more verbose explanations in the docs (NR and CG),
though I never really figured what's it all about ...
That said, I played around a little.
No clue if it helps you in any way but eliminated grob-tranformer and
tried three different codings.
The last succeeds, though I've no clue why and no clue why the others fail.
I also made the TupletBracket always visible, messed up as well for
the failing codings.
\version "2.21.0"
\relative c' {
\voiceOne
\override TupletBracket.bracket-visibility = ##t
%% fail
\override TupletNumber.Y-offset =
#(ly:make-unpure-pure-container
(lambda (grob) (+ (ly:tuplet-number::calc-y-offset grob) 1))
(lambda (grob start end) (ly:tuplet-number::calc-y-offset grob)))
\tuplet 3/2 4 {
c8 d e f g a b c d e f g
c,,8^> d e f^> g a b^> c d e^> f g }
\break
%% fail
\override TupletNumber.Y-offset =
#(ly:make-unpure-pure-container
(lambda (grob) (+ (ly:tuplet-number::calc-y-offset grob) 1)))
\tuplet 3/2 4 {
c,,8 d e f g a b c d e f g
c,,8^> d e f^> g a b^> c d e^> f g }
\break
%% no fail
\override TupletNumber.Y-offset =
#(ly:make-unpure-pure-container
(lambda (grob) (+ (ly:tuplet-number::calc-y-offset grob) 1))
(lambda (grob start end) 1))
\tuplet 3/2 4 {
c,,8 d e f g a b c d e f g
c,,8^> d e f^> g a b^> c d e^> f g }
}
Cheers,
Harm