#!r6rs (library (rsc3 supercollider mix) (export mix mce/fill mix/fill) (import (rnrs) (only (rsc3 collection list) list-tabulate foldl1) (only (rsc3 graphdef mce) make-mce mce-channels mce?) (only (rsc3 ugen operator) Add)) ;; Mix the UGen at `inputs'. This is an idiom over the binary math ;; operator 'Add'. (define (mix u) (cond ((mce? u) (foldl1 Add (mce-channels u))) (else u))) ;; Use the unary procedure `f' to build an mce value of `n' places. (define (mce/fill n f) (make-mce (list-tabulate n f))) ;; mix . mce/fill (define (mix/fill n f) (mix (mce/fill n f))) )