[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to evaluate 'articulations entries?
From: |
David Kastrup |
Subject: |
Re: How to evaluate 'articulations entries? |
Date: |
Mon, 29 Aug 2011 18:47:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Marc Hohl <address@hidden> writes:
> Hello list,
>
> I think I have asked a similar question long time ago, but I didn't
> find the answer.
>
> Currently, I am working on a little scheme engraver which should read the
> 'string-number, if given, and should do some calculations, depending on
> other articulations, like 'HarmonicEvent.
>
> This is what I got so far:
> How can I proceed?
\version "2.15.9"
#(define-public (test_engraver context)
(let ((string-pitch-list '()) ;; actually not used
(notes '()))
`((acknowledgers
(note-head-interface .
,(lambda (trans grob source)
(set! notes (cons grob notes)))))
(process-acknowledged
. ,(lambda (trans)
(for-each (lambda (note)
(let* ((event (event-cause note))
(pitch (ly:event-property event 'pitch))
(arts (ly:event-property event 'articulations))
(types (map (lambda (x) (ly:event-property x
'string-number)) arts))
)
(display "The event: ")
(display "ev")
(display " has pitch: ")
(display pitch)
(display " and articulations: ")
(display arts)
(display " and types: ")
(display types)
(display " \n")
)
) ;; end lambda (note)
notes)))
(stop-translation-timestep
. ,(lambda (trans) (set! notes '()))))))
\layout {
\context {
\Voice
\consists \test_engraver
}
}
test = \relative c' {
c4 d\2 e\2 f g\4 a\4 b\4 < g\4\harmonic >
c4\3 < d\3 g\2> c\3 r
}
%\displayMusic { \test }
\new Voice { \test }
--
David Kastrup