This is a simpler (easier to comprehend) change than what I proposed in http://article.gmane.org/gmane.comp.gnu.lilypond.bugs/39790 . ...
10 years, 7 months ago
(2014-09-23 01:11:51 UTC)
#1
This is a simpler (easier to comprehend) change than what I proposed in
http://article.gmane.org/gmane.comp.gnu.lilypond.bugs/39790 .
I rewrote the regression test "time-signature-midmeasure.ly" to focus on a
specific aspect of this feature: suppress the warning, so the output is quite
different.
On 2014/09/23 01:11:51, Dan Eble wrote: > This is a simpler (easier to comprehend) change ...
10 years, 7 months ago
(2014-09-23 14:17:11 UTC)
#2
On 2014/09/23 01:11:51, Dan Eble wrote:
> This is a simpler (easier to comprehend) change than what I proposed in
> http://article.gmane.org/gmane.comp.gnu.lilypond.bugs/39790 .
>
> I rewrote the regression test "time-signature-midmeasure.ly" to focus on a
> specific aspect of this feature: suppress the warning, so the output is quite
> different.
I find this too hard to understand anyway and the decision taken too arbitrary
(probably only matching one particular music style): if we do something like
\time 4/4 c4 \time 3/4
then the decision whether or not to start a new measure/warning will likely
change if some grace note occurs anywhere.
So I propose we junk the warning if we cannot place it accurately: people who
want whole-measure warnings are supposed to use barchecks anyway.
So what else do we need to do? When doing
\time 4/4 c1 \time 3/4 ...
or
\time 3/4 c2. \time 4/4 ...
we clearly want the new meter to start on the bar and not, say, have time 4/4
notice that it only used up 3 beats and still has one to extend. So I'd say
that \time ... should probably do an implicit \partial 1*0, meaning that you
need to override it _afterwards_ with a different \partial if you don't actually
want it to start a new bar.
I think that should get us rid of most problems, the main resulting problem
being that if \time occurs in several places at the same point of time, one
\partial (if one is desired) has to follow the last \time: any \partial executed
before the final \time of a time step would be ignored.
I think "\time will start a new measure, follow it with \partial if you don't
want that" is a clear rule and probably not all that different from what people
would be expect/write without reading the manual previously.
On 2014/09/23 14:17:11, dak wrote: > \time 3/4 c2. \time 4/4 ... > > we ...
10 years, 7 months ago
(2014-09-23 22:06:48 UTC)
#3
On 2014/09/23 14:17:11, dak wrote:
> \time 3/4 c2. \time 4/4 ...
>
> we clearly want the new meter to start on the bar and not, say, have time 4/4
> notice that it only used up 3 beats and still has one to extend.
Thanks for the feedback. I will contemplate the rest of it a little later, but
I want to clarify that the patch seems to work as we clearly want it to for this
case. (I should add a regression test for it.) Is there something suspicious
about my coding that made you think it would not?
I believe that always starting a new bar at the time change will produce
incorrect measure numbers, but as I said, I will consider it more fully later.
On 2014/09/23 14:17:11, dak wrote: > So I propose we junk the warning if we ...
10 years, 7 months ago
(2014-09-24 05:17:12 UTC)
#4
On 2014/09/23 14:17:11, dak wrote:
> So I propose we junk the warning if we cannot place it accurately: people who
> want whole-measure warnings are supposed to use barchecks anyway.
If the only issue were wholeness of measures, I would agree; however, if there
are other problems such as incorrect bar numbers, it would be nice to have a
warning, because that is not going to be caught by a common bar check. Do you
agree?
> I think "\time will start a new measure, follow it with \partial if you don't
> want that" is a clear rule and probably not all that different from what
people
> would be expect/write without reading the manual previously.
If the user wanted to start a new measure, why was the first measure left
incomplete?
Setting measurePosition to 0 on \time doesn't work. It engraves a bar number
(value same as the previous bar number, without parentheses) at the time change
(when I also have \bar "||"). I do not want a bar number there because it's not
the beginning of a measure in the pieces I'm trying to engrave.
If you want to require \partial for my use cases, what works is to set
measurePosition to the length of the new measure. That becomes a problem if the
user really wants to start a new measure (which doesn't make sense); omitting
\partial is not good enough because no bar line is engraved unless the user
writes \bar explicitly, and then if a parenthesized bar number is engraved, it
is wrong. Setting the position to a useless default is rather dissatisfying
compared to finishing the measure by default.
Your comment about grace notes went over my head, but it is not forgotten, and I
will think about it when I have more time.
nine.fierce.ballads@gmail.com writes: > On 2014/09/23 14:17:11, dak wrote: >> So I propose we junk the ...
10 years, 7 months ago
(2014-09-24 16:00:14 UTC)
#5
nine.fierce.ballads@gmail.com writes:
> On 2014/09/23 14:17:11, dak wrote:
>> So I propose we junk the warning if we cannot place it accurately:
> people who
>> want whole-measure warnings are supposed to use barchecks anyway.
>
> If the only issue were wholeness of measures, I would agree; however, if
> there are other problems such as incorrect bar numbers, it would be nice
> to have a warning, because that is not going to be caught by a common
> bar check. Do you agree?
_Are_ incorrect bar numbers a problem? When do we get them?
>> I think "\time will start a new measure, follow it with \partial if
>> you don't want that" is a clear rule and probably not all that
>> different from what people would be expect/write without reading the
>> manual previously.
>
> If the user wanted to start a new measure, why was the first measure
> left incomplete?
Because the meter change, including the respective accents to be placed
in the measure occurs before the measure is complete. If it didn't, the
meter change would have been written at the end of the measure.
Since the metric change is _before_ the previous meter has completed, it
is an arbitrary musical decision how much material of the new meter may
count as \partial. I don't see your particular case as the gold
standard of when not to warn. At the same time, I can understand that
you want some way _not_ to get a warning. A perfectly reasonable way to
do that is to _require_ a \partial after \time in case a
non-whole-measure is desired. Since \partial these days does its work
at a very late time and we don't really have a hook for the time "after
any \partial might have done its work", I don't see a good way to _get_
that warning or rather how _not_ to get that warning _iff_ there is no
\partial at all.
> Setting measurePosition to 0 on \time doesn't work.
\partial does something different.
> If you want to require \partial for my use cases, what works is to set
> measurePosition to the length of the new measure.
I do want to require \partial for your use cases even though I can think
of no good way to trigger a warning when it is left off in case of an
incomplete measure before. The resulting behavior of cutting the
previous measure short when no \partial is given _would_ warrant a
warning. I just don't see how to do that.
> That becomes a problem if the user really wants to start a new measure
> (which doesn't make sense); omitting \partial is not good enough
> because no bar line is engraved unless the user writes \bar
> explicitly, and then if a parenthesized bar number is engraved, it is
> wrong. Setting the position to a useless default is rather
> dissatisfying compared to finishing the measure by default.
>
> Your comment about grace notes went over my head, but it is not
> forgotten, and I will think about it when I have more time.
> https://codereview.appspot.com/143450043/
I'm currently still working on GUILE2 stuff. Once I'm more or less
through, I'll try proposing something akin to what I described and check
how it works with your regression tests.
--
David Kastrup
On 2014/09/24 16:00:14, dak wrote: > I'm currently still working on GUILE2 stuff. Once I'm ...
10 years, 7 months ago
(2014-09-24 23:36:32 UTC)
#6
On 2014/09/24 16:00:14, dak wrote:
> I'm currently still working on GUILE2 stuff. Once I'm more or less
> through, I'll try proposing something akin to what I described and check
> how it works with your regression tests.
I think I understand what you want. I'll take another shot first.
On 2014/09/25 03:53:35, Dan Eble wrote: > This new patch set works for me. If ...
10 years, 7 months ago
(2014-09-25 09:46:32 UTC)
#8
On 2014/09/25 03:53:35, Dan Eble wrote:
> This new patch set works for me. If you approve of it (take your time), I'll
> start working on documentation. Thanks.
Well, your code looks simpler than my sketch: I don't see the \partial 1*0 part
implemented. But in my experiments, it does exactly the same job even in
midmeasure. I just have no idea why and where it manages to reset
measurePosition.
When \time cuts short the previous measure without a \partial, it still resets
the timing and starts a new bar number without placing a bar line. That's sort
of weirdish, but it has no permanent off-synch consequences.
I'm not really sure why this works in the case without \partial and an
incomplete measure. If you can figure it out, adding a code comment at the
place where the measurePosition check/reset used to be might help future
readers.
If not, still fine. This covers your use case in a natural manner and at least
in my experiments it did nothing out of line when fed various strange things.
And it will not require an instruction booklet to use either.
https://codereview.appspot.com/143450043/diff/20001/input/regression/time-signature-midmeasure.ly File input/regression/time-signature-midmeasure.ly (right): https://codereview.appspot.com/143450043/diff/20001/input/regression/time-signature-midmeasure.ly#newcode5 input/regression/time-signature-midmeasure.ly:5: \\partial except in an anacrusis. \partial is an anacrusis ...
10 years, 7 months ago
(2014-09-25 10:30:09 UTC)
#9
https://codereview.appspot.com/143450043/diff/20001/input/regression/time-sig...
File input/regression/time-signature-midmeasure.ly (right):
https://codereview.appspot.com/143450043/diff/20001/input/regression/time-sig...
input/regression/time-signature-midmeasure.ly:5: \\partial except in an
anacrusis.
\partial is an anacrusis also in the middle of the piece, so this is a bit weird
as a description. Also since \time does _not_ include an implicit \partial 1*0,
the change only needs to be _accompanied_ by \partial, it does not make a
difference whether the \partial is before or after the \time. So the start of
the piece is no exception.
So it's rather "Time signature changes not followed by a complete measure should
be accompanied by a corresponding \partial".
In experimenting around, I found that the (warning case?)
{
\set Timing.barNumberVisibility = #all-bar-numbers-visible
\override Score.BarNumber.break-visibility = #all-visible
\time 4/4 c'8 8 8 8 8 8 \bar "|" \time 3/4 8 8 8 8 8 8 |
}
produces ungainly output. It happens that this is not actually related to the
\time change very much, so it can be fixed with a midmeasure partial as either
{
\set Timing.barNumberVisibility = #all-bar-numbers-visible
\override Score.BarNumber.break-visibility = #all-visible
\time 4/4 c'8 8 8 8 8 \partial 8 8 | 8 8 8 8 8 8 8 8
}
or
{
\set Timing.barNumberVisibility = #all-bar-numbers-visible
\override Score.BarNumber.break-visibility = #all-visible
\time 4/4 c'8 8 \partial 2 8 8 8 8 | 8 8 8 8 8 8 8 8
}
with differences in autobeaming.
In summary, the only combination that appears tricky is when the _first_ bar is
shorter than its time signature and should still be counted as bar 1 rather than
preceding it.
In that case, the \partial needs to be in mid-measure rather than at the start.
I think that's more a feature of \partial than of \time. Basically \time starts
at the beginning of a measure, and if you want to change that, add \partial to
it (after \time is likely prettier but not required) to indicate how far the
next bar is supposed to be.
Soooo. I think this behaves as well as may be expected. When writing the
documentation, some of it may be grouped better with \partial. While \partial x
\time a/b produces equal results to \time a/b \partial x, I'd only show the
latter form as it seems a bit more logical.
Nice.
David, what do you think about adding a context property which \time sets when it ...
10 years, 7 months ago
(2014-09-26 12:49:22 UTC)
#11
David, what do you think about adding a context property which \time sets when
it is called in mid-measure, which \partial resets, and about which bar checks
warn if it is set?
https://codereview.appspot.com/143450043/diff/40001/Documentation/notation/rh...
File Documentation/notation/rhythms.itely (right):
https://codereview.appspot.com/143450043/diff/40001/Documentation/notation/rh...
Documentation/notation/rhythms.itely:1395: The @code{@var{duration}} can be any
value less than a full measure.
Oops. I should have updated this. The new regression test shows a case where
the partial duration is equal to a full measure in the new time signature.
On 2014/09/26 12:49:22, Dan Eble wrote: > David, what do you think about adding a ...
10 years, 7 months ago
(2014-09-26 13:15:30 UTC)
#12
On 2014/09/26 12:49:22, Dan Eble wrote:
> David, what do you think about adding a context property which \time sets when
> it is called in mid-measure, which \partial resets, and about which bar checks
> warn if it is set?
Don't drag bar checks into this. I've thought about communicating this kind of
thing with a context property. However, I cannot come up with a scheme that
would not require us to definitely state whether one has to write \partial x
\time y or \time y \partial x.
Which is a tolerable demand. Here is how it would work with \partial x \time y:
\partial sets a flag when encountered, and it resets it in its
end-of-timestep-hook. \time complains when it is encountered mid-measure
without this flag. I am not completely sure whether \partial could actually
just set measurePosition to zero as a "flag". That would be simplest, but it
might have unexpected side effects, like with bar lines or numbering or such.
Here is how stuff would work with \time y \partial x:
\time sets a flag when called in mid-measure, and it resets it under protest in
an end-of-timestep hook if it's still set. \partial (not in its end-of-timestep
hook but immediately) resets this flag.
I don't see a good reliable way of cranking out a warning without prescribing a
particular order of \partial and \time.
>
https://codereview.appspot.com/143450043/diff/40001/Documentation/notation/rh...
> File Documentation/notation/rhythms.itely (right):
>
>
https://codereview.appspot.com/143450043/diff/40001/Documentation/notation/rh...
> Documentation/notation/rhythms.itely:1395: The @code{@var{duration}} can be
any
> value less than a full measure.
> Oops. I should have updated this. The new regression test shows a case where
> the partial duration is equal to a full measure in the new time signature.
I suspect that _somebody_ should have updated this some time ago already. The
end-of-timestep hook way of implementing \partial should likely mean that the
less-than-a-full-measure restriction no longer applies.
Now there is a warning if \time is used mid-measure without \partial. Order is not ...
10 years, 7 months ago
(2014-09-28 04:12:57 UTC)
#13
Now there is a warning if \time is used mid-measure without \partial. Order is
not important. I have no more changes planned except to respond to whatever
feedback you provide.
I added a boolean context property. I experimented with special values for
existing properties, but found nothing as clean as this.
In the notation reference, I removed the detailed discussion of
Timing.measurePosition since setting it is no longer equivalent to \partial.
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
File lily/time-signature-engraver.cc (right):
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
lily/time-signature-engraver.cc:104: time_signature_->warning (_f ("\\time
without \\partial amid measure %d",
Is there an easy way to make this warning cite the position of \time in the
source file?
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engraver.cc File lily/time-signature-engraver.cc (right): https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engraver.cc#newcode102 lily/time-signature-engraver.cc:102: if (!(scm_is_bool (partialBusy) && scm_is_true (partialBusy))) if (!to_boolean (get_property ...
10 years, 7 months ago
(2014-09-28 06:33:12 UTC)
#14
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
File lily/time-signature-engraver.cc (right):
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
lily/time-signature-engraver.cc:102: if (!(scm_is_bool (partialBusy) &&
scm_is_true (partialBusy)))
if (!to_boolean (get_property ("partialBusy")))
is the standard way we check for boolean properties.
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
lily/time-signature-engraver.cc:104: time_signature_->warning (_f ("\\time
without \\partial amid measure %d",
On 2014/09/28 04:12:57, Dan Eble wrote:
> Is there an easy way to make this warning cite the position of \time in the
> source file?
This is not going to make you happy:
When the cause argument of time_signature_ at creation time is set to the
originating stream event, this should happen automatically.
You don't have the cause argument of time_signature_ available, however, since
the Time_signature_engraver answers to events.
So you'll need to reverse your logic: make-time-signature-set will have to set
something like midTimeMusic to the music creating the time signature when in
midmeasure, partial will -- no, partial is an iterator, it has no
stop_translation_timestep.
Maybe the Time_signature_engraver should listen to time signature events
(possibly TimeSignatureMusic would need to get the additional type "event" in
define-music-types.scm for this to work, but I'm not sure). Then it could just
remember and use the last event (if any) for the cause of creating the
time_signature_ grob.
That would have the side effect of making \tweak work on \time, probably not the
worst idea anyway.
Uh, to answer your question: easy way: probably not really. But if you make an
extra issue "Make \tweak work on \time", your current code will magically create
the warning pointing to the source as a side effect.
https://codereview.appspot.com/143450043/diff/60001/lily/time-signature-engra...
lily/time-signature-engraver.cc:123: "implicitTimeSignatureVisibility "
partialBusy is missing in the list of read properties.
dak@gnu.org writes: > You don't have the cause argument of time_signature_ available, however, > since ...
10 years, 7 months ago
(2014-09-28 06:39:32 UTC)
#15
dak@gnu.org writes:
> You don't have the cause argument of time_signature_ available, however,
> since the Time_signature_engraver answers to events.
Argh! ... since the Time_signature_engraver does _not_ answer to events
but to property changes.
> https://codereview.appspot.com/143450043/
--
David Kastrup
On 2014/09/28 06:33:12, dak wrote: > Uh, to answer your question: easy way: probably not ...
10 years, 7 months ago
(2014-09-28 06:49:08 UTC)
#16
On 2014/09/28 06:33:12, dak wrote:
> Uh, to answer your question: easy way: probably not really. But if you make
an
> extra issue "Make \tweak work on \time", your current code will magically
create
> the warning pointing to the source as a side effect.
Tell you what: that change is probably 20 lines of mostly boilerplate code if
one knows what one is doing. I'm willing to do that if somebody else volunteers
for doc changes (this is currently listed explicitly as "does not work") and
regtests. It would make \time a bit peculiar since its effect on timing would
be on whatever the Timing context is (usually Score) while its effect regarding
tweaks would be in relation to where the next Time_signature_engraver is to be
found in relation to the \time command. So if you are working with a separate
timing track containing all \time commands, applying tweaks would not be all
that practical. Shrug. I think that would still beat the current state.
And would fix your warning.
On 2014/09/28 06:49:08, dak wrote: > On 2014/09/28 06:33:12, dak wrote: > > > Uh, ...
10 years, 7 months ago
(2014-09-28 10:27:34 UTC)
#17
On 2014/09/28 06:49:08, dak wrote:
> On 2014/09/28 06:33:12, dak wrote:
>
> > Uh, to answer your question: easy way: probably not really. But if you make
> an
> > extra issue "Make \tweak work on \time", your current code will magically
> create
> > the warning pointing to the source as a side effect.
>
> Tell you what: that change is probably 20 lines of mostly boilerplate code if
> one knows what one is doing.
I and my big mouth.
<URL:https://code.google.com/p/lilypond/issues/detail?id=4138>
Issue 143450043: Issue 4127: allow mid-measure \time
(Closed)
Created 10 years, 7 months ago by Dan Eble
Modified 10 years, 6 months ago
Reviewers: dak
Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Comments: 6