Menu

#2199 Mark_engraver in StaffGroup misplaces marks at top of Score

Fixed
Dan Eble
Enhancement
2019-12-01
2012-01-07
Anonymous
No

align outside-staff grobs vertically in staff groups

In any context in which a Vertical_align_engraver creates a
StaffGrouper, it also sees to it that all outside-staff grobs created
in the immediate context become y-axis children of the StaffGrouper.

Any such grobs which are later processed by the after-line-breaking
callback ly:side-position-interface::move_to_extremal_staff are moved
to the extremal staff of the group, not of the entire system.

http://codereview.appspot.com/331650043


Originally created by: *anonymous

Originally created by: janek.li...@gmail.com

This has been reported two times in lilypond-user.

"Mark_engraver" or "Metronome_mark_engraver" should be moveable to the
StaffGroup (and alike: GrandStaff, ChoirStaff, etc.) context (and work!!).

%%%% Snippet

\version "2.13.24"

music = \repeat unfold 5 {
  \repeat unfold 5 c'1
  \mark \default
}

\score {
  <<
    \new Staff {
      s1*0^"Marks should NOT be above this Staff (i.e. above the Score)!"
      \music
    }
    \new StaffGroup {
      <<
        \new Staff {
          s1*0^"Marks should be above the StaffGroup"
          \music
        }
        \new Staff {
          \music
        }
      >>
    }
  >>
  \layout {
    \context {
      \Score
      \remove "Mark_engraver"
      % same for "Metronome_mark_engraver"
      \remove "Staff_collecting_engraver"
    }
    \context {
      \StaffGroup
      \consists "Mark_engraver"
      \consists "Staff_collecting_engraver"
      % same for "Metronome_mark_engraver"
    }
  }
}

%% Note that it works if we move it to the Staff level (instead of the
%% StaffGroup).  But engravers at the StaffGroup level is required for
%% example if the first staff of the StaffGroup is removed, using
%% \RemoveEmptyStaves (Frenched score).

\score {
  <<
    \new Staff {
      s1*0^"Marks are not above the score"
      \music
    }
    \new StaffGroup {
      <<
        \new Staff \with {
          \consists "Mark_engraver"
        } {
          s1*0^"Marks are above this Staff"
          \music
        }
        \new Staff {
          \music
        }
      >>
    }
  >>
  \layout {
    \context {
      \Score
      \remove "Mark_engraver"
      \remove "Staff_collecting_engraver"
    }
    \context {
      \Staff
      % \consists "Mark_engraver"
      % We add this engraver to the second Staff only
      \consists "Staff_collecting_engraver"
    }
  }
}

%%%% End of the snippet

Discussion

