Re: displaying `script-priority`

2023-12-15 Thread Werner LEMBERG


>> > How can I make LilyPond display the actual values of
>> > `script-priority` for a stack of grobs?  [...]
>>
>> Any suggestions how to do that?  Otherwise I'll file an issue.
> 
> A few days ago I was looking for something, and stumbled across
> https://lsr.di.unimi.it/LSR/Item?id=1017 And I thought that it might
> help here.  [...]

Veery nice, thanks a lot!  It was quite helpful, and it eventually
lead to

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2203


Werner



Re: displaying `script-priority`

2023-12-13 Thread Michael Werner
Hi Werner,

On Thu, Dec 14, 2023 at 12:03 AM Werner LEMBERG  wrote:

>
> Walking through some unanswered e-mails of mine I stumbled across this
> one, asked in October.
>
>   https://lists.gnu.org/archive/html/lilypond-user/2023-10/msg00222.html
>
> > How can I make LilyPond display the actual values of
> > `script-priority` for a stack of grobs?  [...]
>
> Any suggestions how to do that?  Otherwise I'll file an issue.
>

A few days ago I was looking for something, and stumbled across
https://lsr.di.unimi.it/LSR/Item?id=1017
And I thought that it might help here. I was able to modify it a bit to
pare down the info it returns, as it returns *everything* about each
occurence of the grob in question. The result:

\version "2.25.10"

#(define print-all-script-priority
   (grob-transformer 'after-line-breaking
 (lambda (grob orig)
   (format #t "\n~a:" grob)
   (format #t "\n~a:" "Text-Interface")
   (format #t "\n\t~a:  ~a" "text"
   (ly:grob-property grob 'text))
   (format #t "\n~a:" "Text-Script-Interface")
   (format #t "\n\t~a:  ~a\n" "script-priority"
   (ly:grob-property grob 'script-priority))
   )))

grobPropertiesInfo =
#(define-music-function (grob-name)(symbol?)
   #{
 \override $grob-name . after-line-breaking =
 #print-all-script-priority
   #})

\relative c {
  \set strokeFingerOrientations = #'(up)
  \set fingeringOrientations = #'(up)

  \grobPropertiesInfo #'StrokeFinger
  \grobPropertiesInfo #'Fingering
  

  \override Fingering.script-priority = #118
  
}

This produces the output:

Starting lilypond 2.25.10 [Untitled]...

Processing `/tmp/frescobaldi-01dbi2f4/tmpg0hzpy81/document.ly'

Parsing...

Interpreting music...

Preprocessing graphical objects...

Finding the ideal number of pages...

Fitting music on 1 page...

Drawing systems...

Converting to `document.pdf'...


#:

Text-Interface:

text: 1

Text-Script-Interface:

script-priority: 96


#:

Text-Interface:

text: p

Text-Script-Interface:

script-priority: 121


#:

Text-Interface:

text: 4

Text-Script-Interface:

script-priority: 103


#:

Text-Interface:

text: a

Text-Script-Interface:

script-priority: 128


#:

Text-Interface:

text: 1

Text-Script-Interface:

script-priority: 114


#:

Text-Interface:

text: p

Text-Script-Interface:

script-priority: 121


#:

Text-Interface:

text: 4

Text-Script-Interface:

script-priority: 121


#:

Text-Interface:

text: a

Text-Script-Interface:

script-priority: 128

Success: compilation successfully completed

Completed successfully in 0.6".

Probably better ways to go about this, but it seems to work.
-- 
Michael


Re: displaying `script-priority`

2023-12-13 Thread Werner LEMBERG


Walking through some unanswered e-mails of mine I stumbled across this
one, asked in October.

  https://lists.gnu.org/archive/html/lilypond-user/2023-10/msg00222.html

> How can I make LilyPond display the actual values of
> `script-priority` for a stack of grobs?  [...]

Any suggestions how to do that?  Otherwise I'll file an issue.


Werner



displaying `script-priority`

2023-10-22 Thread Werner LEMBERG

How can I make LilyPond display the actual values of `script-priority`
for a stack of grobs?  Let's assume I have

```
{
  \set strokeFingerOrientations = #'(up)
  \set fingeringOrientations = #'(up)

  
}
```

and I want to position the fingerings for the upper note above the
fingerings of the lower note.  Since the actual `script-priority`
value of a grob depends on both the vertical position of the grob and
its pre-defined `script-priority` value (in `define-grobs.scm` and
`script.scm`), it's not fun to manually test possible values for each
and every chord...

To continue the above example, the default `script-priority` values
for `Fingering` grobs (i.e., left-hand fingering) is 100, and for
`StrokeFinger` grobs (i.e., right-hand fingering) it is 125, and to
get the desired effect I have to say

```
{
  \override Fingering.script-priority = #118
  
}
```

Any value between 118 and 125 (inclusive) will do.

Or maybe there is a more efficient, less error-prone method to handle
such situations?


Werner