I am getting the message, "warning: cannot have note heads and rests
together on a stem" in the code below.  I want the g-sharp, e chord to line
up with the bass b-flat and the inner voice's rest on the first beat to be
shifted a little to the right.  I have tried shifting the rest and the
chord, and using force-hshift, but LilyPond seems to always want to merge
the chord and the rest.  Suggestions?

%%% -- Begin
\version "2.18.2"
\language "english"

shiftRest = \once \override Rest.X-offset = #1

global = {
  \time 2/4
  \numericTimeSignature
  \key c \major
}

upperStaffTop = \relative c'' {
  <<
    {
      s4 <d d'>8 r |
      <d' d'>8 r r4 |
    }
    \\
    {
      \shiftRest r4 d,,8 r |
      d'8 r r4 |
    }
  >>
}

upperStaffBottom = \relative c'' {
  %% "warning: cannot have note heads and rests together on a stem"
  \shiftOn <e gs>2 \shiftOff |
  s2 |
}

lowerStaffTop = \relative c' {
}

lowerStaffBottom = \relative c, {
  bf2 ~ |
  bf2 |
}

upperStaff = {
  \clef treble
  \global
  << { \upperStaffTop } \\ { \upperStaffBottom } >>
}

lowerStaff = {
  \clef bass
  \global
  << { \lowerStaffTop } \\ { \lowerStaffBottom } >>
}

\score {
  \new PianoStaff <<
    \new Staff = "upper" \upperStaff
    \new Staff = "lower" \lowerStaff
  >>
  \layout {
  }
  \midi {
  }
}
%%% -- End

Knute Snortum
(via Gmail)
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to