lilypond-user
[Top][All Lists]
Advanced

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

Re: How to catch the current height of a StaffGroup?


From: Urs Liska
Subject: Re: How to catch the current height of a StaffGroup?
Date: Wed, 23 May 2012 19:00:21 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

No idea about Scheme,

but shouldn't a standard barline have the desired length by default?

Best
Urs

Am 23.05.2012 18:57, schrieb Thomas Morley:
Hi,

I'm trying to read out the current height of a StaffGroup, i.e. from
the bottom-line of the bottom-staff up to the top-line of the
top-staff.

As a test I created a new BreathingSign-stencil drawing a line from
top-line to bottom-line. The value for draw-line is figured out
manually for now. Of course I want to automate this.

\version "2.15.38"

#(define ((staff-group-height number) grob)
      (let* ((stil (ly:text-interface::print grob))
             (par1 (ly:grob-parent grob Y))     ;; #<Grob VerticalAxisGroup>
             (par2 (ly:grob-parent par1 Y))     ;; #<Grob VerticalAlignment>
             (par3 (ly:grob-parent par2 Y))     ;; #<Grob System>
             )

      ;(newline)(display "par1 ")(display par1)

      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
            (make-line-markup
              (list
                  (make-with-dimensions-markup '(0 . 0) '(0 . 0)
                    (make-with-color-markup blue
                      (make-draw-line-markup (cons 0 number))))))))))

%--------- Test

one = {
         \relative c' {
                a2 b
                \override Score.BreathingSign #'after-line-breaking =
                        #(staff-group-height -13)
                c\breathe d \break
                a,, b''
                \override Score.BreathingSign #'after-line-breaking =
                        #(staff-group-height -22.5)
                c\breathe d
         }
}

two = {
         \relative c {
                \clef bass
                a2 b c d a'' b,, c d
         }
}

\score {
         \new StaffGroup<<
            \new Staff \one
            \new Staff \two
            >>
}

I don't know which grob/item/stencil I should adress to catch the
needed value and how.

Any hint would be appreciated.

Thanks,
   Harm

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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