lilypond-user
[Top][All Lists]
Advanced

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

Re: staff manipulation question


From: Alex Jones
Subject: Re: staff manipulation question
Date: Sat, 30 May 2015 16:15:53 -0400

Its very strange.  I determined it only is affected by the staff that ends.  For example using v. 2.18.2, this code:

\score {
\new StaffGroup \relative c' {
\new Staff
\key f \major
\clef alto
\time 6/8

<< {
R2.*3
c8 \f [r16 d c8] r4 r8
\break

<< {d2. (c8)} \\ {f,2.( \> e8) \!} >>
r r r4 r8
r r a16 \p (b c8) r c16 (d e8)
r r r4 r8
r r c16 (d e8) r d16 e
\break
}
\new Staff \relative c {
\once \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible
\set midiInstrument = #"viola"
\clef alto
\key d \minor

r8 r f16 (g a8) r g16 (a
bes8) r r d4. \p (
g,8) r r f'4. (
c8) \f [r16 d c8] r4 r8

<< {d2. (c8)} \\ {f,2.( \> e8) \!} >>
r r r4 r8
R2.*3

}
>>
\break
<e g>2.~ \pp
<e g>

}
}

produces the first output with the extra staff lingering:


However, if you change the bottom staff only as follows:

% remove this code
% << {d2. (c8)} \\ {f,2.( \> e8) \!} >>
% r r r4 r8
% add this code
<< {d2. (c8) c \rest c \rest c4 \rest c8 \rest } \\ {f,2.( \> e8) \! s s s4 s8} >>

The output works correctly:


Note: the top staff uses the original construction which crosses the bar line.

Whole code here:

\score {
\new StaffGroup \relative c' {
\new Staff
\key f \major
\clef alto
\time 6/8

<< {
R2.*3
c8 \f [r16 d c8] r4 r8
\break

<< {d2. (c8)} \\ {f,2.( \> e8) \!} >>
r r r4 r8
r r a16 \p (b c8) r c16 (d e8)
r r r4 r8
r r c16 (d e8) r d16 e
\break
}
\new Staff \relative c {
\once \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible
\set midiInstrument = #"viola"
\clef alto
\key d \minor

r8 r f16 (g a8) r g16 (a
bes8) r r d4. \p (
g,8) r r f'4. (
c8) \f [r16 d c8] r4 r8

% << {d2. (c8)} \\ {f,2.( \> e8) \!} >>
% r r r4 r8
<< {d2. (c8) c \rest c \rest c4 \rest c8 \rest } \\ {f,2.( \> e8) \! s s s4 s8} >>
R2.*3

}
>>
\break
<e g>2.~ \pp
<e g>


}
}


On May 26, 2015, at 7:15 AM, Thomas Morley <address@hidden> wrote:

2015-05-25 15:58 GMT+02:00 Alex Jones <address@hidden>:
I’m working with a score that has multiple staves that appear and disappear at various points.

I ran into a curious behavior:

I have two staves fro a while, the second has two notes that complete mid-measure so I encoded like this:

\score {
\new StaffGroup \relative c' {
\new Staff
\key f \major
\time 6/8
<<
{
R2.*2
e2.~ \pp
}
\new Staff \relative c'' {
\once \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible
\set midiInstrument = #"violin"
\once \omit Staff.TimeSignature
\key d \minor

<g bes,>2.
<< {g~ g8} \\ {f2. ( _\markup{\italic dim.} e8) \pp} >> r8 r r4 r8
}

\break

a8-. \p ^\markup{solo arco} [r16 g-. a8-.] c-. r r

}
}

However, when the second staff concluded, it didn’t disappear.  I worked out it was because the << >> region wasn’t aligned with a measure break.

So, I replaced with this:

<< {g~ g8 b\rest b\rest b4\rest b8\rest} \\ {f2. ( _\markup{\italic dim.} e8) \pp s s s4 s8} >>

however, this was quite clunky.  I had to create rest space in both note groups, and then I had to reposition the rests in the top note grouping to apply to both voices.  Aside from the staff not disappearing, the top solution works well.

Is there a more streamlined way to do this?

Using lilypond 2.18.2

-akj



Not sure what's causing this.
2.14.2 behaves as you would expect (after adjusting your code to that
ancient version)

Anyway, try to add:

\layout{
 \context {
   \Staff
   \RemoveEmptyStaves
   \override VerticalAxisGroup.remove-first = ##t
 }
}

Cheers,
 Harm


reply via email to

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