Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't annotate Non-rhythmic items for single staff only #5

Open
uliska opened this issue Feb 18, 2019 · 1 comment
Open

Can't annotate Non-rhythmic items for single staff only #5

uliska opened this issue Feb 18, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@uliska
Copy link
Contributor

uliska commented Feb 18, 2019

When non-rhythmic elements (usually living in the staff context?) are highlighted with a span the outcome will be visible in the whole score:

\include "oll-core/package.ily"
\loadModule scholarly.annotate

one = {
  c'1 c'1
}

two = {
  \clef bass
  c1
  \lilypondIssue "It is not possible to mark just *this* staff's barline"
  \bar "|"
  c1
}

\score {
  <<
    \new Staff \one
    \new Staff \two
  >>
}

image

This seems to be related to the fact that these items are determined as 'non-rhythmic here:

https://github.com/openlilylib/stylesheets/blob/master/span/module.ily#L482-L488

and then assigned the music-type 'once which makes them applied through overrideProperty here:

https://github.com/openlilylib/stylesheets/blob/master/span/module.ily#L206-L211

For some reason overrideProperty behaves that way, as opposed to \once \override:

one = {
  c'1
  \once \overrideProperty Staff.BarLine.color #red
  \bar "|"
  c'
  \once \override Staff.BarLine.color = #magenta
  c'
}

two = {
  s1*3
}


\score {
  <<
    \new Staff \one
    \new Staff \two
  >>
}

image

@uliska uliska added the bug Something isn't working label Feb 18, 2019
@uliska uliska self-assigned this Feb 18, 2019
@uliska
Copy link
Contributor Author

uliska commented Feb 19, 2019

\overrideProperty uses an engraver living in the Score context, therefore it applies to that context too.
See http://lilypond.org/doc/v2.19/Documentation/notation/available-music-functions#index-overrideProperty-1
and https://lists.gnu.org/archive/html/lilypond-user/2019-02/msg00374.html

In theory it works to move Output_property_engraver to a lower context but that sounds pretty fragile:

  • It would have to be added to all lower-level contexts
  • sometimes it does make sense to affect the Score context
  • It wouldn't be clear whether it should be the Staff or the Voice level.
\layout {
  \context {
    \Score
    \remove Output_property_engraver
  }
  \context {
    \Staff
    \consists Output_property_engraver
  }
}

does work with the MWE, but it seems not the way to go forward.

Instead I'll have to see if I can avoid using (overrideProperty), maybe by reviewing the whole design of the engraver (what is done at what point in time?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant