Jump to content

Using \autoChange with more than one voice: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
No edit summary
Line 39: Line 39:
[[Category:Staff notation]]
[[Category:Staff notation]]
[[Category:Keyboards]]
[[Category:Keyboards]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]][[Category:Snippet]]

Revision as of 23:02, 21 November 2025

Using autochange with more than one voice.

\version "2.24"

\score {
  \new PianoStaff
  <<
    \new Staff = "up" {
      <<
        \set Timing.beamExceptions = #'()
        \set Timing.beatStructure = #'(4)
        \new Voice {
          \voiceOne
          \autoChange
          \relative c' {
            g8 a b c d e f g
            g,8 a b c d e f g
          }
        }

        \new Voice {
          \voiceTwo
          \autoChange
          \relative c' {
            g8 a b c d e f g
            g,,8 a b c d e f g
          }
        }
      >>
    }

    \new Staff = "down" {
      \clef bass
    }
  >>
}