rsc3/doc/examples/ugen/information/buf-sample-rate.help.scm

14 lines
344 B
Scheme
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
;; (buf-sample-rate rate bufnum)
;; Buffer sample rate.
(with-sc3
(lambda (fd)
(async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))
;; Compare a sine tone derived from sample rate of a buffer with a
;; 440Hz tone.
(let ((freq (mce2 (mul (buf-sample-rate ir 0) 0.01) 440)))
(audition (out 0 (mul (sin-osc ar freq 0) 0.1))))