Menu

#4983 \crossStaff only hides default-style flags

Verified
2017-01-11
2016-10-14
No

As reported by Gilberto Agostinho, the default behaviour of \crossStaff to automatically hide flags doesn’t work for styles other than the default.
https://lists.gnu.org/archive/html/bug-lilypond/2016-10/msg00028.html

Discussion

  • Thomas Morley

    Thomas Morley - 2016-10-22

    I had a look into it.

    First, please, please!! use plain text while providing code.
    Following the link above I see no code at all, neither in Gilbertos initial mail to the list.

    http://lilypond.1069038.n5.nabble.com/cross-staff-chords-do-not-automatically-hide-non-default-flags-td195328.html
    worked, yes, but it's tedious to search which archive displays what...

    On topic:
    \crossStaff reverts the style property, but not a stencil set by the user. Those stencils, predefined in flag-styles.scm mostly don't read the style-property at all. As opposed to the stencil defined in C++, iiuc, and the default-flag defined in the same .scm-file

    So what's the proper fix?
    (1)
    One could simply temporary set the stencil to #no-flag in crossStaff.
    (2)
    Or one could return an empty stencil for every scheme-defined stencil, if style is 'no-flag.
    That would mean to change normal-flag, mensural-flag, flat-flag, old-straight-flag and modern-straight-flag as defined in flag-styles.scm.
    The there defined default-flag looks at this condition already.
    Ok, a completely independent user defined flag-stencil will likely not look at the style-property, but we could make the procedures predefined in flag-styles.scm respecting it. A complete new code is in the responsibility of the programmer anyway.

    So, I lean to (2), looks cleaner to me to give style 'no-flag more or less the same weight as stencil #no-flag.
    But maybe I overlook something.

    Opinions?

     
    • David Kastrup

      David Kastrup - 2017-01-01

      (2) sounds good and consistent to me.

       
  • Thomas Morley

    Thomas Morley - 2017-01-02

    Issue 4983 Let crossStaff hide non-default-style flags

    Return empty-stencil for all flags using the code provided in
    flag-styles.scm, if the style property is 'no-flag as set by
    the crossStaff-function.

    http://codereview.appspot.com/315330043

     
  • Thomas Morley

    Thomas Morley - 2017-01-02
    • status: Accepted --> Started
    • assigned_to: Thomas Morley
    • Needs: -->
    • Type: --> Defect
     
  • Thomas Morley

    Thomas Morley - 2017-01-02

    Here a generic test-code:

    \version "2.19.52"
    
    \layout {
      \context {
        \PianoStaff
        \consists #Span_stem_engraver
      }
    }
    
    A = {
      <b d'>4 r d'16\> e'8. g8 r\!
      e'8 f' g'4 e'2
    }
    
    B = {
      \clef bass
      \voiceOne
      \autoBeamOff
      \crossStaff { <e g>4 e, g16 a8. c8 } 
      \once \override NoteHead.color = #cyan 
      d
      \autoBeamOn
      g8 f g4 c2
    }
    
    mus = 
    <<
      \new Staff \A
      \new Staff \with { \override Flag.color = #red } \B
    >>
    
    \markup \wordwrap { 
        The cyan-colored note-head should have the specified flag-style, beamed
        cross-staff stems should have no flag at all.
    }
    
    \score {
      <<
        \new PianoStaff \with { instrumentName = "default"} \mus
        #@(map
            (lambda (flag)
              #{
                \new PianoStaff 
                \with { 
                    \override Flag.stencil = #flag 
                    instrumentName = #(format #f "~a" (procedure-name flag))
                } 
                \mus
              #})
            (list 
              modern-straight-flag
              old-straight-flag
              flat-flag
              mensural-flag
              normal-flag
              default-flag))
      >>
      \layout { indent = 40 }
    }
    

    While working on this I noticed wrong behaviour of graces:

    Replace the above "B = ..." with

    B = {
      \clef bass
      \voiceOne
      \autoBeamOff
      \crossStaff { <e g>4 e, g16 a8. \grace { c8 } c8 } 
      \once \override NoteHead.color = #cyan 
      d
      \autoBeamOn
      g8 f g4 c2
    }
    

    to see no Flag for the grace-note.

    Worth another ticket.

     
    • Simon Albrecht

      Simon Albrecht - 2017-01-02

      Issue 5026: \crossStaff mangles all grace note flags.

       
  • Anonymous

    Anonymous - 2017-01-02
    • Patch: new --> needs_work
     
  • Anonymous

    Anonymous - 2017-01-02

    Fails make check on the 'flags-default.ly' regression test:

    ...
    Parsing...
    Renaming input to: `/home/jlowe/lilypond-git/input/regression/flags-default.ly'
    /home/jlowe/lilypond-git/input/regression/flags-default.ly:73:29: error: GUILE s
    ignaled an error for the expression beginning here
      \override Flag.stencil = #
                                no-flag
    Interpreting music...
    Preprocessing graphical objects...
    Interpreting music...
    Preprocessing graphical objects...
    Interpreting music...
    warning: type check for `stencil' failed; value `#<unspecified>' must be of type
     `stencil'
    Preprocessing graphical objects...
    Calculating line breaks... 
    Drawing systems... 
    Calculating line breaks... 
    Drawing systems... 
    Calculating line breaks... 
    Drawing systems... 
    Writing header field `texidoc' to `./2d/lily-1e423b1e.texidoc'...
    Writing ./2d/lily-1e423b1e-1.signature
    Writing ./2d/lily-1e423b1e-2.signature
    Writing ./2d/lily-1e423b1e-3.signature
    Layout output to `./2d/lily-1e423b1e.eps'...
    Layout output to `./2d/lily-1e423b1e-1.eps'...
    Layout output to `./2d/lily-1e423b1e-2.eps'...
    Layout output to `./2d/lily-1e423b1e-3.eps'...
    Writing ./2d/lily-1e423b1e-systems.texi...
    Writing ./2d/lily-1e423b1e-systems.tex...
    Writing ./2d/lily-1e423b1e-systems.count...
    Writing timing to 2d/lily-1e423b1e.profile...
    Unbound variable: no-flag
    
     
  • Thomas Morley

    Thomas Morley - 2017-01-03
     
  • Anonymous

    Anonymous - 2017-01-03
    • Needs: -->
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2017-01-03

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2017-01-05
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2017-01-05

    Patch on countdown for Jan 8th

     
  • Anonymous

    Anonymous - 2017-01-08
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2017-01-08

    Patch counted down - please push.

     
  • Thomas Morley

    Thomas Morley - 2017-01-08
    • labels: --> Fixed_2_19_55
    • status: Started --> Fixed
    • Patch: push -->
    • Type: Enhancement -->
     
  • Thomas Morley

    Thomas Morley - 2017-01-08

    pushed to staging as:

    commit 27f9ebef47a058db8befc5cb05bd63375144fc01
    Author: Thomas Morley thomasmorley65@gmail.com
    Date: Mon Jan 2 14:12:42 2017 +0000

    Issue 4983 Let crossStaff hide non-default-style flags
    
    Return empty-stencil for all flags using the code provided in
    flag-styles.scm, if the style property is 'no-flag as set by
    the crossStaff-function.
    
     
  • Graham Percival

    Graham Percival - 2017-01-11
    • status: Fixed --> Verified