On 10/02/2008, Gilles THIBAULT wrote:
> For the begining of the first line, you only have to add
>     \override Score.RehearsalMark #'break-align-symbols =
> #'(time-signature )

Thanks for the tip, Gilles. However, that was the first thing I tried
because I wanted to align the rhythm mark at the key signature. It
doesn't quite work even if I align the mark at the time signature as
you suggested. It does drop the first mark on the same level as the
other ones but there's still a considerable gap between the mark and
the staff. :-(

It also seems that aligning the mark with different things is not an
exact science. However, moving the mark in horizontally usually causes
less problems with the layout.

To your annoyance I've included my test code and the resulting image. ;-)

-Risto

%%%%%%
\version "2.11.38"

\paper { ragged-right = ##t }

rhyMarkDottedEighths =
{
    \override Score.SpacingSpanner #'common-shortest-duration =
        #(ly:make-moment 3 16) % even
    { b'8. b16 }
}

rhyMarkSlurredTriplets =
{
    \override Score.SpacingSpanner #'common-shortest-duration =
        #(ly:make-moment 1 8) % even
    \times 2/3 { b'8 ~ b8 b8 }
}

rhythmMarkStaffReduce = #-4
rhythmMarkLabelFontSize = #-3

rhythmMarkAlign = #(define-music-function (parser location musicI
musicII align)
    (ly:music? ly:music? pair?)
#{
    \once \override Score.RehearsalMark #'self-alignment-X = #left
    \once \override Score.RehearsalMark #'extra-spacing-width =
        #'(+inf.0 . -inf.0)
    \once \override Score.RehearsalMark #'break-align-symbols = $align
    \once \override Score.RehearsalMark #'padding = #0
    \mark \markup
    {
        \line \vcenter
        {

            \combine                     % 1st column in line
            \hspace #0
            \transparent \italic \fontsize #rhythmMarkLabelFontSize f
            % This fakes a uniform baseline (ie. create common anchor
for vcenter)
            \score
            {                     % 2nd column in line
                \new Staff \with
                {
                    fontSize = #rhythmMarkStaffReduce
                    \override StaffSymbol #'staff-space =
                        #(magstep rhythmMarkStaffReduce)
                    \override StaffSymbol #'line-count = #0
                }
                \relative { \stemUp $musicI }
                \layout {
                    ragged-right= ##t
                    indent = 0
                    \context
                    {
                        \Staff
                        \remove "Clef_engraver"
                        \remove "Time_signature_engraver"
                    }
                } % layout
            } % 1st Score end
            \hspace #-0.1                % 3rd column in line
                                       % 4th column in line
            \italic \fontsize #rhythmMarkStaffReduce "="
            \score                % 5th column in line
            {
                \new Staff \with
                {
                    fontSize = #rhythmMarkStaffReduce
                    \override StaffSymbol #'staff-space =
                        #(magstep rhythmMarkStaffReduce)
                    \override StaffSymbol #'line-count = #0
                }
                \relative { \stemUp $musicII }
                \layout
                {
                    ragged-right= ##t
                    indent = 0
                    \context
                    {
                        \Staff
                        \remove "Clef_engraver"
                        \remove "Time_signature_engraver"
                    }
                } % layout end
            } % 2nd Score end
        } % line end
    } % markup end
#})

\relative c''
{
    \key g \major \time 4/4 \clef treble
    \rhythmMarkAlign \rhyMarkDottedEighths \rhyMarkSlurredTriplets
#'(key-signature)
    c1 c
}
%%%%%%

<<attachment: swing_rhythm_2_11_38.png>>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to