questions about NR 1.6

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

questions about NR 1.6

Federico Bruni
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
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: questions about NR 1.6

janek.lilypond
2013/9/15 Federico Bruni <[hidden email]>:
> Can you tell me what the two values refer to and what's the final value of
> ledger-line-thickness?

\override StaffSymbol.ledger-line-thickness = #'(a . b)
means ledger-line-thickness = a*staffline thickness + b*staffspace
An example below.

\new Staff \with {
  \override StaffSymbol.thickness = #1
  \override StaffSymbol.ledger-line-thickness = #'(1 . 0)
}
{ f'4 a, a,, f }

\new Staff \with {
  \override StaffSymbol.thickness = #4
  \override StaffSymbol.ledger-line-thickness = #'(1 . 0)
}
{ f'4 a, a,, f }

\new Staff \with {
  \override StaffSymbol.thickness = #1
  \override StaffSymbol.ledger-line-thickness = #'(0 . 0.2)
}
{ f'4 a, a,, f }

\new Staff \with {
  \override StaffSymbol.thickness = #4
  \override StaffSymbol.ledger-line-thickness = #'(0 . 0.2)
}
{ f'4 a, a,, f }

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: questions about NR 1.6

Mark Polesky
In reply to this post by Federico Bruni
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

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: questions about NR 1.6

Federico Bruni
In reply to this post by janek.lilypond
2013/9/15 Janek Warchoł <[hidden email]>

> 2013/9/15 Federico Bruni <[hidden email]>:
> > Can you tell me what the two values refer to and what's the final value
> of
> > ledger-line-thickness?
>
> \override StaffSymbol.ledger-line-thickness = #'(a . b)
> means ledger-line-thickness = a*staffline thickness + b*staffspace
>

ok, now I understand
but the documentation's description doesn't sound good to me

thank you and Mark for the examples
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: questions about NR 1.6

David Kastrup
Federico Bruni <[hidden email]> writes:

> 2013/9/15 Janek Warchoł <[hidden email]>
>
>> 2013/9/15 Federico Bruni <[hidden email]>:
>> > Can you tell me what the two values refer to and what's the final value
>> of
>> > ledger-line-thickness?
>>
>> \override StaffSymbol.ledger-line-thickness = #'(a . b)
>> means ledger-line-thickness = a*staffline thickness + b*staffspace
>>
>
> ok, now I understand
> but the documentation's description doesn't sound good to me

    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.

"doesn't sound good" is the understatement of the year.  Yes, this
description is most definitely very, very wrong.

--
David Kastrup


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: questions about NR 1.6

Federico Bruni
2013/9/15 David Kastrup <[hidden email]>

> "doesn't sound good" is the understatement of the year.  Yes, this
> description is most definitely very, very wrong.
>

ok, just added an issue:
https://code.google.com/p/lilypond/issues/detail?id=3556
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond