2022-08-24 13:53:18 +00:00
|
|
|
#lang scribble/manual
|
|
|
|
@(require (for-label racket))
|
|
|
|
|
|
|
|
@title{/n_set Set a node's control value(s)}
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
int - node ID
|
|
|
|
[
|
|
|
|
int or string - a control index or name
|
|
|
|
float - a control value
|
|
|
|
] * N
|
|
|
|
|
|
|
|
Takes a list of pairs of control indices and values and sets the
|
|
|
|
controls to those values. If the node is a group, then it sets the
|
|
|
|
controls of every node in the group.
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(with-sc3
|
|
|
|
(lambda (fd)
|
|
|
|
(letc ((f 440)
|
|
|
|
(a 0.1))
|
|
|
|
(send-synth fd "sin" (out 0 (mul (sin-osc ar f 0) a))))
|
|
|
|
(send fd (s-new0 "sin" 1001 add-to-tail 1))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
|
|
|
|
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
|
|
|
(with-sc3
|
|
|
|
(lambda (fd)
|
|
|
|
(send fd (n-set1 1001 "f" 1280))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
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
|
|
|
(with-sc3
|
|
|
|
(lambda (fd)
|
|
|
|
(send fd (n-set 1001 (list (tuple2 "f" (random 60 900))
|
|
|
|
(tuple2 "a" (random 0.05 0.25)))))))
|
2022-08-28 10:27:01 +00:00
|
|
|
]
|
|
|
|
|
2022-08-24 13:53:18 +00:00
|
|
|
|