* input/test/ambitus-mixed.ly (texidoc): new file.
[lilypond.git] / input / test / ambitus-mixed.ly
blobe20da8689fb58b4f01fa2530b307a1c1d30bdf10
2 \header {
3 texidoc = "Ambituses can be switched off or translated by using
4 applyoutput.
6 If you want to mix per-voice and per-staff ambiti, then you have to
7 define you have to declare a new context type derived from the
8 @code{Voice} context or @code{Staff} context. The derived context
9 must consist of the @code{Ambitus_engraver} and it must be accepted by
10 a proper parent context, in the below example the @code{Staff} context
11 or @code{Score} context, respectively. The original context and the
12 derived context can then be used in parallel in the same score. (this is not demonstrated in this file).
16 \version "1.9.6"
18 #(define (kill-ambitus grob grob-context apply-context)
19 (if (memq 'ambitus-interface (ly:get-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:get-grob-property grob 'interfaces))
25 (ly:grob-translate-axis! grob x X)
30 voiceA = \notes \relative c'' {
31 c4 a d e f2
33 voiceB = \notes \relative c' {
34 es4 f g as b2
36 \score {
37 \context ChoirStaff <<
38 \new Staff <<
40 \applyoutput #(shift-ambitus 1.0)
41 \voiceA
42 } \\
44 \voiceB
47 \new Staff <<
48 { \applyoutput #kill-ambitus \voiceA } \\
49 { \applyoutput #kill-ambitus \voiceB }
52 \paper {
53 raggedright = ##t
55 \translator {
56 \VoiceContext
57 \consists Ambitus_engraver