Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13415)

Issue 44860045: Create Score context before starting iteration.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by Devon Schudy
Modified:
10 years, 3 months ago
Reviewers:
dak
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Create Score context before starting iteration. This means Score-level translators can rely on being created at the beginning of iteration, rather than in the middle of a timestep. This prevents bugs like issue 2392 and makes maintaining translators easier. Revert commit 6b9921f0e2b8c73ebb3063109562d97fba898dab (the previous fix for issue 2392), since it's no longer needed. Add comments explaining how iteration works.

Patch Set 1 #

Patch Set 2 : Add test case. Mention ly_interpret_music_expression and create_children. Add dubious start_transla… #

Patch Set 3 : Clean up test case. #

Patch Set 4 : Document iteration in CG too. Fix error in Score context doc. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -28 lines) Patch
M Documentation/contributor/programming-work.itexi View 1 2 3 2 chunks +23 lines, -13 lines 2 comments Download
A input/regression/initial-contexts.ly View 1 2 1 chunk +16 lines, -0 lines 1 comment Download
M lily/global-context.cc View 1 2 3 3 chunks +20 lines, -0 lines 2 comments Download
M lily/score-performer.cc View 1 chunk +0 lines, -11 lines 0 comments Download
M lily/translator-group.cc View 1 1 chunk +6 lines, -0 lines 2 comments Download
M ly/engraver-init.ly View 1 2 3 1 chunk +3 lines, -4 lines 1 comment Download

Messages

Total messages: 6
Devon Schudy
Add test case. Mention ly_interpret_music_expression and create_children. Add dubious start_translation_timestep call.
10 years, 4 months ago (2013-12-21 21:03:44 UTC) #1
Devon Schudy
Clean up test case.
10 years, 4 months ago (2013-12-21 21:47:34 UTC) #2
Devon Schudy
Document iteration in CG too. Fix error in Score context doc.
10 years, 4 months ago (2013-12-23 00:35:33 UTC) #3
dak
https://codereview.appspot.com/44860045/diff/60001/Documentation/contributor/programming-work.itexi File Documentation/contributor/programming-work.itexi (right): https://codereview.appspot.com/44860045/diff/60001/Documentation/contributor/programming-work.itexi#newcode43 Documentation/contributor/programming-work.itexi:43: event a moment (a time) and a context, which ...
10 years, 4 months ago (2013-12-25 19:41:26 UTC) #4
Devon Schudy
David Kastrup wrote: > https://codereview.appspot.com/44860045/diff/60001/input/regression/initial-contexts.ly#newcode10 > input/regression/initial-contexts.ly:10: %%and iteration can't skip time > without it. ...
10 years, 3 months ago (2014-01-03 19:07:55 UTC) #5
dak
10 years, 3 months ago (2014-01-03 19:49:28 UTC) #6
On 2014/01/03 19:07:55, Devon Schudy wrote:
> David Kastrup wrote:
> >
>
https://codereview.appspot.com/44860045/diff/60001/input/regression/initial-c...
> > input/regression/initial-contexts.ly:10: %%and iteration can't skip time
> > without it.
> > This comment is a bit of a non-sequitur: time is kept in the Global
> > context, so it could get skipped.
> 
> Hmm, \skip successfully skips time, but doesn't update
> measurePosition, because Timing_translator doesn't exist yet, so the
> barlines are in the wrong places.

Ugh.  Ok, that's bad.

>
https://codereview.appspot.com/44860045/diff/60001/lily/global-context.cc#new...
> > lily/global-context.cc:148: find_create_context (default_child_, "",
> > SCM_EOL);
> > This precludes \new Score \with ..., quite a no-no.
> 
> \new Score creates the context in construct_children, so that still
> works.

That sounds shaky enough to warrant a good explanation in comments.

> Something like { \skip 4 \new Score ... } would fail, though.
> Should that work?

Excellent question.  Could be used for putting some delay into the MIDI before
the score starts.  But whether that _should_ work in that manner?  No idea. 
What when the Timing_translator is moved to Staff level?  It would seem like
nothing makes sense but having MeasurePosition start at \new Staff when a staff
is started after other staves.  In analogy to that, "should that work" might
indeed warrant a tentative "yes", starting with a measurePosition of 0.

> [on calling start_translation_timestep for new translators]
> > Isn't that sufficient to have the Score context created in time?
> > Without requiring the other fixes?
> 
> It doesn't create it in time, but it does start the Score translators
> properly when they're created late — but it still doesn't start
> Score_performer correctly, because it's a Translator_group, not a
> translator. However, the only Translator_group per_timestep
> initialization is creating Score_performer::audio_column_, so if
> Audio_column goes away, there's nothing left to do there.

This is really headache material.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b