]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/test/ambitus-mixed.ly
The grand \paper -> \layout, \bookpaper -> \paper renaming.
[lilypond.git] / input / test / ambitus-mixed.ly
index ec8f3b6f6d48530f6cb5b29e63b8c9c9b0ce3060..a50e447b95c397f466b70eb925bf0c1adce15c83 100644 (file)
@@ -1,60 +1,30 @@
 
 \header {
-texidoc = "The showing of ambituses can be switched off or they can be
-shifted horizontally by using @code{applyoutput}.
 
-If you want to mix per-voice and per-staff ambituses, then you have to
-define new context type derived from the @code{Voice} or @code{Staff} 
-context.  The derived context must contain the @code{Ambitus_engraver} 
-and it must be accepted by a proper parent context, which are respectively
-the @code{Staff} context or @code{Score} context in the example below. 
-The original context and the derived context can then be used in parallel 
-in the same score (not demonstrated in this file).
-"
-}
-
-\version "2.1.30"
-
-#(define (kill-ambitus grob grob-context apply-context)
-  (if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
-   (ly:grob-suicide grob)
-  ))
-
-#(define ((shift-ambitus x) grob grob-context apply-context)
-  (if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
-   (ly:grob-translate-axis! grob x X)
-  ))
+    texidoc = "Ambits can be added per voice. In that case, the
+ambitus must be moved manually to prevent collisions."
 
+}
 
+\version "2.3.22"
 
-voiceA = \notes \relative c'' {
-  c4 a d e f2
-}
-voiceB = \notes \relative c' {
-  es4 f g as b2 
-}
-\score {
-  \context ChoirStaff <<
-    \new Staff <<
-       {
-          \applyoutput  #(shift-ambitus 1.0)
-           \voiceA
-          } \\
-       {
-          \voiceB
-       }
-    >>
-    \new Staff <<
-       {  \applyoutput #kill-ambitus \voiceA } \\
-       {  \applyoutput #kill-ambitus \voiceB }
-    >>
-  >>
-  \paper {
+\layout {
     raggedright = ##t
+}
 
-    \context {
-       \VoiceContext
-      \consists Ambitus_engraver
+\new Staff <<
+    \new Voice \with {
+       \consists "Ambitus_engraver"
+    } \relative c'' {
+       \override Ambitus #'X-offset-callbacks
+       =  #(list (lambda (grob axis) -1.0))
+       \voiceOne
+       c4 a d e f2
     }
+    \new Voice \with {
+       \consists "Ambitus_engraver"
+    } \relative c' {
+       \voiceTwo
+       es4 f g as b2
     }
-}
+>>