* 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
--- /dev/null
+\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"
+ }
+ }
+}
}
| PARTIAL duration_length {
}
| 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);
(begin
(set! (ly:music-property ev 'label) label)
ch))))
(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)))