# Moving a Clef bellow notes in other Staff to save horizontal space?

5 messages
Open this post in threaded view
|

## Moving a Clef bellow notes in other Staff to save horizontal space?

 Hello everyone! I've been searching but have been unable to figure out a solution to this one.Given the attached image obtained by running the following snippet:\version "2.19.83"\language "english"toL = { \change Staff = "LH" }toR = { \change Staff = "RH" }\new PianoStaff <<  \new Staff = "RH" \relative {    \time 2/4    r4 \toL c'16 \toR e' d e |    R2  }  \new Staff = "LH" \relative {    r4 s |    \clef F 4 r  }>>\new PianoStaff <<  \new Staff = "RH" \relative {    \time 2/4    r4 \toL c'16 \toR e' d e |    R2  }  \new Staff = "LH" \relative {    r4 s |    4 r  }>>As you can see in the first example the clef is increasing the distance between the last note of the measure and the barline. How can one move the clef to the left, a little bellow the notes in the upper staff, so that the measure takes the same amount of horizontal space as the second example?Thank you in advance for you help,Stéfano _______________________________________________ lilypond-user mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/lilypond-user clef taking space.png (18K) Download Attachment
Open this post in threaded view
|

## Re: Moving a Clef bellow notes in other Staff to save horizontal space?

 Hi Stefano, > I've been searching but have been unable to figure out a solution to this one. How about something like:     \once \override Staff.Clef.X-extent = #empty-interval         \once \override Staff.Clef.X-offset = #-2.5         \clef F 4 r I tried \tweak versions, but couldn’t solve it that way, and couldn’t spend more time working on it. Hope this helps! Kieren. ________________________________ Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: [hidden email] _______________________________________________ lilypond-user mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/lilypond-user
Open this post in threaded view
|

## Re: Moving a Clef bellow notes in other Staff to save horizontal space?

 Hi Kieren, that's great! It works wonderfully. I experimented a bit with your idea, the same result can be achieved with just \once \override Staff.Clef.X-extent = #'(.7 . 2.2)It looks like by changing the first number of the pair one can be very precise about how much the Clef goes bellow the notes, while the other determines the distance between the Clef and the BarLine. Since X-extent is a pair it can't be offset, so I quickly made the following function to be able to offset it without having to give a number for the second value:\version "2.19.83"\language "english"toL = { \change Staff = "LH" }toR = { \change Staff = "RH" }blb-offsetClefXExtentCar =#(define-scheme-function (v) (number?)   (lambda (grob)     (let ((x-ext (ly:grob-property grob 'X-extent #f)))       (ly:grob-set-property! grob 'X-extent (cons                                              (+ (car x-ext) v)                                              (cdr x-ext))))))\new PianoStaff <<  \new Staff = "RH" \relative {    \time 2/4    r4 \toL c'16 \toR e' d e |    R2  }  \new Staff = "LH" \relative {    r4 s |    \once \override Staff.Clef.before-line-breaking = \blb-offsetClefXExtentCar 0.7    \clef F 4 r  }>>Thank you for your help!El mié., 8 may. 2019 a las 21:26, Kieren MacMillan (<[hidden email]>) escribió:Hi Stefano, > I've been searching but have been unable to figure out a solution to this one. How about something like:     \once \override Staff.Clef.X-extent = #empty-interval         \once \override Staff.Clef.X-offset = #-2.5         \clef F 4 r I tried \tweak versions, but couldn’t solve it that way, and couldn’t spend more time working on it. Hope this helps! Kieren. ________________________________ Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: [hidden email] _______________________________________________ lilypond-user mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/lilypond-user