3 texidoc = "The showing of ambituses can be switched off or they can be
4 shifted horizontally by using @code{applyoutput}.
6 If you want to mix per-voice and per-staff ambituses, then you have to
7 define new context type derived from the @code{Voice} or @code{Staff}
8 context. The derived context must contain the @code{Ambitus_engraver}
9 and it must be accepted by a proper parent context, which are respectively
10 the @code{Staff} context or @code{Score} context in the example below.
11 The original context and the derived context can then be used in parallel
12 in the same score (not demonstrated in this file).
18 #(define (kill-ambitus grob grob-context apply-context)
19 (if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
20 (ly:grob-suicide grob)
23 #(define ((shift-ambitus x) grob grob-context apply-context)
24 (if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
25 (ly:grob-translate-axis! grob x X)
30 voiceA = \notes \relative c'' {
33 voiceB = \notes \relative c' {
37 \context ChoirStaff <<
40 \applyoutput #(shift-ambitus 1.0)
48 { \applyoutput #kill-ambitus \voiceA } \\
49 { \applyoutput #kill-ambitus \voiceB }
57 \consists Ambitus_engraver