rsc3/doc/help/unsorted/rand-id.help.scrbl

56 lines
1.1 KiB
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{rand-id}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
graphs (r & s) to generate noise in the context of a given RNG and to reset a specified RNG
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3
(lambda (fd)
(send-synth
fd "r"
(letc ((bus 0) (id 1))
(mrg2 (rand-id id)
(out bus (add (mul (white-noise) 0.05) (dust2 70))))))
(send-synth
fd "s"
(letc ((seed 1910) (id 1))
(mrg2 (rand-id id)
(rand-seed (impulse (mul-add (f-sin-osc 0.2 0) 10 11) 0) seed))))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
start synths on left and right channel with a different randgen ids
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3
(lambda (fd)
(send fd (s-new2 "r" 1001 1 1 "bus" 0 "id" 1))
(send fd (s-new2 "r" 1002 1 1 "bus" 1 "id" 2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
reset the seed of randgen 1
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3 (lambda (fd) (send fd (s-new1 "s" 1003 1 1 "id" 1))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
change the target RNG with ID 2, ie. effect right channel
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3 (lambda (fd) (send fd (n-set1 1003 "id" 2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
free nodes
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3
(lambda (fd)
(send fd (n-free1 1001))
(send fd (n-free1 1002))
(send fd (n-free1 1003))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00