Vertical alignment of RehearsalMarks

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Vertical alignment of RehearsalMarks

Peter Crighton
Hello all,

how would I go about trying to have rehearsal marks all be vertically aligned the exact same way, regardless of whether there are near objects that take up space?

\version "2.20.0"

\relative a' {
  \once \override Score.RehearsalMark.extra-offset = #'(0 . -3.9)
  \mark \default
  b1 \break
  \once \override Score.RehearsalMark.extra-offset = #'(0 . -5.8)
  \mark \default
  b1
}

\layout {
  \context {
    \Score
    \override RehearsalMark.break-align-symbols = #'(left-edge)
  }
}


I could do this with offsets like above, but I need a common baseline for all marks, so that I don’t have to manually adjust every single one.
Is it possible to make LilyPond think they don’t take up any space or something, so they don’t get affected in their placement by other objects like bar numbers in this example?
My end goal is to have rehearsal marks appear in front of a staff, vertically centered and horizontally aligned with each other (which they already do with break-align-symbols set to left-edge – I’ll shift them to the left a bit in the end).

Thanks,
Peter

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de
Reply | Threaded
Open this post in threaded view
|

Re: Vertical alignment of RehearsalMarks

Dominic
Hi Peter,

I would suggest the following series of overrides to the
/Score.RehearsalMark/ object:

/\override RehearsalMark.outside-staff-priority = ##f
\override RehearsalMark.Y-offset = #0
\override RehearsalMark.extra-offset = #'(-2 . -0.5)/

This will effectively disable collision avoidance, set the marks on the
middle staff line, and then perform a final aesthetic adjustment as you
desire.

Hope this helps!

Dom





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

Reply | Threaded
Open this post in threaded view
|

Re: Vertical alignment of RehearsalMarks

Peter Crighton
Thanks, Dominic, that helped for the given example, but I see that I need to give a more complete example of the chord chart I am working on.
I also narrowed down the problem: the distance between Staff & ChordNames is not the same in the two lines, but I need it to be for this to work.

Luckily, between writing the first paragraph and this one, I managed to do just that. So below is the complete solution, and this problem is solved (I hope – until I find further problems):

\version "2.20.0"

<<
  \new Staff {
  1*4
  1*4
  }

  \new ChordNames \chordmode {
    \mark #1
    a1 a a a \break
    \mark #1
    \repeat volta 2 {
      a1 a a a
    }
  }
>>

\layout {
  \context {
    \ChordNames
    \consists "Bar_engraver"
    \override BarLine.bar-extent = #'(-2 . 2)

    \consists "Time_signature_engraver"
    \numericTimeSignature

    \override ChordName.Y-extent = ##f
    \override ChordName.Y-offset = -1
    \override ChordName.X-offset = 0.5

    \override VerticalAxisGroup.staff-affinity = ##f
  }

  \context {
    \Staff
    \hide BarLine
    \override Clef.stencil = #point-stencil
    \override StaffSymbol.line-count = 0
    \remove "Time_signature_engraver"

    \override NoteColumn.X-offset = 0.5
    \override VerticalAxisGroup.staff-staff-spacing.basic-distance = 3
  }

  \context {
    \Voice
    \consists "Pitch_squash_engraver"
    \improvisationOn
    \stemUp
    fontSize = -4
  }

  \context {
    \Score
    \remove "Bar_number_engraver"

    proportionalNotationDuration = #(ly:make-moment 1/8)
    \override SpacingSpanner.uniform-stretching = ##t
    \override SpacingSpanner.strict-note-spacing = ##t

    \override BarLine.space-alist.first-note = #'(fixed-space . 0)
    \override Clef.space-alist.first-note = #'(fixed-space . 0)
    \override Clef.space-alist.staff-bar = #'(extra-space . -2)
    \override Clef.space-alist.time-signature = #'(extra-space . -2)
    \override LeftEdge.space-alist.clef = #'(extra-space . 0)
    \override LeftEdge.space-alist.first-note = #'(fixed-space . 0)

    \override RehearsalMark.break-align-symbols = #'(left-edge)
    \override RehearsalMark.outside-staff-priority = ##f
    \override RehearsalMark.Y-offset = 0
    \override RehearsalMark.extra-offset = #'(-4 . -4)
  }
}

\paper {
  indent = 0
  left-margin = 2 \cm
}


--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de


On Wed, 18 Mar 2020 at 04:54, Dominic <[hidden email]> wrote:
Hi Peter,

I would suggest the following series of overrides to the
/Score.RehearsalMark/ object:

/\override RehearsalMark.outside-staff-priority = ##f
\override RehearsalMark.Y-offset = #0
\override RehearsalMark.extra-offset = #'(-2 . -0.5)/

This will effectively disable collision avoidance, set the marks on the
middle staff line, and then perform a final aesthetic adjustment as you
desire.

Hope this helps!

Dom





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html