|
From: | Lukas-Fabian Moser |
Subject: | Re: Moving tuplet brackets |
Date: | Tue, 28 Sep 2021 11:18:30 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
Hi Paul, Am 28.09.21 um 10:46 schrieb Paul Hodges:
I am at present being asked to put a lot of tuplet brackets on the same side of the staff (above) as slurs, and this is leading to a lot of collisions. I could deal with them individually (a lot of work), but is there something I can do to to force tuplet brackets away from slurs (outside them) globally? I've not been able to find anything that suits yet. This is probably complicated by the fact that I am already using code to force the brackets horizontal (code by Harm I think, from a mail about ten years ago). Here is a sample of what I currently have: and here is a sample of another piece as the publisher wants it:
Please try and give an example of your LilyPond code, if possible. This enables people to help with your concrete situation.
In this case, I'm not sure what Harm did to ensure horizontal position of tuplet brackets. In the following solution, I'm doing a bit of a hack: I ask LilyPond to place the tuplet bracket outside everything else (that's the value of outside-staff-priority), and then I force them to be horizontal by letting LilyPond calculate the "usual" slope and afterwards forcing left and right y-position to the average value:
\version "2.22" \relative { \tupletUp \override TupletBracket.bracket-visibility = ##t \override TupletBracket.outside-staff-priority = 2000 \override TupletBracket.positions = #(grob-transformer 'positions (lambda (grob default) (let ((middle-y (average (car default) (cdr default)))) (cons middle-y middle-y)))) \tuplet 3/2 4 { b''8[(-> c) r] g[(-> fis) r] } }I expect this will often look good and fail horribly in some special situations where LilyPond normally would create a tuplet bracket with a large slope.
Lukas
[Prev in Thread] | Current Thread | [Next in Thread] |