6

I want a single voice drifting across two staves, and I want LilyPond to automatically decide which staff to use.

(As can be seen here) For treble and bass clefs this is easily implemented with the \autochange command:

\version "2.18.2"
\new PianoStaff 
<<
    \new Staff = "up" {
        \clef "treble"
        \autochange {
            c,4 e, g, b, |
            d f a c' |
            e' g' b' d''|
        }
    }
    \new Staff = "down" {
        \clef "bass"
    }
>>

autochange


But (as I'm transcribing guitar), I want to use suboctave clefs (treble_8 and bass_8).

When I try this ... :

\version "2.18.2"
\new PianoStaff 
<<
    \new Staff = "up" {
        \clef "treble_8"
        \autochange {
            c,4 e, g, b, |
            d f a c' |
            e' g' b' d''|
        }
    }
    \new Staff = "down" {
        \clef "bass_8"
    }
>>

autochange - suboctave

... LilyPond is still assuming that the turning point is at middle c (c'), and not at the appropriate c below middle c (c):


I know I could just change staff manually. But
is there a way to get LilyPond to use the \autochange command correctly with the alternative staffs or with an alternative turning point?

1 Answer 1

7

Do you insist on using version 2.18? 2.19 can do it without trouble. You just have to stick the turning point just after the \autochange. So instead of \autochange { music }, you would use \autochange c { music }. This is what my Lilypond 2.19.62 does when I do that with your example (otherwise copied verbatim):

\version "2.19.62"
\language "german"

\new PianoStaff 
<<
    \new Staff = "up" {
        \clef "treble_8"
        \autochange c {
            c,4 e, g, b, |
            d f a c' |
            e' g' b' d''|
        }
    }
    \new Staff = "down" {
        \clef "bass_8"
    }
>>

enter image description here

(It looks a bit different because I use different fonts, and the B's come out as B flats because I use \language "german". But otherwise it's all good.)

(Also don't let yourself to be put off by the fact that 2.19's are the "development" version. They're in fact very stable. I use it a lot and during those couple of years, it has crashed on me only once.)

2
  • I found version 2.19.83, installed it and now it works ! Thank you Commented Sep 29, 2019 at 10:07
  • 1
    @ElementsinSpace Good! Glad that worked. Also there are more new things in 2.19 — one of my most favorite is probably copying the last note with different rhythm (c4 8 16 16~ 16 16 8 is the same as c4 c8 c16 c16~ c16 c16 c8). You could like to look here: lilypond.org/doc/v2.19/Documentation/changes/index.html .
    – Ramillies
    Commented Sep 29, 2019 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.