rsc3/doc/help/unsorted/linen.scrbl

24 lines
604 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
2022-08-28 10:27:01 +00:00
@title{linen ; open gate for random interval}
2022-08-24 13:53:18 +00:00
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((r (s:rand 0.05 0.4))
(u (letc ((gate 0))
(let ((e (linen gate 0.1 0.2 0.1 do-nothing)))
(out 0 (mul (sin-osc 440 0) e)))))
(g (encode-graphdef (synthdef "linen" u))))
(with-sc3
(lambda (fd)
(async fd (d-recv g))
(send fd (s-new0 "linen" 1001 1 1))
(send fd (bundle (utcr) (list (n-set1 1001 "gate" 1))))
(send fd (bundle (+ (utcr) r) (list (n-set1 1001 "gate" 0))))
(pauseThread (* r 4))
(send fd (n-free1 1001)))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00