openlilylib / analysis

Graphical highlighting of musical analysis with GNU LilyPond
GNU General Public License v3.0
5 stars 3 forks source link

\genericFrame doesn't seem to work in Drum Staff #9

Open pedro-psb opened 5 years ago

pedro-psb commented 5 years ago

Hello! I was testing the package and it seems the Border tool doesn't work with drummode. This is the code I tried:

\version "2.19.82"

\include "oll-core/package.ily"
\loadPackage \with {
  modules = frames
}
analysis

% Works in Normal Staff
\score {
  \new Staff{
    \relative c' {
      \genericFrame {
        c8 e g c g e e4
      }
    }
  }
}

% Does not work in Drum Staff
\score {
  \new DrumStaff{
    \drummode {
      \genericFrame {
        sn16 8 toml16~ 16 16 8  
        sn 8 8 toml8 8
      }
    }
  }
}
KlausBlum commented 5 years ago

Hi pedro-psb,

\genericFrame relies on the Horizontal_bracket_engraver which is not part of the Voice or DrumVoice context by default, so it has to be added manually. For the Voice context, this is done in the "frame" module, but not for DrumVoice. (Maybe we should add it...)

So the solution should simply be to add this at the end of your code:

\layout { \context { \DrumVoice \consists "Horizontal_bracket_engraver" } }

Does it work now?

Cheers, Klaus

KlausBlum commented 5 years ago

@uliska: I don't think that this would cause any problems. Can we add it to module.ily ?

pedro-psb commented 5 years ago

Yes, it works! Sounds a good ideia to add it to the module default. Thanks

uliska commented 5 years ago

I haven't looked into it in detail, but generally I don't see any issue with it. However, then it would probably be more consistent to add it to all voice-level contexts, for which \consistToContexts from oll-core.util.consist-to-contexts is useful.