@end ignore
+@item
+It is now possible to use @code{\time} and @code{\partial}
+together to change the time signature in mid measure.
+
+@lilypond[verbatim,quote,relative=1]
+\override Score.BarNumber.break-visibility = #end-of-line-invisible
+\partial 4 \time 3/4 f4 | 2 4 | 2 \bar "||"
+\time 9/8 \partial 4. f8 8 8 | 2. 8 8 8 |
+@end lilypond
+
@item
It is now possible to override the @code{text} property of
chord names.
@unnumberedsubsubsec Mensural time signatures
@cindex mensuration sign
-@cindex time signatures
+@cindex time signature, mensural
+@cindex time signature style
There is limited support for mensuration signs (which are similar to,
but not exactly the same as time signatures). The glyphs are hard-wired
time signature.
@cindex polymetric scores
-@cindex Time signatures, multiple
+@cindex time signature, multiple
@lilypond[quote,verbatim]
\score {
\time 3/4 c2.
@end lilypond
-@cindex time signature, visibility of
+Mid-measure time signature changes are covered in @ref{Upbeats}.
+
+@cindex time signature visibility
Time signatures are printed at the beginning of a piece
and whenever the time signature changes. If a change takes place
@cindex measure, partial
@cindex measure, pickup
@cindex pickup measure
+@cindex time signature, mid-measure
@funindex measurePosition
@funindex \partial
@funindex partial
Partial or pick-up measures, such as an @emph{anacrusis} or an
-@emph{upbeat}, are entered using the @code{\partial} command,
+@emph{upbeat}, are entered using the @code{\partial} command:
@example
\partial @var{duration}
@end example
-@noindent
-where @code{@var{duration}} is the @emph{remaining} length of the
-partial measure @emph{before} the start of the next full measure.
-
-@lilypond[quote,verbatim,relative=1]
-\time 3/4
-\partial 8
-e8 | a4 c8 b c4 |
-@end lilypond
-
-The @var{duration} can be any value less than a full measure:
+When @code{\partial} is used at the beginning of a score,
+@code{@var{duration}} is the length of the music preceding the
+first bar.
@lilypond[quote,verbatim,relative=1]
\time 3/4
r4 e8 | a4 c8 b c4 |
@end lilypond
-@code{\partial @var{duration}} can also be written as:
-
-@example
-\set Timing.measurePosition -@var{duration}
-@end example
-
-So the first example above could be written:
+When @code{\partial} is used after the beginning of a score,
+@code{@var{duration}} is the @emph{remaining} length of the
+current measure. It does not create a new numbered bar.
@lilypond[quote,verbatim,relative=1]
-\time 3/4
-\set Timing.measurePosition = #(ly:make-moment -1/8)
-e8 | a4 c8 b c4 |
+\set Score.barNumberVisibility = #all-bar-numbers-visible
+\override Score.BarNumber.break-visibility =
+ #end-of-line-invisible
+\time 9/8
+d'4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
+\time 12/8
+\partial 4.
+c8( d) e | f2.~ 4 f8 a,( c) f |
@end lilypond
-The property @code{measurePosition} contains a rational number,
-which is usually positive and indicates how much of the measure
-has passed at this point. @code{\partial @var{duration}} is
-defined such that no numbered bar gets created: when used at the
-beginning of a score, @code{measurePosition} is set to a
-negative number, implying that the current bar will be
-@emph{preceded} by additional material. When used elsewhere, it
-moves the requested distance before the @emph{end} of the bar.
+The @code{\partial} command is @emph{required} when the time
+signature changes in mid measure, but it may also be used alone.
@lilypond[quote,verbatim,relative=1]
\set Score.barNumberVisibility = #all-bar-numbers-visible
c8 b[ c b] |
@end lilypond
+The @code{\partial} command sets the @code{Timing.measurePosition}
+property, which is a rational number that indicates how much of
+the measure has passed.
@seealso
Music Glossary:
@cindex double time signatures
@cindex signatures, polymetric
-@cindex time signatures, polymetric
-@cindex time signatures, double
+@cindex time signature, polymetric
+@cindex time signature, double
@cindex polymetric signatures
@cindex meter, polymetric
--- /dev/null
+\version "2.19.16"
+
+\header {
+ texidoc = "Mid-measure time signature changes not accompanied by
+\\partial generate warnings."
+}
+
+#(ly:expect-warning "mid-measure time signature without \\partial")
+
+\score {
+ \relative {
+ \partial 8 \time 4/4
+ a'8 | d4 \time 3/4 cis b
+ }
+}
-\version "2.19.4"
+\version "2.19.16"
\header {
- texidoc = "Time signature changes in midmeasure generate warnings,
-except in an anacrusis or when @code{ignoreBarChecks} is true.
-@code{measurePosition} is reset to 0, so a full measure follows, regardless
-of the original position.
+ texidoc = "Mid-measure time signature changes must be accompanied by
+\\partial.
-This example should end at bar 3, with no barline before the 2/4."
+In this example, no bar numbers should be omitted or repeated, and all
+double bar lines should have parenthesized bar numbers consistent with
+the single bar lines. Both scores should look identical.
+
+@itemize @bullet
+@item \\time 2/4 occurs at a negative position
+@item \\time 6/8 occurs at a position less than the new measure length
+@item \\time 3/8 occurs at a position equal to the new measure length
+@item \\time 3/16 occurs at a position greater than the new measure length
+@end itemize"
}
-#(ly:expect-warning (_ "\\time in mid-measure at 1/4"))
+\score {
+ \relative {
+ \set Score.barNumberVisibility = #all-bar-numbers-visible
+ \override Score.BarNumber.break-visibility = #all-visible
+ \time 2/4 \partial 8
+ a'8 | d4
+ \bar "||" \time 6/8 \partial 4.
+ cis8 b a | \barNumberCheck 2 g2. | \barNumberCheck 3 g4.
+ \bar "||" \time 3/8 \partial 4.
+ f4. | \barNumberCheck 4 f4. | \barNumberCheck 5 f4
+ \bar "||" \time 3/16 \partial 8
+ fis8 | \barNumberCheck 6 g16 a g | \barNumberCheck 7
+ }
+}
\score {
\relative {
+ \set Score.barNumberVisibility = #all-bar-numbers-visible
\override Score.BarNumber.break-visibility = #all-visible
\partial 8 \time 2/4
a'8 | d4
- \time 6/8 \partial 4.
- cis8 b a | g4. \barNumberCheck 2
- \set Timing.ignoreBarChecks = ##t
- \time 12/8
- fis4. e d
- \time 2/4
- \set Timing.ignoreBarChecks = ##f
- a'2 | \barNumberCheck 3
+ \bar "||" \partial 4. \time 6/8
+ cis8 b a | \barNumberCheck 2 g2. | \barNumberCheck 3 g4.
+ \bar "||" \partial 4. \time 3/8
+ f4. | \barNumberCheck 4 f4. | \barNumberCheck 5 f4
+ \bar "||" \partial 8 \time 3/16
+ fis8 | \barNumberCheck 6 g16 a g | \barNumberCheck 7
}
}
= Duration::unsmob (get_music ()->get_property ("duration")))
{
Moment length = Moment (dur->get_length ());
- if (get_outlet ()->now_mom () > 0)
+
+ // Partial_iterator is an iterator rather than an engraver,
+ // so the active context it is getting called in does not
+ // depend on which context definition the engraver might be
+ // defined.
+ //
+ // Using where_defined to find the context where
+ // measurePosition should be overwritten does not actually
+ // work since the Timing_translator does not set
+ // measurePosition when initializing.
+
+ Context *timing = Context::unsmob
+ (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
+ get_outlet ()->self_scm (),
+ ly_symbol2scm ("Timing")));
+
+ if (!timing)
+ programming_error ("missing Timing in \\partial");
+ else if (get_outlet ()->now_mom () > 0)
{
+ timing->set_property ("partialBusy", ly_bool2scm (true));
Global_context *tg = get_outlet ()->get_global_context ();
tg->add_finalization (scm_list_3 (finalization_proc,
get_outlet ()->self_scm (),
}
else
{
- // Partial_iterator is an iterator rather than an engraver,
- // so the active context it is getting called in does not
- // depend on which context definition the engraver might be
- // defined.
- //
- // Using where_defined to find the context where
- // measurePosition should be overwritten does not actually
- // work since the Timing_translator does not set
- // measurePosition when initializing.
-
- Context *timing = Context::unsmob
- (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
- get_outlet ()->self_scm (),
- ly_symbol2scm ("Timing")));
- if (!timing)
- programming_error ("missing Timing in \\partial");
- else
- {
- Moment mp = robust_scm2moment
- (timing->get_property ("measurePosition"),
- Rational (0));
- mp.main_part_ = 0;
- timing->set_property
- ("measurePosition", (mp - length).smobbed_copy ());
- }
+ Moment mp = robust_scm2moment
+ (timing->get_property ("measurePosition"),
+ Rational (0));
+ mp.main_part_ = 0;
+ timing->set_property
+ ("measurePosition", (mp - length).smobbed_copy ());
}
}
else
mp.main_part_ = measure_length (timing);
timing->set_property ("measurePosition",
(mp - *Moment::unsmob (length)).smobbed_copy ());
+ timing->unset_property (ly_symbol2scm ("partialBusy"));
+
return SCM_UNSPECIFIED;
}
#include "item.hh"
#include "international.hh"
#include "misc.hh"
+#include "moment.hh"
#include "stream-event.hh"
#include "time-signature.hh"
#include "warn.hh"
void
Time_signature_engraver::process_music ()
{
+ if (time_signature_)
+ return;
+
SCM fr = get_property ("timeSignatureFraction");
- if (!time_signature_
- && last_time_fraction_ != fr
+ if (last_time_fraction_ != fr
&& scm_is_pair (fr))
{
+ time_signature_ = make_item ("TimeSignature", time_cause_);
+ time_signature_->set_property ("fraction", fr);
+
+ // Todo: "implicit" does not seem perfectly accurate (issue 4151)
+ if (last_time_fraction_ == SCM_BOOL_F)
+ time_signature_->set_property ("break-visibility",
+ get_property ("implicitTimeSignatureVisibility"));
+
int den = scm_to_int (scm_cdr (fr));
if (den != (1 << intlog2 (den)))
{
OTOH, Tristan Keuris writes 8/20 in his Intermezzi.
*/
- warning (_f ("strange time signature found: %d/%d",
- int (scm_to_int (scm_car (fr))),
- den));
+ time_signature_->warning (_f ("strange time signature found: %d/%d",
+ int (scm_to_int (scm_car (fr))),
+ den));
}
- time_signature_ = make_item ("TimeSignature", time_cause_);
- time_signature_->set_property ("fraction", fr);
-
- if (last_time_fraction_ == SCM_BOOL_F)
- time_signature_->set_property ("break-visibility",
- get_property ("implicitTimeSignatureVisibility"));
-
last_time_fraction_ = fr;
}
}
void
Time_signature_engraver::stop_translation_timestep ()
{
+ if (time_signature_ && (time_cause_ != SCM_EOL))
+ {
+ Moment *mp = Moment::unsmob (get_property ("measurePosition"));
+ if (mp && (mp->main_part_ > Rational (0))
+ && !to_boolean (get_property ("partialBusy")))
+ time_signature_->warning ("mid-measure time signature without \\partial");
+ }
+
time_signature_ = 0;
time_cause_ = SCM_EOL;
}
/* read */
"implicitTimeSignatureVisibility "
+ "partialBusy "
"timeSignatureFraction ",
/* write */
detected.")
+ (partialBusy ,boolean? "Signal that \\partial acts at the current timestep.")
+
+
(quotedCueEventTypes ,list? "A list of symbols, representing the
event types that should be duplicated for @code{\\cueDuring} commands.")
(quotedEventTypes ,list? "A list of symbols, representing the
structure))
(beaming-exception
(beam-exceptions fraction time-signature-settings))
- (new-measure-length (ly:make-moment num den))
- (pos (ly:context-property context 'measurePosition)))
- ;;\time is OK at a negative measurePosition (after \partial),
- ;;but at a positive position it's probably a mistake, so warn
- ;;(like a barcheck) and reset it to 0 to prevent errors.
- (if (> (ly:moment-main pos) 0)
- (begin
- (if (not (ly:context-property context 'ignoreBarChecks #f))
- (ly:music-warning music
- (_ "\\time in mid-measure at ~A")
- (ly:moment-main pos)))
- (ly:context-set-property!
- context 'measurePosition (ly:make-moment 0))))
+ (new-measure-length (ly:make-moment num den)))
(ly:context-set-property!
context 'timeSignatureFraction fraction)
(ly:context-set-property!