I am currently learning Scheme to master lilypond even better.... but I miss some clear docs about music-map and define-music-function.
I try to write a function that replaces pitches in a repetitive pattern (e.g. : c8 d16 c d8 c d16 c d8 c d ) with other pitches. so that I can say: myPattern = {c8 d16 c d8 c d16 c d8 c d } %(a global variable) pat = #(define-music-function (parser location p1 p2) (ly:music? ly:music?) etc. and then have \pat aes des' return: aes8 des'16 aes des8 etc. The function could call music-map to process the pattern, note by note, replacing the pitches with the pitches in p1 and p2, but I'm not sure how I can give those pitches as well as arguments to the function called by music-map. Should I nest a (define) to create a function that already encapsulates the two piches or a lambda expression? I'm not quite sure and can't get it to work yet :-) I could use the example in Bach's WK1 prelude, but that's using \applyMusic and I understood that define-music-function is the preferred way of creating functions to manipulate music :-) Met vriendelijke groet, Wilbert Berendsen -- http://www.wilbertberendsen.nl/ "You must be the change you wish to see in the world." -- Mahatma Gandi _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user