lilypond-user
[Top][All Lists]
Advanced

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

Re: change staff


From: Gianmaria Lari
Subject: Re: change staff
Date: Thu, 26 Jan 2017 10:51:12 +0100

... and this is one more way to do the change staff using a scheme function that toggle between the two staff. 

\version "2.19.54"

#(define staffToggle #f) 
cs= #(define-music-function (parser location) ;cs = Change Staff
           ()
           (begin
            (set! staffToggle (not staffToggle))
            (if staffToggle
                #{ \change Staff = "left" #}
                #{ \change Staff = "right" #})))


right = \fixed c' {
  \clef treble
  \time 2/4
  g8 \cs g \cs e \cs e \cs
}

left = \fixed c' {
  \clef treble
  s2
}

\score {
  \new PianoStaff
  <<
    \new Staff = "right" \right
    \new Staff = "left"  \left
  >>
  \layout { }
}

Not sure it can be more useful than the other ones. Also have no idea if this logic should be written differently. But it has been a nice scheme exercise :)

reply via email to

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