Wenn man von dem Tippfehler absieht (warp !!), so ist der Knackpunkt, daß event-chord-wrap! keine music-function ist, sondern eine einfache procedure.
#(write-me "procedure? " (procedure? event-chord-wrap!))
#(write-me "music-function? " (ly:music-function? event-chord-wrap!))
führt zu
procedure? #t
music-function? #f
Der Versuch sie neu zu benennen ändert daran ja nichts.
Beispiel:
#(define (my-music music) music)
{ #(my-music #{ c1 d #}) }
{ \my-music { c1 d } }
Der Aufruf mittels LilyPond-syntax scheitert, es klappt nur in scheme.
Um weiter zu kommen brauchst Du eine music-function. Die gibts schon: `eventChords'
\version "2.18."
#(define (note->chord note)
(make-music 'EventChord 'elements
(cons
(make-music 'NoteEvent
'pitch (ly:music-property note 'pitch)
'duration (ly:music-property note 'duration))
(ly:music-property note 'articulations))))
note_chord =
#(define-music-function (parser location music)
(ly:music?)
(set! (ly:music-property music 'elements)
(map-in-order
(lambda (m)
(cond ((eq? (ly:music-property m 'name) 'EventChord)
m)
((eq? (ly:music-property m 'name) 'NoteEvent)
(note->chord m))
(else m)))
(ly:music-property music 'elements)
)
)
music)
\score {
<<
\new Voice
%\displayMusic
{ \note_chord { a'^· \note_chord { b'^·· }}}
\new Voice
%\displayMusic
{ \eventChords { a'^· \eventChords { b'^·· }}}
\new Voice
%\displayMusic
\eventChords { a'^· b'^·· }
>>
}
Dann funktionierts.
Falls Du eventChords neu benennen willst, so geht das so
#(define event-chord-wrap eventChords)
oder so
event-chord-wrap = #eventChords
in 2.19. auch
event-chord-wrap = \eventChords \etc
Ich nehme an Du weißt, daß Du nicht jedes Element mittels event-chord-wrap angehen mußt ...
Gruß,
Harm