|
From: | Gilles THIBAULT |
Subject: | Re: add tenuto |
Date: | Mon, 2 Jun 2008 00:00:56 +0200 |
Yes but perhaps music-filter is not convenient for
that because it gives you the differents events in a order : sub-elements,
elements.
here is a version which seems to work with
ties.
(i do not test it a lot)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define tieEvent? #f) #(define (add-Tenuto music) (let ( (eventname (ly:music-property music 'name)) (elts (ly:music-property music 'elements)) (elt (ly:music-property music 'element)) ) (cond ((pair? elts) (begin (if (and (eq? eventname 'EventChord) (eq? (ly:music-property (car elts) 'name) 'NoteEvent) (not tieEvent?) ) (set! (ly:music-property music 'elements) (append elts (list (make-music 'ArticulationEvent 'articulation-type "tenuto")))) (set! tieEvent? #f) ) (map add-Tenuto elts) ) ) ((ly:music? elt) (add-Tenuto elt)) ((eq? eventname 'TieEvent) (set! tieEvent? #t)) ) music )) addTenuto = #(define-music-function (parser location music)
(ly:music?)
(set! tieEvent? #f) (add-Tenuto music) ) \new Staff \relative { \addTenuto { c d e f~ f e d c } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Gilles
|
[Prev in Thread] | Current Thread | [Next in Thread] |