Menu

#4182 dynamics on skips confuse cross-staff stems

Started
None
review
2020-05-11
2014-10-31
Anonymous
No

https://codereview.appspot.com/554030043

Originally created by: *anonymous

Originally created by: k-ohara5...@oco.net

Sometime since ver 2.18, dynamics on skips began to make cross-staff stems point the wrong way.   The ledger line seems to be necessary for the bug.

up = \change Staff = "up"
dn = \change Staff = "down"
\new PianoStaff \transpose c c' << \time 2/4
  \new Staff = "up" 
    s2
  \new Staff = "down" << 
    {s8*3 s8\p  }
    { g8[ \up e \dn g \up c] } >> >

1 Attachments

Discussion

  • Google Importer

    Google Importer - 2014-10-31

    Originally posted by: k-ohara5...@oco.net

    There is a bunch of discussion in issue 3363 issue 3385 issue 3503 on how cross-staff things work.

    'cross-staff' has come to mean that, as staves are stretched across the page. the object changes shape or position relative to its parent staff.  Staff-spacing ignores cross-staff objects, trusting those objects to find what room they can after staff-spacing.

    Dynamics in the same voice as the note they attach to, if the note has a cross-staff stem, are themselves cross-staff.   Dynamics attached to a spacer, as in this example, should probably not be marked cross-staff.

    Probably the change to make dynamics align to note-columns (maybe issue 3254 ?) causes the dynamic placement to find the x-extent of the note-column, which sometimes (chords with a second) depends on stem direction.  Usually a cross-staff stem will refuse to commit to a direction, but here something went wrong and the stem attachment point was set wrongly.

     

    Related

    Issues: #3254
    Issues: #3363
    Issues: #3385
    Issues: #3503

  • Google Importer

    Google Importer - 2014-11-02

    Originally posted by: k-ohara5...@oco.net

    > Usually a cross-staff stem will refuse to commit to a direction,

    Oops, that's not true.  The layout code follows conventions to avoid looking up the direction of a stem, using get_property_data() instead of get_property() and the various 'pure' versions of functions.  There is a leak in those conventions.

    I have not found a reasonable way to have the Dynamic 'p' ask for the center of the chord above it "but don't go to the trouble of figuring out cross-staff stem directions" without adding several more 'pure' flags.

    I just tried having cross-staff Stems pick a default direction, and then re-computing the directions after line breaking.  Some of the stem attachment points to noteheads are then wrong, having depended on the tentative direction of the Stem.

     
  • Google Importer

    Google Importer - 2014-11-15

    Originally posted by: k-ohara5...@oco.net

    At the moment I have trouble seeing how this worked before.  The horizontal constraints on spacing notes on a line depend on, and for chords with seconds that depends on whether the stem points up or down, but the stem direction can potentially depend on staff spacing, which depends on how many notes fit on each line.

    up = \change Staff = "up"
    dn = \change Staff = "down"
    \new PianoStaff <<
      \new Staff = "up" {
        \time 2/4 s2 }
      \new Staff = "down" <<
        {s8*3 s8\p  }
        {\clef bass a,8[ \up e' \dn a, \up <c' d' g'>] } >> >>

    Workaround:   \once\voiceTwo   or as appropriate, before any misplaced stems

     
  • Phil Holmes

    Phil Holmes - 2015-09-14

    Data point: occurred between 2.19.6 and 2.19.11

     
  • Phil Holmes

    Phil Holmes - 2015-09-14

    Following a bisection, I can state that the patch in Issue 3978 caused this issue.

     
  • Kevin Barry

    Kevin Barry - 2020-05-07

    Issue 4182: avoid checking the offset of cross-staff stems too early

    Calculating the 'X-offset of a cross-staff Stem too early causes the
    Stem's 'direction property to be accessed while it is still
    "calculation-in-progress" - always returning "UP". This causes the
    X-offset to be set incorrectly when the eventual stem direction will be
    "DOWN".

    This problem occurs in the scenario where the X-offset of a notehead is
    calculated early, when NoteHead::stem_x_shift calls
    Stem::calc_positioning_done (via get_property).

    Update NoteHead::stem_x_shift to only check a stem's "positioning-done"
    property if it is not cross-staff. This will prevent the above scenario
    from triggering the problem. The Stem's offset will be calculated again
    later anyway, and this does not change the return value of
    NoteHead::stem_x_shift as it always returns 0.

    Add a suitable regression test.

    https://codereview.appspot.com/554030043

     
  • Anonymous

    Anonymous - 2020-05-07
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
    +https://codereview.appspot.com/554030043
    +
     *Originally created by:* *anonymous
    
     *Originally created by:* [k-ohara5...@oco.net](http://code.google.com/u/110197288862747384800/)
    
    • assigned_to: Kevin Barry
    • Needs: -->
    • Patch: new --> review
    • Type: -->
     
  • Anonymous

    Anonymous - 2020-05-07

    Passes make, make check and a full make doc.

     
  • Kevin Barry

    Kevin Barry - 2020-05-08

    Fix texidoc style issues in cross-staff-stem-offset.ly

    https://codereview.appspot.com/554030043

     
  • Anonymous

    Anonymous - 2020-05-08
    • Needs: -->
    • Patch: new --> review
    • Type: -->
     
  • Anonymous

    Anonymous - 2020-05-08

    Passes make, make check and a full make doc. (reg test diffs as commend above)

     
  • Anonymous

    Anonymous - 2020-05-09

    Patch on countdown for May 11th

     
  • Kevin Barry

    Kevin Barry - 2020-05-10
     
  • Anonymous

    Anonymous - 2020-05-11
    • Needs: -->
    • Patch: new --> review
    • Type: -->
     
  • Anonymous

    Anonymous - 2020-05-11

    Passes make, make check and a full make doc. (reg test diffs as commend above)

     
    • Jonas Hahnfeld

      Jonas Hahnfeld - 2020-05-11

      Oh no, this should not have worked! Please use GitLab

       
      • Jonas Hahnfeld

        Jonas Hahnfeld - 2020-05-11

        In case you can read this, I still haven't figured out the right way to disable write access...