]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Issue 4465: Auto_change_iterator: move staff creation to Scheme
[lilypond.git] / ly / music-functions-init.ly
index 475c2cec906692fd7f6f3d0c13118372400c598a..27070d3501a9e2355f309a709cfb28e206908b33 100644 (file)
@@ -177,9 +177,25 @@ assertBeamSlope =
 autochange =
 #(define-music-function (music) (ly:music?)
    (_i "Make voices that switch between staves automatically")
-   (make-autochange-music music))
-
-
+   (let ;; keep the contexts alive for the full duration
+       ((skip (make-skip-music (make-duration-of-length 
+                                (ly:music-length music)))))
+     #{
+       <<
+         \context Staff = "up" <<
+           #(make-autochange-music music)
+           \new Voice { #skip }
+         >>
+         \context Staff = "down" \with {
+           clefGlyph = "clefs.F"
+           clefPosition = 2
+           middleCPosition = 6
+           middleCClefPosition = 6
+         } {
+           \new Voice { #skip }
+         }
+       >>
+     #} ))
 
 balloonGrobText =
 #(define-music-function (grob-name offset text)