Gianmaria Lari wrote:

This thing always seemed so inconvenient to me that I thought it was
practically unusable. Or that there was some trick to maybe have
Frescobaldi tell me the "position" of the note (meant as numbers of quarter
or eight notes from the beginning).

Here is a primitive include file for you to play around with.

When hovering with the mouse
 - over a notehead
 - over a barline (inside a staff)
it shows such a position as (an inconvenient) fraction.


Cheers,
Robin
% 2020-11-11 mouseover shows moments of noteheads/barlines (not span; not startbar) 
% updated to \version "2.24.0"

%schemeIndentOn

#(define (url-when fmt) ; cf LSR865
  (lambda (grob)
    (let* (
      (url-strg (format #f fmt (grob::when grob) (grob::rhythmic-location grob)))
      (stil (ly:grob-property grob 'stencil)))
      (if (ly:stencil? stil)
        (let* ((x-ext (ly:stencil-extent stil X))
          (y-ext (ly:stencil-extent stil Y))
          ;; For < 2.22.0 use:
          ;; (url-expr `(url-link ,url-strg ',x-ext ',y-ext))
          (url-expr `(url-link ,url-strg ,x-ext ,y-ext))
          (new-stil 
            (ly:stencil-add
              (ly:make-stencil url-expr x-ext y-ext) 
              stil)))
          (ly:grob-set-property! grob 'stencil new-stil))))))
%                                                                   
%schemeIndentOff

\pointAndClickOff

\layout {
  \override Staff.BarLine.before-line-breaking = #(url-when "BL: ~a ~a") 
  \override  NoteHead.before-line-breaking = #(url-when "NH: ~a") 
}

Reply via email to