OK, sorry ... I missed the point, you want pattern generation ;)
--snip--
#(use-modules (srfi srfi-60))
#(define-public pattern
(define-music-function (parser location n pitch dur)
(integer? ly:pitch? ly:duration?)
(let ((l (list)))
(define (pat i)
(if (< i n)
(append (pat (* 2 i))
(list
(if (= (bitwise-and i n) 0)
(make-music 'RestEvent 'duration dur)
(make-music 'NoteEvent 'duration dur 'pitch pitch))))
(list)))
(make-music 'SequentialMusic
'elements (pat 1))
)))
\new Staff {
\time 7/2
\pattern #73 c'' 2
}
--snip--
This will create a series of note- and restevents based on the binary
pattern of the given integer.
I'll be back next week ;)
HTH
Best, Jan-Peter
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user