Mark Polesky wrote:

> Is there a way to detect the current staff-size
> within a music-function? Is there a way to 
> detect the width of a note-head within a music-
> function?

I don't know about staff-size, but you can get
the width of a note-head with a callback 
proceduresimilar to the one described here:
  http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Difficult-tweaks

Note that the default notehead stencil is
ly:note-head::print
   http://lilypond.org/doc/v2.12/Documentation/user/lilypond-internals/NoteHead

Also see the ly:stencil-extent procedure:
   
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-internals/Scheme-functions#index-ly_003astencil_002dextent

Essentially, you want something like a 
ly:note-head::calc-width callback procedure.
With ly:stencil-extent and ly:note-head::print,
you can create your own...

_______________________________________________


\version "2.12.1"

#(define (ly:note-head::calc-width grob)
  (let* ((X-extent (ly:stencil-extent (ly:note-head::print grob) 0))
         (width (- (cdr X-extent) (car X-extent))))
    width))

oneWidthRight = \override NoteHead #'X-offset = #ly:note-head::calc-width
music = { d'4 g,8 a b c d4 g, g }
\relative { \time 3/4 \music }
\relative { \time 3/4 \oneWidthRight \music }

_______________________________________________


Hope this helps.
- Mark



      

<<attachment: calc-width.png>>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to