Hi Max, 2008/12/2 Maximilian Albert <[EMAIL PROTECTED]>:
> 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 _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel