[Top][All Lists]

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

Re: Staccato alignment on stem side

From: Janek Warchoł
Subject: Re: Staccato alignment on stem side
Date: Tue, 22 May 2012 21:14:51 +0200

Hi David,

On Tue, May 22, 2012 at 8:33 PM, David Nalesnik
<address@hidden> wrote:
> Hmmm...  I'm really not sure.  I tried it with a multi-voice example and no
> problems there...  I guess I would really need to see an example where it's
> breaking down.

Unfortunately, as it's a part of the big project, it has all sorts of
file dependencies and would take a lot of time to untangle it.

> But since staccato is the only articulation that has a value set for
> 'toward-stem-shift, you could just override it to 0 and revert it for when
> you want the staccato-alone orientation.  (I must say that the engraver
> seems like overkill! :)  )

that's what i did.  But general solutions are better :)

On Tue, May 22, 2012 at 8:42 PM, David Kastrup <address@hidden> wrote:
> from the docs:
> script-interface:
> This grob interface is used in the following graphical object(s): *note
> AccidentalSuggestion::, *note DynamicText:: and *note Script::.
> Quite a lot of stuff created without an articulation-type, so you should
> be using eqv? rather than string= ...

I've tried to do as you suggest:

#(define stacc-corrector
 (lambda (ctx)
   (let ((articulations '())
         (staccato '()))
       (acknowledgers ((script-interface engraver grob source-engraver)
         (set! articulations (cons grob articulations))
         (if (eqv? (ly:prob-property (event-cause grob)
'articulation-type) "staccato")
             (set! staccato grob))))
      ((stop-translation-timestep trans)
        (if (and (ly:grob? staccato)
                 (or (> (length articulations) 1)
                     (boolean? (ly:prob-property (event-cause staccato)
            (set! (ly:grob-property staccato 'toward-stem-shift) 0))
        (set! articulations '())
        (set! staccato '()))))))

\relative e'' {
 e-. -| -- e-\parenthesize -. -|--
 e-. -| -- e-\parenthesize -. -|--
 e-\parenthesize -. e-.
 e,-- e-. e-\parenthesize -.

\layout {
 \context {
   \consists #stacc-corrector

and the error is gone, but unfortunately the side-effect is that the
code doesn't work anymore.


reply via email to

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