Re: Moving tuplet brackets

2021-10-01 Thread Paul Hodges
This was so simple, and just works as required, except for one thing.
Using priority 2000 puts the brackets above tempo indications and other
markup; I used Leo's value of 750 which did it exactly right.  Leo's
additional "avoid-scripts" and "avoid-slur" overrides were not needed,
in my case at least.

Thanks to you both,
Paul

On 28/09/2021 10:45:39, "Lukas-Fabian Moser"  wrote:

>
>>
>>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:
>
>Oh, I'm sorry, I didn't realise that the outside-staff-priority overrides the 
>manual setting of positions. Then of course it's much easier:
>
>\version "2.22"
>
>\relative {
>\tupletUp
>\override TupletBracket.bracket-visibility = ##t
>\override TupletBracket.outside-staff-priority = 2000
>\override TupletBracket.positions = #'(0 . 0)
>
>\tuplet 3/2 4 { b''8[(-> c) r] g[(-> fis) r] }
>}
>
>Lukas
>



Re: Moving tuplet brackets

2021-09-28 Thread Paul Hodges
On 28/09/2021 10:18:30, "Lukas-Fabian Moser"  wrote:

>Please try and give an example of your LilyPond code, if possible. This 
>enables people to help with your concrete situation.
I understand that; but I wanted to see clean-page suggestions, as I felt 
the code I already had was way over the top - which your response and 
Leo's have confirmed.

For your interest, this is where I found the (way too complex for my 
case!) code I was using for horizontal tuplet brackets:
https://lilypond-user.gnu.narkive.com/pekwMXTV/angle-of-a-tuplet-bracket
The complexity was because it's the answer to a different problem 
(setting an angle for the bracket) adapted to set an angle of zero.

Thanks,
Paul



Re: Moving tuplet brackets

2021-09-28 Thread Lukas-Fabian Moser





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:


Oh, I'm sorry, I didn't realise that the outside-staff-priority 
overrides the manual setting of positions. Then of course it's much easier:


\version "2.22"

\relative {
  \tupletUp
  \override TupletBracket.bracket-visibility = ##t
  \override TupletBracket.outside-staff-priority = 2000
  \override TupletBracket.positions = #'(0 . 0)

  \tuplet 3/2 4 { b''8[(-> c) r] g[(-> fis) r] }
}

Lukas




Re: Moving tuplet brackets

2021-09-28 Thread Leo Correia de Verdier
I can’t tell for sure without seeing the code, but I think you may not need 
very advanced code to force the brackets horizontal in your case, and that 
something like this is what you’re after:


\version "2.22.1"
\fixed c'' {
  \override TupletBracket.direction = #UP
  \override TupletBracket.bracket-visibility = ##t
  \override TupletBracket.avoid-scripts = ##t
  \override TupletBracket.positions = #'( 0 . 0 )
  \override TupletBracket.outside-staff-priority = #750
  \override TupletBracket.avoid-slur = #'outside
  
  \tuplet 3/2 { c'8( r c, } 
  \tuplet 3/2 {\stemUp g a b^>)}
  \tuplet 3/2 { \stemDown \slurUp d,( c^_ e } 
  \tuplet 3/2 {\stemNeutral f--\upbow g--\downbow a-_)}
}



Some of the values might need to be adjusted to suit your needs.

HTH
/Leo


> 28 sep. 2021 kl. 10:46 skrev 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:
> 
> Thanks,
> Paul



Re: Moving tuplet brackets

2021-09-28 Thread Lukas-Fabian Moser

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




Moving tuplet brackets

2021-09-28 Thread 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:

Thanks,
Paul