\version "2.22.0" \include "gen-music.ily" % each invocation of scr generates a new score of different length pcn = 0 scr = #(define-scheme-function () () (set! pcn (1+ pcn)) #{ \score { \header { piece = \markup{ "Piece " #(number->string pcn) } } { \gen-music \bar "|."} } #} ) % only way I know to repeat so far \scr \scr \scr \scr \scr \scr \scr \scr \scr \scr % 10 %\scr \scr \scr \scr \scr \scr \scr \scr \scr \scr % 20 %#(scr) % runs but generates no output %$(scr) % works for one invocation % guessing at recursive repeat %#(define scors (lambda (n) (if (= n 1) (scr) ((scr) (scors (- n 1) ))))) %#(scors 2) % guessing at for-each repeat %#(for-each (lambda (ignore) (scr)) '(1 2 3 4 5)) % never does "Interpreting music..." (no output) %#(begin (scr) (scr) (scr)) % does "Interpreting music...[8]" but only outputs "Piece 3" %$(begin (scr) (scr) (scr)) %#(define mine (list (scr) (scr) (scr))) %#@mine % error: bad expression type %#mine % (no output) %$(make-sequential-music mine) % Wrong type argument in position 1 (expecting Prob): # %$mine % error: bad expression type %$(mine) % GUILE signaled an error for the expression beginning here %$(list mine) % error: bad expression type