bug-lilypond
[Top][All Lists]
Advanced

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

A bug with showStaffSwitch


From: Dr A V Le Blanc
Subject: A bug with showStaffSwitch
Date: Thu, 13 Jul 2006 09:13:26 +0100
User-agent: Mutt/1.5.4i

There appears to be a bug with \showStaffSwitch or with
'\set followVoice ##t/##f' that is rather irritating.  I have here
a short file that demonstrates the problem.  The original form of
the melody from this fragment is

     \new Voice \relative c' {
        \showStaffSwitch
        \stemDown c4 \octave c'
        \change Staff = "lower" \stemUp b8
        \change Staff = "upper" \stemDown c | c4
        \change Staff = "lower" \stemUp b8
        \change Staff = "upper" \stemDown c | f4
        \change Staff = "lower" \stemUp e8
        \change Staff = "upper" \stemDown f | c'4 e,\rest |
     }

Here the lines marking staff switches appear whenever there is a
staff change, and only whenever there is a staff change.  Unfortunately
this includes lines which coincide with the eighth notes which are
joined across the staffs by beams, which I find irritating.  So I tried
to improve the output by hiding the staff switching as follows:

     \new Voice \relative c' {
        \showStaffSwitch
        \stemDown c4 \octave c'
        \change Staff = "lower" \stemUp b8 \hideStaffSwitch
        \change Staff = "upper" \stemDown c | c4 \showStaffSwitch
        \change Staff = "lower" \stemUp b8 \hideStaffSwitch
        \change Staff = "upper" \stemDown c | f4 \showStaffSwitch
        \change Staff = "lower" \stemUp e8 \hideStaffSwitch
        \change Staff = "upper" \stemDown f | c'4 e,\rest |
     }

Unfortunately here only the first switch line is printed, and
the rest are not.  I tried to fix it by moving the c4 and f4
after the \showStaffSwitch as in the full example, but then I
get not only the staff switch lines I want, but also some
silly lines that connect notes on the same (upper) staff.  Is
there any way to have staff switch lines only when switching
staffs, and without marking the superfluous switches where a
beam already shows that the voice has moved?  Note that I am
using version 2.9.10 in this example.

     -- Owen

\version "2.9.10"

global = {
        #(set-accidental-style 'piano-cautionary)
        \key f \major
        \time 2/4
}

upper = \relative c' {
        \global \clef treble
  << \new Voice {
        \stemUp c8 \octave c'
        < f a c > r < f a c > | c < e bes' c > r < e bes' c > |
        f < a c f > r < a c f > | c < es a c > a\rest < es a c > |
     }
     \new Voice \relative c' {
        \showStaffSwitch
        \stemDown c4 \octave c'
        \change Staff = "lower" \stemUp b8 \hideStaffSwitch
        \change Staff = "upper" \stemDown c |
        \showStaffSwitch c4
        \change Staff = "lower" \stemUp b8 \hideStaffSwitch
        \change Staff = "upper" \stemDown c |
        \showStaffSwitch f4
        \change Staff = "lower" \stemUp e8 \hideStaffSwitch
        \change Staff = "upper" \stemDown f | c'4 e,\rest |
     }
  >>
}

lower = \relative c, {
        \global \clef bass
        \stemDown
        < f c' a' >4 < c' f > | < g e' bes' > < c g' > |
        < a f' c' > < a' c > | < fis, es' a > < c'' es a >8 r |
}

\score {
  \new PianoStaff <<
        #(set-accidental-style 'piano-cautionary)
        \new Staff = "upper" \upper
        \new Staff = "lower" \lower
  >>
  \layout { }
  \midi { \tempo 4=60 }
}




reply via email to

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