lilypond-user
[Top][All Lists]
Advanced

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

Re: Splitting Staff into two


From: Yoshiaki Onishi
Subject: Re: Splitting Staff into two
Date: Mon, 30 Dec 2024 10:06:22 -0500

Dear Lucas,

Glad I could help you! 

However, when I insert a bass clef on the lower bifurcated staff the notes are incorrectly assigned and the clef is off.

This happens because every time you set the clef in this circumstance, because the new positioning of the staff line has been defined by the following line:

 \override Staff.StaffSymbol.line-positions = #'(-9 -7 -5 -3 -1)

You have to configure the new placement of the clef as well as where the middle C is located accordingly. 

Taking hints from the section: Selected Snippets - Tweaking clef properties in the Documentation https://lilypond.org/doc/v2.25/Documentation/notation/clef, you can modify the code as follows (I am replying with the only the excerpt you sent, with my modification):

%%
 \set Staff.middleCPosition = -11
 \once \override Staff.Clef.stencil = ##f
 \startStaff
 <<
   {
     \clef bass % inserted bass clef for left hand/bass comping.
  \set Staff.clefPosition = -3
  \set Staff.middleCPosition = 1
  \set Staff.middleCClefPosition = 1
     {\repeat unfold 4 {c1 d e f}  }
   }
   \new Staff \with {
  %%

However, as you may well agree, if a clef changes in the middleway through a system, you would need to have the new clef shown. You can make the clef change appear by commenting or deleting the line:  \once \override Staff.Clef.stencil = ##f ...But merely doing so with this particular code will place the clef **behind** the barline, turning the music with some unsightly situation.  In order to fix that, i.e. have the clef appear **after** the barline, you need to override \override Score.BreakAlignment.break-align-orders. See below:

%%
\set Staff.middleCPosition = -11
 % \once \override Staff.Clef.stencil = ##f
 \startStaff
 <<
   \override Score.BreakAlignment.break-align-orders =
  #(make-vector 3 '(
                    staff-bar
                    clef
                   ))
   \clef bass
  \set Staff.clefPosition = -3
  \set Staff.middleCPosition = 1
  \set Staff.middleCClefPosition = 1
   { \repeat unfold 4 {c1 d e f}  }

   \new Staff \with {
%%

For more discussion on "clef after barline", see the following thread: https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00872.html

All the best,
Yoshi


On Mon, Dec 30, 2024 at 7:40 AM Lucas Cavalcanti <lucaspinke@gmail.com> wrote:
Thank you, Yoshi. I've managed to achieve what I sought (two staff bifurcated). However, when I insert a bass clef on the lower bifurcated staff the notes are incorrectly assigned and the clef is off. I've tried fixing this issue to the best of my ability (that is not much lmao) but to no avail. Do you know how to fix this?

%%
 \set Staff.middleCPosition = -11
 \once \override Staff.Clef.stencil = ##f
 \startStaff
 <<
   {
     \clef bass % inserted bass clef for left hand/bass comping.
     {\repeat unfold 4 {c1 d e f}  }
   }
   \new Staff \with {
   %%


Em seg., 30 de dez. de 2024 às 01:40, Yoshiaki Onishi <info@yoshionishi.com> escreveu:
P.S. After hitting “send,” it occurred to me that the code I sent would not account music after a new system starts. The clef would appear incorrectly placed. I amended the code as below, and in this version, I tweaked the Scheme code setting so that the two clefs would not collide in the new system. It makes the bifurcated staffs have more distance, which I am very sure you can tweak as you like - - - Yoshi

%%% CODE BEGINS %%%
\version "2.24.4"

\new Staff = "main" {
 c''1 d'' e'' f''

 \stopStaff
 \override Staff.StaffSymbol.line-positions = #'(-9 -7 -5 -3 -1)
 \set Staff.clefPosition = -7
 \set Staff.middleCPosition = -11
 \once \override Staff.Clef.stencil = ##f
 \startStaff
 <<
   { \repeat unfold 4 {c''1 d'' e'' f''}  }

   \new Staff \with {
     \remove Time_signature_engraver
     alignAboveContext = "main"
     \magnifyStaff #2/3
     \override VerticalAxisGroup.default-staff-staff-spacing =
     #'((basic-distance . 0)
        (minimum-distance . 0)
        (padding . 0)
        (stretchability . 10))
     firstClef = ##f
   }
   { \repeat unfold 4 {c''2 c''2 d'' d'' e'' e'' f'' f'' }}
>>
}
%%% END %%%

reply via email to

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