Re: Issue on vertical spacing of a TupletBracket

2021-12-10 Thread Paolo Prete
Thank you too for the tip,

Unfortunately, it seems to produce weird results in some cases, For
example: I can't set the 'padding' property in a consistent way. See the
snippet below (and please, give me a feedback, so the gitlab page can be
updated, if needed).
It appears to me that there is a conceptual contradiction in the
TupletBracket itself: it is defined as a non-outside-staff object as
default, but it requires the avoid-collision props of the outside-staff
objects as well. I can understand that there are scores in which brackets
are inside staves (I don't like this choice TBH, I think it visually messes
up the score), but in case the notation doesn't require this constraint,
like my case, putting the bracket outside the score, with a proper barrier
around it, seem to solve all the issues.
Note that a TupletBracket should have an unbalanced barrier (no space or
few space above it, some space below it), which is not possible with
outside-staff-padding but it is possible with the function that Aaron wrote
some time ago (just create a white box):

https://lists.gnu.org/archive/html/lilypond-user/2020-02/msg00202.html

Best,
P

%
(define (Tuplet_accidental_support_engraver context)
(let ((brackets (make-hash-table))
  (ending-brackets '())
  (accidentals '()))
  (make-engraver
(acknowledgers
  ((tuplet-bracket-interface engraver grob source-engraver)
 (hashq-set! brackets grob #t))
  ((accidental-interface engraver grob source-engraver)
 (set! accidentals (cons grob accidentals
(end-acknowledgers
  ((tuplet-bracket-interface engraver grob source-engraver)
 (set! ending-brackets (cons grob ending-brackets
((stop-translation-timestep engraver)
   (hash-for-each
 (lambda (bracket dummy)
   (for-each
 (lambda (accidental)
   (ly:pointer-group-interface::add-grob
 bracket
 'scripts
 accidental))
 accidentals))
 brackets)
   (for-each
 (lambda (bracket)
   (hashq-remove! brackets bracket))
 ending-brackets)
   (set! accidentals '())

\layout {
   \context {
 \Voice
 \consists #Tuplet_accidental_support_engraver
   }
}


%
{
\time 5/4
\override TupletBracket.direction = #UP
\override TupletBracket.padding = 0
\tuplet 3/2 { a'' a'' a''}
\revert TupletBracket.padding
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}

\override TupletBracket.padding = 0
\tuplet 3/2 { a'' a'' a''}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' a''}
}
%


On Fri, Dec 10, 2021 at 10:09 AM Jean Abou Samra  wrote:

> Le 10/12/2021 à 01:13, Paolo Prete a écrit :
> > Hello,
> >
> > please look at this snippet (tested with 2.22.0):
> >
> > %
> > {
> > \time 5/4
> > \override TupletBracket.direction = #UP
> > \tuplet 3/2 { a'' a'' ais''-.}
> > s
> > \tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
> > }
> > %
> >
> > As you can see, the vertical gap between the staccato dot and the
> > tuplet bracket is shorter than the gap between the same bracket and
> > the accidental; however, this is not taken into account and the result
> > is visually faulty.
> > Is there a way to fix this?
>
>
> Try the workaround given here:
>
> https://gitlab.com/lilypond/lilypond/-/issues/3766#note_623977182
>
>
> \version "2.22.1"
>
> #(define (Tuplet_accidental_support_engraver context)
> (let ((brackets (make-hash-table))
>   (ending-brackets '())
>   (accidentals '()))
>   (make-engraver
> (acknowledgers
>   ((tuplet-bracket-interface engraver grob source-engraver)
>  (hashq-set! brackets grob #t))
>   ((accidental-interface engraver grob source-engraver)
>  (set! accidentals (cons grob accidentals
> (end-acknowledgers
>   ((tuplet-bracket-interface engraver grob source-engraver)
>  (set! ending-brackets (cons grob ending-brackets
> ((stop-translation-timestep engraver)
>(hash-for-each
>  (lambda (bracket dummy)
>(for-each
>  (lambda (accidental)
>(ly:pointer-group-interface::add-grob
>  bracket
>  'scripts
>  accidental))
>  accidentals))
>  brackets)
>(for-each
>  (lambda (bracket)
>(hashq-remove! brackets bracket))
>  ending-brackets)
>(set! accidentals '())
>
> \layout {
>\context {
>  \Voice
>  \consists #Tuplet_accidental_support_engraver
>}
> }
>
>
> %
> {
> \time 5/4
> \override TupletBracket.direction = #UP
> \tuplet 3/2 { a'' a'' ais''-.}
> s
> \tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
> }
> %
>
>
> Best,
> Jean
>


Re: Issue on vertical spacing of a TupletBracket

2021-12-10 Thread Paolo Prete
On Fri, Dec 10, 2021 at 3:47 AM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> Maybe this gives you a starting point?
>
> %%%
> \version "2.23.4"
>
> ignoreH =
>\propertyTweak horizontal-skylines ##f
>\propertyTweak extra-spacing-width #empty-interval
>\etc
>
> ignoreV =
>\propertyTweak vertical-skylines ##f
>\propertyTweak extra-spacing-height #empty-interval
>\etc
>
> ignore = \ignoreH \ignoreV \etc
>
> {
> \time 6/4
> \override TupletBracket.direction = #UP
> \override TupletBracket.outside-staff-priority = #1000
> \tuplet 3/2 { a''-\ignore ( a'' ais''-.) }
> s
> \tuplet 3/2 { a'' a'' ais'' }
> s
> }
> %%%
>
> Hope that helps!
> Kieren.
>


That's GREAT! Thanks!
It not only solves the alignment issue; it also keeps the
outside-staff-priority for objects that must be put inside the slur.
At this point, I wonder why the method that forces outside-staff-priority
set to ##f is suggested in multiple pages of the documentation:

(Positioning text markups inside slurs)
https://lilypond.org/doc/v2.23Documentation/notation/expressive-marks-as-curves

(Creating a delayed turn)
https://lilypond.org/doc/v2.23/Documentation/snippets/editorial-annotations

(Outside-staff objects)
https://lilypond.org/doc/v2.23/Documentation/learning/outside_002dstaff-objects


The last pages even says that: "The avoid-slur property of the articulation
can be set to 'inside to bring the articulation inside the slur, but the
avoid-slur property is effective only if the outside-staff-priority is also
set to #f", but this is not true, as the snippet shows, if adapted to your
method:

%%%
ignoreH =
   \propertyTweak horizontal-skylines ##f
   \propertyTweak extra-spacing-width #empty-interval
   \etc

ignoreV =
   \propertyTweak vertical-skylines ##f
   \propertyTweak extra-spacing-height #empty-interval
   \etc

ignore = \ignoreH \ignoreV \etc

\relative c'' {
  c4( c^\markup { \tiny \sharp } d4.) c8 |
  c4-\ignore (
\once \override TextScript.avoid-slur = #'inside
%\once \override TextScript.outside-staff-priority = ##f
c4^\markup { \tiny \sharp } d4.) c8 |
\once \override Slur.outside-staff-priority = #500
c4( c^\markup { \tiny \sharp } d4.) c8 |
}
%%%

In addition: I don't understand too why it suggests:  "the
outside-staff-priority of the slur can be set to a numerical value to cause
it to be placed along with other outside-staff objects according to that
value". This doesn't seem a good idea to me, given that a Slur is not
supposed to be an outside-staff object...

Cheers,
P


Re: Issue on vertical spacing of a TupletBracket

2021-12-10 Thread Jean Abou Samra

Le 10/12/2021 à 01:13, Paolo Prete a écrit :

Hello,

please look at this snippet (tested with 2.22.0):

%
{
\time 5/4
\override TupletBracket.direction = #UP
\tuplet 3/2 { a'' a'' ais''-.}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
}
%

As you can see, the vertical gap between the staccato dot and the 
tuplet bracket is shorter than the gap between the same bracket and 
the accidental; however, this is not taken into account and the result 
is visually faulty.

Is there a way to fix this?



Try the workaround given here:

https://gitlab.com/lilypond/lilypond/-/issues/3766#note_623977182


\version "2.22.1"

#(define (Tuplet_accidental_support_engraver context)
   (let ((brackets (make-hash-table))
 (ending-brackets '())
 (accidentals '()))
 (make-engraver
   (acknowledgers
 ((tuplet-bracket-interface engraver grob source-engraver)
    (hashq-set! brackets grob #t))
 ((accidental-interface engraver grob source-engraver)
    (set! accidentals (cons grob accidentals
   (end-acknowledgers
 ((tuplet-bracket-interface engraver grob source-engraver)
    (set! ending-brackets (cons grob ending-brackets
   ((stop-translation-timestep engraver)
  (hash-for-each
    (lambda (bracket dummy)
  (for-each
    (lambda (accidental)
  (ly:pointer-group-interface::add-grob
    bracket
    'scripts
    accidental))
    accidentals))
    brackets)
  (for-each
    (lambda (bracket)
  (hashq-remove! brackets bracket))
    ending-brackets)
  (set! accidentals '())

\layout {
  \context {
    \Voice
    \consists #Tuplet_accidental_support_engraver
  }
}


%
{
\time 5/4
\override TupletBracket.direction = #UP
\tuplet 3/2 { a'' a'' ais''-.}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
}
%


Best,
Jean