1 2 > >> (Page 1 of 2)
  • Google Importer

    Google Importer - 2012-03-17

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

    (No comment was entered for this change.)

    Summary: Mark_engraver in StaffGroup misplaces marks at top of Score

     
  • Google Importer

    Google Importer - 2013-03-04

    Originally posted by: x.sche...@gmail.com

    Also applies to "Metronome_mark_engraver".

     
  • Google Importer

    Google Importer - 2013-05-20

    Originally posted by: rand...@randallwest.com

    would really like to see this... important for orchestral scores!

     
  • Google Importer

    Google Importer - 2013-05-20

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

    This is frustrating, because this seems to be the entire purpose of the Staff_collecting_engraver, but it seems to have not worked for a long time.

    In the development version, you can uncover the remaining functionality by adding
    ...
    \context { \StaffGroup
    ...
    \override RehearsalMark #'after-line-breaking = #'()
    % and for 2.17.18
    \override RehearsalMark #'Y-offset = #side-position-interface::y-aligned-side
    \override RehearsalMark #'padding = #0.7

    The data structures are not correct, though, so the rehearsal marks collide with anything else above the staff (which might not happen so often)

    For now, the user-defined MarkLine context works well
    <https://lists.gnu.org/archive/html/lilypond-user/2012-01/msg00556.html>

     
  • Google Importer

    Google Importer - 2013-06-03

    Originally posted by: kris7top...@gmail.com

    The same issue happens with Bar_number_engraver, too. The suggested workaround by setting after-line-breaking, Y-offset and padding works, although there are some collisions.

     
  • Google Importer

    Google Importer - 2013-08-07

    Originally posted by: dak@gnu.org

    The nature of the workaround would suggest that
    commit [r4cabd2305eda952e2d29e4a04e75e1cfb499257a]
    Author: Joe Neeman <joeneeman@gmail.com>
    Date:   Mon Aug 10 10:21:42 2009 +1000

        Move rehearsal marks, etc. to the top staff.

    would be responsible here.  That would imply that 2.13.4 was the first version where the above example stopped working.

    Any idea what the exact problem was that the above was trying to cure?  I can't find an issue associated with that commit.

    Cc: joenee...@gmail.com

     
  • Google Importer

    Google Importer - 2013-08-07

    Originally posted by: kris7top...@gmail.com

    A couple weeks ago I tried playing around with changing side-position-interface::move-to-extremal-staff to instead move to the topmost (i.e. first seen) staff collected by Staff_collecting_engraver. The result is bad alignment, and a warning that the StaffSymbol lacks the axis-group-interface, which is kinda true, since Staff_collecting_engraver collects StaffSymbols, not VerticalAxisGroups.

    I guess the problem 4cabd230 is trying to solve is that grobs with side-position-interface need to be in the same axis-group as the grob they are positioned relative to (does this make any sense? I am unfamiliar with the grob positioning code, so I might be entirely misguided.) In that case, the "true" solution would probably be to get the Staff associated with the topmost StaffSymbol collected by Staff_collecting_engraver, fetch its VerticalAxisGroup (made by Axis_group_engraver), and assign the side-positioned grob to that in side-position-interface::move-to-extremal-staff. This sound like an idea I might try out if I'll have time...

     
  • Google Importer

    Google Importer - 2013-08-07

    Originally posted by: joenee...@gmail.com

    IIRC, the purpose of the change was so that you could use outside-staff-priority to put the rehearsal marks under other outside-staff grobs. If RehearsalMark has System as its parent then this doesn't work.

     
  • Google Importer

    Google Importer - 2013-08-09

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

    While it is true that version 2.12 suffers this bug,
    which was before the patch mentioned in comment 7
      Date:   Mon Aug 10 10:21:42 2009 +1000
        Move rehearsal marks, etc. to the top staff.
    fixing this bug will almost certainly require re-writing that patch.

     
  • Google Importer

    Google Importer - 2015-08-24

    Originally posted by: simon.al...@mail.de

    LSR snippet 1010 has an updated snippet for Shevek’s MarkLine context workaround, linked to above in comment #5.

     

    Last edit: Simon Albrecht 2018-02-11
  • Dan Eble

    Dan Eble - 2018-02-23
    • assigned_to: Dan Eble
     
  • Dan Eble

    Dan Eble - 2018-02-25

    Issue 2199: align outside-staff grobs vertically in staff groups

    In any context in which a Vertical_align_engraver creates a
    StaffGrouper, it also sees to it that all outside-staff grobs created
    in the immediate context become y-axis children of the StaffGrouper.

    Any such grobs which are later processed by the after-line-breaking
    callback ly:side-position-interface::move_to_extremal_staff are moved
    to the extremal staff of the group, not of the entire system.

    http://codereview.appspot.com/331650043

     
  • Anonymous

    Anonymous - 2018-02-25

    Passes make, make check and a full make doc.

    Reg test diff attached (remember to ignore those jumping dots!)

     
    • Dan Eble

      Dan Eble - 2018-02-25

      If there is more wrong than the dot placement, I would be grateful for some clarification.

       
  • Anonymous

    Anonymous - 2018-02-25
    • Needs: -->
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2018-02-26
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,17 @@
    +align outside-staff grobs vertically in staff groups
    +
    +In any context in which a Vertical_align_engraver creates a
    +StaffGrouper, it also sees to it that all outside-staff grobs created
    +in the immediate context become y-axis children of the StaffGrouper.
    +
    +Any such grobs which are later processed by the after-line-breaking
    +callback ly:side-position-interface::move_to_extremal_staff are moved
    +to the extremal staff of the group, not of the entire system.
    +
    +http://codereview.appspot.com/331650043
    +
    +****
    +
     *Originally created by:* *anonymous
    
     *Originally created by:* [janek.li...@gmail.com](http://code.google.com/u/100525084317801742451/)
    
     
  • Anonymous

    Anonymous - 2018-02-27
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2018-02-27

    Patch on countdown for March 2nd.

     
  • Anonymous

    Anonymous - 2018-03-04
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2018-03-04

    Patch counted down - please push.

     
  • Dan Eble

    Dan Eble - 2018-03-04
    • labels: --> Fixed_2_21_0
    • Patch: push -->
     
  • Dan Eble

    Dan Eble - 2018-03-04

    commit 6a4031b4ec2411270b0c24bef02ee58ec2a26470 (origin/staging, pushed/issue-2199-marks-in-staff-group)
    Author: Dan Eble nine.fierce.ballads@gmail.com
    Date: Fri Feb 23 20:19:57 2018 -0500

    Issue 2199/2: add regression tests
    

    commit 622cab6a34e471a83745d945874385b39d8b9458
    Author: Dan Eble nine.fierce.ballads@gmail.com
    Date: Thu Feb 22 23:53:23 2018 -0500

    Issue 2199/1: align outside-staff grobs vertically in staff groups
    
    In any context in which a Vertical_align_engraver creates a
    StaffGrouper, it also sees to it that all outside-staff grobs created
    in the immediate context become y-axis children of the StaffGrouper.
    
    Any such grobs which are later processed by the after-line-breaking
    callback ly:side-position-interface::move_to_extremal_staff are moved
    to the extremal staff of the group, not of the entire system.
    
     
  • Dan Eble

    Dan Eble - 2018-03-04
    • status: Started --> Fixed
     
  • Malte Meyn

    Malte Meyn - 2018-03-28

    If I understand correctly this makes the workaround using a MarkLine context (snippet 1010) unnecessary. IMHO that’s worth an entry in Changes, isn’t it?

     
1 2 > >> (Page 1 of 2)