lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix for bug #218 (center staccato over stem instead of noteh


From: Neil Puttock
Subject: Re: [PATCH] Fix for bug #218 (center staccato over stem instead of notehead)
Date: Tue, 2 Dec 2008 23:15:49 +0000

Hi Max,

2008/12/2 Maximilian Albert <address@hidden>:

> OK, so I only need to adapt script-interface::calc-x-offset so that if
> the stem and articulation have the same direction it calculates a
> different horizontal shift, correct? Attached is a patch which
> implements this (it took me a bit to figure out which scheme functions
> yield the needed properties, but I hope I got it right - comments are
> again welcome).

This works well for articulations attached to ordinary notes, but
breaks when they're attached to skips (e.g. when expressive marks are
kept in a separate voice) or ancient notes, since no stem grob exists
for these objects.  While ancient articulations can be filtered out
easily (see below), I'm not sure how you can access the stem from the
note that a skip represents.

> Just today I saw an example where a marcato over an up-stem half note
> was _not_ shifted and I liked it better. So I'm wondering if for now
> we should only implement the shifting for staccato marks until we have
> better rules for other articulation types (e.g., should the shifting
> depend on whether the notes are beamed or not, should it only apply to
> certain note values?).

There are a few other scripts where this shift is inappropriate (e.g. trills).

> I haven't included this in the patch because I
> couldn't find a scheme equivalent for testing the 'articulation-type
> property which Neil mentioned. Any hints?

>From the grob property 'cause, you can get the event type which is
responsible for creating the script (ArticulationEvent); from that,
you can extract 'articulation-type using ly:event-property,

(artic (ly:event-property (ly:grob-property grob 'cause) 'articulation-type))

though I think it would be better to have a grob property to determine
whether scripts on stems are centred (perhaps 'center-on-stem?).  This
can then be added to the script defaults in script.scm for any script
which should be centred (thus solving the issue with ancient
articulations, since they are always centred on the notehead).
Naturally, there's the added benefit for users that the positioning of
individual scripts can be controlled using \override and \tweak.

Regards,
Neil




reply via email to

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