bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: questions about NR 1.6


From: Mark Polesky
Subject: Re: questions about NR 1.6
Date: Sun, 15 Sep 2013 11:54:29 -0700 (PDT)

Federico Bruni wrote:
> Hi
>
> I'm translating NR 1.6 and I've found a sentence which is
> not straightforward:
> http://lilypond.org/doc/v2.17/Documentation/notation/modifying-single-staves
>
> """
> However, it is possible to set ledger line thickness
> independently of staff lines. The two values required
> multiply the staff line thickness with the staff line
> spacing and are then added together to give the ledger
> line thickness.
>
> \new Staff \with {
>   \override StaffSymbol.thickness = #2
>   \override StaffSymbol.ledger-line-thickness = #'(0.5 . 0.4)
> }
> { f'4 a, a,, f }
>
> """
>
> Can you tell me what the two values refer to and what's
> the final value of ledger-line-thickness?
>
> I'm writing to lilypond-bug in case you think it's worth
> changing the doc...
>
> Thanks
> Federico



The first number is multiplied by the line-thickness value,
which can be accessed via callback with:

  (ly:staff-symbol-line-thickness grob)

The second number is multiplied by the staff-space value,
which can be accessed via callback with:

  (ly:staff-symbol-staff-space grob)

If you like, the following ly file helps demonstrate how
this would be calculated (compile and read the console
output):

***********************************************************

\version "2.17.25"

#(define display-ledger-line-thickness
  (lambda (grob)
    (let*
      ((staff-symbol               (ly:grob-object grob 'staff-symbol))
       (ledger-line-thickness-pair (ly:grob-property staff-symbol
                                                     'ledger-line-thickness))
       (line-thickness             (ly:staff-symbol-line-thickness grob))
       (staff-space                (ly:staff-symbol-staff-space grob))
       (ledger-line-thickness-value
         (+ (* (car ledger-line-thickness-pair) line-thickness)
            (* (cdr ledger-line-thickness-pair) staff-space))))
      (display
        (format
          #f
          (string-append
            "\n"
            "\nledger-line-thickness = ~s"
            "\n       line-thickness = ~s"
            "\n          staff-space = ~s"
            "\n          calculation =   (~s x ~s)"
            "\n                        + (~s x ~s)"
            "\n                      = ~s")
          ledger-line-thickness-pair
          line-thickness
          staff-space
          (car ledger-line-thickness-pair)
          line-thickness
          (cdr ledger-line-thickness-pair)
          staff-space
          ledger-line-thickness-value)))))


{
  % current default is (1.0 . 0.1)
  \once \override Staff.StaffSymbol.ledger-line-thickness = #'(3 . 5)
  \once \override NoteHead.before-line-breaking = #display-ledger-line-thickness
  c'4
}

***********************************************************

- Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]