[Top][All Lists]

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

RehearsalMark breaks system's ref-point? (was: The ultimate slur shaping

From: Janek Warchoł
Subject: RehearsalMark breaks system's ref-point? (was: The ultimate slur shaping function)
Date: Mon, 25 Nov 2013 23:22:19 +0100

Hi all,

it seems that when there is a RehearsalMark, the reference point of a
system changes and the relative extents are calculated in an
unreasonable way.

Here's the background - i got a bug report about \shapeII:

2013/11/25 Ed Gordijn <address@hidden>:
> Hi Janek,
> This [\shapeII] is a very nice function you have made. But I get unexpected 
> results
> when I use a rehearsal mark.
> Please see the included snippet.

I did some tests and here's what i got.  I have a function (it's very
lame, i know) that does some bogus override of a slur's "positions"
property, and in the meantime it prints the relative Y-extent of
slur's left NoteColumn:

\version "2.17.96"

foo =
#(define-music-function (parser location item)

   (define (quux grob)
     (let* ((orig (ly:grob-original grob))
            (bound (ly:spanner-bound grob LEFT))
            (ref (ly:grob-system bound)))
       ;; print the extent of the left NoteColumn relative to the system:
       (display (ly:grob-extent bound ref Y))
       ;; bogus value:
       (cons 3 3)))

   #{ \tweak positions #quux #item #})

\relative c'' {
  \foo Slur
  d1( c')

In this case it outputs (0.449994 . 1.550006) - as expected: the
extent of the d note, measured relative to middle staffline, is
roughly (0.45 . 1.55) staffspaces.

But when i add a rehearsal mark:

\relative c'' {
  \foo Slur
  d1( c')
  \mark \default

the output is (-4.100012 . -3.0), as if the point against which the
extent is measured was on top of the higher note (instead of middle
staff line).  Indeed, if i change the higher note to e

\relative c'' {
  \foo Slur
  d1( e')
  \mark \default

the extent is further "lowered" by 1 ss: (-5.100012 . -4.0)

This behaviour seems extremely weird to me.  Do you know anything about this?


Attachment: ShapeSlur.pdf
Description: Adobe PDF document

Attachment: ShapeSlur.ly
Description: Text Data

reply via email to

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