Dear Mats,
thanks! It works fine and is an excellent tool for my work!

2008/4/22 Mats Bengtsson <[EMAIL PROTECTED]>:

> It seems that the articulation event has to be added after the note event
> in order not to confuse
> \relative. The following modification of Reinhold's code seems to work
> better.
>
> % To modify a sequence of notes, it's easiest to use a filter:
> #(define (addStaccatoFilterFunction event)
>  (let ( (eventname (ly:music-property  event 'name)) )
>   (if (eq? eventname 'EventChord)
>     (let ( (elements (ly:music-property event 'elements)) )
>       ; don't add staccato to rests!
>       (if (not (eq? (ly:music-property (car elements) 'name) 'RestEvent))
>         (set! (ly:music-property event 'elements)
>           (append elements (list (make-music 'ArticulationEvent
> 'articulation-type "staccato"))
>           ))))))
> )
>
> addStaccato = #(define-music-function (parser location music) (ly:music?)
>  (music-filter addStaccatoFilterFunction music)
> )
>
>
> For some reason it also works if you use Reinhold's code with
> \addStaccato { \relative { ... }}
> instead of
> \relative { \addStaccato {...}}
>
>   /Mats
>
> Stefan Thomas wrote:
>
> > Dear Reinhold,
> > many thanks for Your very usefull plugin. It works fine!
> > But there is one thing in the below quoted example I don't understand :
> > Why is the second g in the first measure an octave lower?
> >  I'm sure, I don't see something, which is  quite obvious, but I have no
> > idea.
> >
> > \version "2.11.43"
> >
> > \relative { \addStaccato { c4 c g' g a a g4 r
> > f8 r f8 r e8 r e r d4 r c r } }
> > ------------------------------------------------------------------------
> >
> >
> >
>
>
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to