#!r6rs (library (rsc3 graphdef rate-of) (export rate-of) (import (rnrs) (only (rsc3 graphdef control) control*? control*-rate) (only (rsc3 graphdef mce) mce? mce-channels) (only (rsc3 graphdef mrg) mrg?) (only (rsc3 graphdef proxy) proxy? proxy-ugen) (only (rsc3 graphdef rate) ir rate-select) (only (rsc3 graphdef ugen) ugen? ugen-rate)) (define (rate-of o) (cond ((number? o) ir) ((control*? o) (control*-rate o)) ((ugen? o) (ugen-rate o)) ((proxy? o) (rate-of (proxy-ugen o))) ((mce? o) (rate-select (map rate-of (mce-channels o)))) ((mrg? o) (error 'rate-of "mrg?" o)) (else (error 'rate-of "illegal value" o)))) )