lilypond-user
[Top][All Lists]
Advanced

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

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


From: Stefano Troncaro
Subject: Re: Moving a Clef bellow notes in other Staff to save horizontal space?
Date: Thu, 9 May 2019 00:15:44 -0300

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 <g c,>4 r
  }
>>

Thank you for your help!


El mié., 8 may. 2019 a las 21:26, Kieren MacMillan (<address@hidden>) 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 <g c,>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: address@hidden


reply via email to

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