lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RehearsalMark hack


From: Mats Bengtsson
Subject: Re: RehearsalMark hack
Date: Wed, 23 Nov 2005 12:32:20 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

For the horizontal position, why did you not directly redefine the
function that handles the placement av rehearsal marks after line
breaks? The default function has the following definition (from
scm/output-lib.scm):

(define-public (shift-right-at-line-begin g)
 "Shift an item to the right, but only at the start of the line."
 (if (and (ly:item? g)  (equal? (ly:item-break-dir g) RIGHT))
     (ly:grob-translate-axis! g 3.5 X)))

and you can specify your own function using:
\override Score.RehearsalMark #'after-line-breaking-callback = #my-shift-right-at-line-begin

  /Mats

Simon Bailey wrote:

after delving deeply into the lilypond backend documentation (especially the scheme functions list) i managed to get my hack working in three lines:

#----- SNIP LILY CODE HERE -----
#(define (mark-callback grob)
  (if (= (ly:item-break-dir grob) 1)
      (ly:grob-set-property! grob 'extra-offset '(-2.8 . 1))))

\book {
\score {
  \relative c'' {
    \key des \major
    \override Score.RehearsalMark #'before-line-breaking = #mark-callback
    \repeat unfold 4 c2 \mark \default
    \break
    c2 c \mark \default
    c2 c
  }
}\score {
  \relative c'' {
    \key des \major
    \repeat unfold 4 c2 \mark \default
    \break
    c2 c \mark \default
    c2 c
  }
}
}
#----- END LILY CODE HERE ------

gives this output: http://binabik.boldlygoingnowhere.org/r-marks.pdf

the first score block is the one with the tweak applied, the second one without. is anyone interested in this tweak? if so, i'll add it to lsr later today

regards,
sb.
--
Do not meddle in the affairs of trombonists, for they are subtle and quick to anger.

------------------------------------------------------------------------

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

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]