[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Automatic staff changes, Next:, Up:Piano music



Automatic staff changes

Voices can switch automatically between the top and the bottom staff. The syntax for this is

        \autochange contexttype musicexp
This will switch the interpretation context of musicexp between a contexttype named up and down. Typically, you use Staff for contexttype. The autochanger switches on basis of pitch (central C is the turning point), and it looks ahead skipping over rests to switch rests in advance.
\score { \notes \context PianoStaff <
  \context Staff = "up" {
    \autochange Staff \context Voice = VA < \relative c' {
       g4 a  b c d r4 a g } > }
  \context Staff = "down" {
       \clef bass
       s1*2
} > }

[picture of music]

Note how spacer rests are used to prevent the bottom staff from terminating too soon.

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.