Voices can switch automatically between the top and the bottom
staff. The syntax for this is
+
+@quotation
@example
- \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
+\autochange \context Voice @{ @dots{}@var{music}@dots{} @}
@end example
+@end quotation
+
+@noindent
The two staves of the piano staff must be named @code{up} and
@code{down}.
+A @code{\relative} section that is outside of @code{\autochange} has
+no effect on the pitches of @var{music}, so, if necessary, put
+@code{\relative} inside @code{\autochange} like
+
+@quotation
+@example
+\autochange \relative @dots{} \new Voice @dots{}
+@end example
+@end quotation
+
+
The autochanger switches on basis of pitch (middle C is the turning
point), and it looks ahead skipping over rests to switch in
advance. Here is a practical example
quality output, staff switches should be specified manually.
+@code{\autochange} cannot be inside @code{\times}.
+
+Internally, the @code{\partcombine} interprets both arguments as
+@code{Voice}s named @code{one} and @code{two}, and then decides when
+the parts can be combined. Consequently, if the arguments switch to
+differently named @internalsref{Voice} contexts, the events in those
+will be ignored.
+
@node Manual staff switches
@subsection Manual staff switches
@cindex transposition of pitches
@cindex @code{\transpose}
-A music expression can be transposed with @code{\transpose}. The syntax
-is
+A music expression can be transposed with @code{\transpose}. The
+syntax is
@example
\transpose @var{from} @var{to} @var{musicexpr}
@end example
voices, and stem directions are set automatically. Also, solo and
@emph{a due} parts are identified and can be marked.
-
The syntax for part combining is
@example
\partcombine @var{musicexpr1} @var{musicexpr2}
@end example
-The music expressions will be interpreted as @internalsref{Voice} contexts.
+The music expressions will be interpreted as @internalsref{Voice}
+contexts. If using relative octaves, @code{\relative} should be
+specified for both music expressions, i.e.
+
+@example
+\partcombine \relative @dots{} @var{musicexpr1}
+ \relative @dots{} @var{musicexpr2}
+@end example
+
+@noindent
+A @code{\relative} section that is outside of @code{\partcombine} has
+no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
+
The following example demonstrates the basic functionality of the part
combiner: putting parts on one staff, and setting stem directions and
polyphony
-@lilypond[quote,verbatim,raggedright,fragment,relative=2]
+@lilypond[quote,verbatim,raggedright,fragment]
\new Staff \partcombine
- { g g a( b) c c r r }
- { g g r4 r e e g g }
+ \relative g' { g g a( b) c c r r }
+ \relative g' { g g r4 r e e g g }
@end lilypond
The first @code{g} appears only once, although it was
\new Staff <<
\set Staff.soloADue = ##f
\partcombine
- { g a( b) r }
- { g r4 r f }
+ \relative g' { g a( b) r }
+ \relative g' { g r4 r f }
>>
@end lilypond
off, the part combiner may typeset @code{a2} more than once in a
measure.
-@code{\partcombine} can not be inside @code{\times}.
+@code{\partcombine} cannot be inside @code{\times}.
+
+@code{\partcombine} cannot be inside @code{\relative}.
Internally, the @code{\partcombine} interprets both arguments as
@code{Voice}s named @code{one} and @code{two}, and then decides when
(define-public (make-part-combine-music music-list)
(let ((m (make-music 'PartCombineMusic))
- (m1 (context-spec-music (car music-list) 'Voice "one"))
- (m2 (context-spec-music (cadr music-list) 'Voice "two")))
+ (m1 (make-non-relative-music (context-spec-music (car music-list) 'Voice "one")))
+ (m2 (make-non-relative-music (context-spec-music (cadr music-list) 'Voice "two"))))
(set! (ly:music-property m 'elements) (list m1 m2))
(ly:run-translator m2 part-combine-listener)
(ly:run-translator m1 part-combine-listener)
(set! noticed '())
(let* ((m (make-music 'AutoChangeMusic))
- (context (ly:run-translator music part-combine-listener))
+ (context (ly:run-translator (make-non-relative-music music) part-combine-listener))
(evs (last-pair noticed))
(split (reverse! (generate-split-list
#f