]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/part-combiner.scm (make-part-combine-music): don't do
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 Mar 2004 10:44:46 +0000 (10:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 Mar 2004 10:44:46 +0000 (10:44 +0000)
relative inside partcombine arguments.

* scm/music-functions.scm (make-non-relative-music): new function.

* Documentation/user/notation.itely (Automatic part combining):
add note about \relative.

ChangeLog
Documentation/user/notation.itely
scm/music-functions.scm
scm/part-combiner.scm

index 2a0f5b52398feb939287351b466be91159a63368..e0a20fd85a2e82bcc997181b6fa50a86efef0270 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2004-03-31  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * scm/part-combiner.scm (make-part-combine-music): don't do
+       relative inside partcombine arguments.
+
+       * scm/music-functions.scm (make-non-relative-music): new function.
+
+       * Documentation/user/notation.itely (Automatic part combining):
+       add note about \relative.
+
        * lily/part-combine-iterator.cc (construct_children): add
        start_moment_ member.
 
index 6e463b197c6002ad41c0ae15e0a64c60590b2fb8..d9e3bc517ebae06e20fbe43a23d8f08356453540 100644 (file)
@@ -2995,12 +2995,28 @@ require arcane command incantations. See
 
 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
@@ -3035,6 +3051,14 @@ The staff switches often do not end up in optimal places. For high
 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
@@ -4235,8 +4259,8 @@ the name to avoid a collision.
 @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
@@ -4418,23 +4442,34 @@ places where the two parts differ, they are typeset as separate
 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
@@ -4451,8 +4486,8 @@ may set the property @code{soloADue} to false
 \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
 
@@ -4469,7 +4504,9 @@ In @code{soloADue} mode, when the two voices play the same notes on and
 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
index ccda33da184c25b50ea1e2994aacc8c8f9f396a8..85d95339ad87657584be6c01b6bcc2870eade940 100644 (file)
@@ -217,12 +217,17 @@ i.e.  this is not an override"
     cm))
 
 
-(define*-public (descend-to-context m context)
+(define-public (descend-to-context m context)
   "Like context-spec-music, but only descending. "
   (let ((cm (context-spec-music m context)))
     (ly:music-set-property! cm 'descend-only #t)
     cm))
 
+(define-public (make-non-relative-music mus)
+  (make-music 'UnrelativableMusic
+             'element mus
+  ))
+
 (define-public (make-apply-context func)
   (make-music 'ApplyContext
              'procedure func))
index 316878f0e5bf3af8112387873172f1bd6e60d2bf..99c28ea57746f567af54f0ff8e3d0a333f53b52f 100644 (file)
@@ -194,8 +194,8 @@ Voice-state objects
 
 (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)
@@ -463,7 +463,7 @@ the mark when there are no spanners active."
   
   (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