]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #544.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 17 Aug 2010 15:12:31 +0000 (16:12 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Tue, 17 Aug 2010 15:12:31 +0000 (16:12 +0100)
* input/regression (partial-polymetric.ly):

  new regtest

* lily/parser.yy (command-element):

  simplify syntax construction for \partial: call single constructor,
  soft-coded in scheme

* scm/ly-syntax-constructor (partial):

  new syntax-constructor for \partial using descend-to-context to set
  measurePosition

input/regression/partial-polymetric.ly [new file with mode: 0644]
lily/parser.yy
scm/ly-syntax-constructors.scm

diff --git a/input/regression/partial-polymetric.ly b/input/regression/partial-polymetric.ly
new file mode 100644 (file)
index 0000000..e284103
--- /dev/null
@@ -0,0 +1,33 @@
+\version "2.13.31"
+
+\header {
+  texidoc = "@code{\partial} works with polymetric staves."
+}
+
+\score {
+  \relative c' <<
+    \new Staff {
+      \partial 4
+      c4 |
+      c4 c c c |
+    }
+    \new Staff {
+      \time 3/4
+      \partial 2
+      c4 c |
+      c4 c c |
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      \remove "Timing_translator"
+      \remove "Default_bar_line_engraver"
+    }
+    \context {
+      \Staff
+      \consists "Timing_translator"
+      \consists "Default_bar_line_engraver"
+    }
+  }
+}
index 7fff408f7d9d0aa59d25fa5ca9970da13a9e602e..fcde80ea58e6e9c1d08a280fd77d77a14adf0a37 100644 (file)
@@ -1631,9 +1631,7 @@ command_element:
 
        }
        | PARTIAL duration_length       {
-               Moment m = - unsmob_duration ($2)->get_length ();
-               $$ = MAKE_SYNTAX ("property-operation", @$, SCM_BOOL_F, ly_symbol2scm ("Timing"), ly_symbol2scm ("PropertySet"), ly_symbol2scm ("measurePosition"), m.smobbed_copy ());
-               $$ = MAKE_SYNTAX ("context-specification", @$, ly_symbol2scm ("Score"), SCM_BOOL_F, $$, SCM_EOL, SCM_BOOL_F);
+               $$ = MAKE_SYNTAX ("partial", @$, $2);
        }
 
        | TIME_T fraction  {
index 98365930fefa16e2a1e8c4751b8196774206b290..decc5153616f5d87c5b92df9584fc09abf161223 100644 (file)
@@ -247,3 +247,13 @@ into a @code{MultiMeasureTextEvent}."
        (begin
          (set! (ly:music-property ev 'label) label)
          ch))))
+
+(define-ly-syntax-simple (partial dur)
+  "Make a partial measure."
+  (let ((mom (ly:moment-sub ZERO-MOMENT (ly:duration-length dur))))
+
+    ;; We use `descend-to-context' here instead of `context-spec-music' to
+    ;; ensure \partial still works if the Timing_translator is moved
+    (descend-to-context
+     (context-spec-music (make-property-set 'measurePosition mom) 'Timing)
+     'Score)))