Le 23/01/2021 à 02:59, Brian Bartling a écrit :
Thank you, Jean. That does fix this example. I still suspect the root cause of my problem lies in how the lengths and positions of stems that are attached to beams are calculated. I'm guessing that your idea of removing the Stem_engraver and the Note_spacing_engraver is somehow connected to this comment inside Note_spacing::get_spacing:

      /*
        Ugh. If Stem is switched off, we don't know what the
        first note head will be.
      */

The only problem is, there are still spots where I detect this problem where things outside-staff are being pushed away, even when I remove the Stem_engraver and the Beam_engraver. After experimenting a bit more, I found that I was able to fix my problem completely with these two commands:

   \override Beam.quantized-positions = #'(0 . 0)   (I noticed this actually takes an interval instead of a boolean)
   \override Stem.length = #0

The default definition of Stem.length is ly:stem::calc-length, and this function throws an error if you change the definition of Beam.quantized-positions. Again, though, it's surprising that all of these functions are still running even though I shut off stems and beams. I'm not really sure why.

Thanks again!
Brian


Hi,

Harm's proposed solution seems working, I just
wanted to add (somewhat late on the party) that
contrary to a common belief, \omit does not prevent
objects from taking up any space in all cases.
All it does is this (ly/music-functions-init.ly):

omit =
#(define-music-function (item) (symbol-list-or-music?)
   [Skipping docstring...]
   (propertyTweak 'stencil #f item))

That is, it suppresses the grob's stencil. That is
in most cases the source for the calculations of its
extent, but not always. Slur and StaffSymbol are two
examples. Consider (output attached):

\version "2.23.0"

{
  g''1( g''1)^"a"
  \once \omit Slur
  g''1( g''1)^"a"
  \once \override Slur.before-line-breaking = #ly:grob-suicide!
  g''1( g''1)^"a"
}

\new Staff { c'1^\p }
\new Staff \with { \omit StaffSymbol } { c'1^\p }
\new Staff \with { \remove Staff_symbol_engraver } { c'1^\p }

Also, engravers create various grob types used for
spacing (like NoteSpacingand NoteCollision) that this
does not prevent from creation. The proper wayto
shut off something in general is to remove an engraver.
That is not sopopular, probably because there is
currently no way to pause an engraverin the course
of the music.

Best regards,
Jean

Reply via email to