On this page:
rsc3:   racket/  scheme/  supercollider
8.6

rsc3: racket/scheme/supercollider

    1 rsc3: server commands

      1.1 /g_deepFree Free all synths in this group and all its sub-groups.

      1.2 /c_setn Set ranges of bus value(s)

      1.3 /sync Notify when async commands have completed.

      1.4 /s_getn Get ranges of control value(s)

      1.5 /s_get Get control value(s)

      1.6 /n_mapn Map a node’s controls to read from buses

      1.7 /b_gen Call a command to fill a buffer

      1.8 /n_trace Trace a node

      1.9 /b_alloc Allocate buffer space.

      1.10 /n_query Get info about a node

      1.11 /d_load Load synth definition

      1.12 /n_fill Fill ranges of a node’s control value(s)

      1.13 /n_before Place a node before another

      1.14 /b_close

      1.15 see s-new

      1.16 /s_new Create a new synth

      1.17 /b_setn Set ranges of sample value(s)

      1.18 /c_set Set bus value(s)

      1.19 /n_free Delete a node.

      1.20 see n-set

      1.21 /n_run Turn node on or off

      1.22 /b_read Read sound file data into an existing buffer.

      1.23 /nrt_end end real time mode, close file

      1.24 /b_get Get sample value(s)

      1.25 /n_after Place a node after another

      1.26 /d_free delete synth definition

      1.27 /n_set Set a node’s control value(s)

      1.28 /b_write Write sound file data.

      1.29 /b_getn Get ranges of sample value(s)

      1.30 /b_fill Fill ranges of sample value(s)

      1.31 /s_noid Auto-reassign synth’s ID to a reserved value

      1.32 /d_recv Receive a synth definition file

      1.33 /u_cmd send a command to a unit generator

      1.34 /b_allocRead Allocate buffer space and read a sound file.

      1.35 /n_map Map a node’s controls to read from a bus

      1.36 /status Query the status

      1.37 /g_new Create a new group

      1.38 /c_get Get bus value(s)

      1.39 /b_set Set sample value(s)

      1.40 /b_zero Zero sample data

      1.41 /tr A trigger message

      1.42 /dumpOSC Display incoming OSC messages

      1.43 /n_setn Set ranges of a node’s control value(s)

      1.44 /b_free Free buffer data.

      1.45 /notify Register to receive notifications from server

      1.46 /b_query

      1.47 /g_tail Add node to tail of group

      1.48 /clearSched Clear all scheduled bundles.

      1.49 /g_freeAll Delete all nodes in a group.

      1.50 /g_head Add node to head of group

      1.51 /c_getn Get ranges of bus value(s)

      1.52 /quit Quit program

      1.53 see g-new

      1.54 /c_fill Fill ranges of bus value(s)

    2 rsc3: ugens

      2.1 (Rlpf in freq rq)

      2.2 (fold in lo hi)

      2.3 (formlet in freq attackTime decayTime)

      2.4 (lin-lin in srclo srchi dstlo dsthi)

      2.5 (fos in a0 a1 b1)

      2.6 (bpf in freq rq)

      2.7 (wrap in lo hi)

      2.8 (bpz2 in)

      2.9 (amp-comp freq root exp)

      2.10 (lag2 in lagTime)

      2.11 (one-zero in coef)

      2.12 (klank in freqScale freqOffset decayScale spec)

      2.13 (lpz2 ar in)

      2.14 (lin-exp in srclo srchi dstlo dsthi)

      2.15 (hpz2 in)

      2.16 (leak-dc in coef)

      2.17 (hpf in freq)

      2.18 (sos in a0 a1 a2 b1 b2)

      2.19 (normalizer in level dur)

      2.20 (two-zero in freq radius)

      2.21 (clip in lo hi)

      2.22 (limiter input level lookAheadTime)

      2.23 (median length in)

      2.24 (lag3 in lagTime)

      2.25 (amp-compA freq root minAmp rootAmp)

      2.26 (two-pole in freq radius)

      2.27 (lpf in freq)

      2.28 (hpz1 in)

      2.29 (freq-shift input shift phase)

      2.30 (lpz1 ar in)

      2.31 (moog-ff in freq gain reset)

      2.32 (resonz in freq bwr)

      2.33 (brz2 in)

      2.34 (Rhpf in freq rq)

      2.35 (brf in freq rq)

      2.36 (one-pole in coef)

      2.37 (lag in lagTime)

      2.38 (ringz in freq decayTime)

      2.39 (dyn-klank in freqScale freqOffset decayScale spec)

      2.40 (Grainin nc tr dur in pan envbuf)

      2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

      2.42 (grain-sin nc tr dur freq pan envbuf)

      2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

      2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

      2.45 (disk-in num-channels rate bufnum)

      2.46 (disk-out bufnum channels)

      2.47 num-input-buses

      2.48 num-control-buses

      2.49 num-buffers

      2.50 num-output-buses

      2.51 (buf-frames rate bufnum)

      2.52 (buf-rate-scale rate bufnum)

      2.53 sample-dur

      2.54 sample-rate

      2.55 radians-per-sample

      2.56 (buf-dur rate bufnum)

      2.57 (buf-channels rate bufnum)

      2.58 (buf-sample-rate rate bufnum)

      2.59 num-audio-buses

      2.60 num-running-synths

      2.61 subsample-offset

      2.62 (zero-crossing in)

      2.63 (slope in)

      2.64 (running-sum in numsamp)

      2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

      2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

      2.67 (amplitude rate in attackTime releaseTime)

      2.68 (pulse-divider trig div start)

      2.69 (gate in trig)

      2.70 (poll trig in trigid label)

      2.71 (most-change a b)

      2.72 (trig in dur)

      2.73 (pulse-count trig reset)

      2.74 (stepper trig reset min max step resetval)

      2.75 (last-value in diff)

      2.76 (peak-follower in decay)

      2.77 (running-max in trig)

      2.78 (trig1 in dur)

      2.79 (phasor trig rate start end resetpos)

      2.80 (schmidt in lo hi)

      2.81 (peak trig reset)

      2.82 (toggle-ff trig)

      2.83 (sweep trig rate)

      2.84 (send-trig in id value)

      2.85 (in-range in lo hi)

      2.86 (timer trig)

      2.87 (t-delay trigger delayTime)

      2.88 (running-min in trig)

      2.89 (set-reset-ff trig reset)

      2.90 (saw rate freq)

      2.91 (pm-osc rate carfreq modfreq index modphase)

      2.92 (lf-tri rate freq iphase)

      2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

      2.94 (tw-index in normalize array)

      2.95 (osc-n rate bufnum freq phase)

      2.96 (osc rate bufnum freq phase)

      2.97 (lf-saw rate freq iphase)

      2.98 (tw-choose trig array weights normalize)

      2.99 (import (rsc3))

      2.100 (pulse rate freq width)

      2.101 (shaper bufnum in)

      2.102 SC2: Note extra iphase argument. (import (rsc3)) (audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) (let ((f (x-line kr 200 4000 1 remove-synth))) (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

      2.103 (v-osc rate bufpos freq phase)

      2.104 (var-saw rate freq iphasewidth)

      2.105 (import (sosc) (rsc3)) (let ((a (letc ((r 1)) (let* ((r* (mul (buf-rate-scale kr 0) r)) (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) (f (mul-add (lf-noise1 kr 2) 300 400)) (i (mul (sin-osc ar f 0) 0.1))) (mrg2 (buf-wr 0 p 1 i) (out 0 0.0))))) (b (letc ((r 1)) (let* ((r* (mul (buf-rate-scale kr 0) r)) (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) (out 0 (buf-rd 1 ar 0 p 1 2)))))) (with-sc3 (lambda (fd) (async fd (b-alloc 0 (* 44100 2) 1)) (send-synth fd "a" a) (send-synth fd "b" b) (send fd (s-new0 "a" 1001 1 0)) (send fd (s-new0 "b" 1002 1 0))))) (define (do-send m) (with-sc3 (lambda (fd) (send fd m)))) (do-send (n-set1 1002 "r" 5)) (do-send (n-set1 1001 "r" (random 0 2))) (do-send (n-set1 1002 "r" 2))

      2.106 (import (rsc3)) (audition (out 0 (mul (impulse ar 800 0) 0.1))) (let ((f (x-line kr 800 10 5 remove-synth))) (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) (let ((f (mouse-y* kr 4 8 0 0.1)) (p (mouse-x* kr 0 1 0 0.1))) (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))

      2.107 (import (rsc3)) (audition (out 0 (mul (blip ar 440 200) 0.15)))

      2.108 (select which array)

      2.109 (import (rsc3))

      2.110 (import (rsc3)) (with-sc3 (lambda (fd) (async fd (b-alloc 10 512 1)) (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) (audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) (audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))

      2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

      2.112 (lf-cub rate freq iphase)

      2.113 (lf-pulse rate freq iphase width)

      2.114 (import (sosc) (rsc3))

      2.115 See lf-cub.

      2.116 (sync-saw rate syncFreq sawFreq)

      2.117 (t-choose trig array)

      2.118 (sin-osc rate freq phase)

      2.119 (klang rate freqScale freqOffset spec)

      2.120 (lag-in num-channels bus lag)

      2.121 (sound-in channel)

      2.122 (in num-channels rate bus)

      2.123 (in-trig num-channels bus)

      2.124 (replace-out bufferindex inputs)

      2.125 (local-in num-channels rate)

      2.126 (offset-out bufferindex inputs)

      2.127 (in-feedback num-channels bus)

      2.128 (x-out buffer-index xfade inputs)

      2.129 (out bufferindex inputs)

      2.130 (mix UGen)

      2.131 (mix-fill n f) (let ((n 6) (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) (audition (out 0 (mix-fill n o))))

      2.132 (latch in trig)

      2.133 (decay in decayTime)

      2.134 (wrap-index bufnum in)

      2.135 (mouse-y rate minval maxval warp lag)

      2.136 (degree-to-key bufnum in octave)

      2.137 (key-state rate keynum minval maxval lag)

      2.138 (mrg2 left right)

      2.139 (mouse-button rate minval maxval lag)

      2.140 (slew in up dn)

      2.141 (mouse-x rate minval maxval warp lag)

      2.142 (decay2 in attackTime decayTime)

      2.143 (k2a in)

      2.144 (mul-add a b c)

      2.145 (clip2 a b)

      2.146 (Atan2 x y)

      2.147 (trunc a b)

      2.148 (sub a b)

      2.149 (round-up a b)

      2.150 (ring4 a b)

      2.151 (pow a b)

      2.152 (ring1 a b)

      2.153 (gt a b)

      2.154 (add a b)

      2.155 (abs-dif a b)

      2.156 (am-clip a b)

      2.157 (ge a b)

      2.158 (max a b)

      2.159 (ring3 a b)

      2.160 (thresh a b)

      2.161 (dif-sqr a b)

      2.162 (excess a b)

      2.163 (fold2 a b)

      2.164 (sqr-dif a b)

      2.165 (hypot x y)

      2.166 (sqr-sum a b)

      2.167 (sum-sqr a b)

      2.168 (le a b)

      2.169 See gt

      2.170 (scale-neg a b)

      2.171 (ring2 a b)

      2.172 (Mod a b)

      2.173 (fdiv a b)

      2.174 (mul a b)

      2.175 (min a b)

      2.176 (lt a b)

      2.177 (wrap2 a b)

      2.178 (round a b)

      2.179 (hasher in)

      2.180 (rand-seed rate trig seed)

      2.181 (lfd-noise0 rate freq)

      2.182 (lfclip-noise rate freq)

      2.183 See lf-noise0

      2.184 (clip-noise rate)

      2.185 (ti-rand lo hi trig)

      2.186 (lf-noise0 rate freq)

      2.187 (pink-noise rate)

      2.188 (rand lo hi)

      2.189 (gray-noise rate)

      2.190 See lfd-noise0

      2.191 (i-rand lo hi)

      2.192 (n-rand lo hi n)

      2.193 (lfdclip-noise rate freq)

      2.194 (coin-gate prob in)

      2.195 (t-exp-rand lo hi trig)

      2.196 (t-rand lo hi trig)

      2.197 (white-noise rate)

      2.198 (dust2 rate density)

      2.199 See lfd-noise0

      2.200 (rand-id rate id)

      2.201 See lf-noise0

      2.202 (mantissa-mask in bits)

      2.203 (dust rate density)

      2.204 (lin-rand lo hi minmax)

      2.205 (exp-rand lo hi)

      2.206 (brown-noise rate)

      2.207 (u:log a)

      2.208 (frac a)

      2.209 (arc-tan a)

      2.210 (distort a)

      2.211 (tan-h a)

      2.212 (u:floor a)

      2.213 (cps-oct a)

      2.214 (db-amp a)

      2.215 (u:sqrt a)

      2.216 (soft-clip a)

      2.217 (cps-midi a)

      2.218 (is-strictly-positive a)

      2.219 (u:tan a)

      2.220 (cos-h a)

      2.221 (amp-db a)

      2.222 (abs a)

      2.223 (log10 a)

      2.224 (midi-cps a)

      2.225 (is-positive a)

      2.226 (sign a)

      2.227 (neg a)

      2.228 (log2 a)

      2.229 (ceil a)

      2.230 (arc-cos a)

      2.231 (exp a)

      2.232 (squared a)

      2.233 (arc-sin a)

      2.234 (cubed a)

      2.235 (is-negative a)

      2.236 (oct-cps a)

      2.237 (u:sin a)

      2.238 (sin-h a)

      2.239 (cos a)

      2.240 (pv-mul bufferA bufferB)

      2.241 (pv-mag-squared buffer)

      2.242 (pv-min bufferA bufferB)

      2.243 (pv-mag-noise buffer)

      2.244 (pv-mag-below buffer threshold)

      2.245 (convolution in kernel framesize)

      2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) #| fft feature detector for onset detection based on work described in Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using Feature Extraction. in Proceedings of the Computer Music Modeling and Retrieval Symposium, Lecture Notes in Computer Science. springer Verlag. First order derivatives of the features are taken. Threshold may need to be set low to pick up on changes. buffer - fft buffer to read from. propsc - Proportion of spectral centroid feature. prophfe - Proportion of high frequency energy feature. prophfc - Proportion of high frequency content feature. propsf - Proportion of spectral flux feature. threshold - Threshold level for allowing a detection waittime - If triggered, minimum wait until a further frame can cause another spot (useful to stop multiple detects on heavy signals) Default values in sclang are: propsc=0.25, prophfe=0.25, prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. |# (with-sc3 (lambda (fd) (async fd (b-alloc 0 2048 1)))) (let* ((source (sound-in 0)) (detect (pv-jensen-andersen (fft* 0 source) 0.25 0.25 0.25 0.25 (mouse-x kr 0.01 1.0 1 0.1) 0.04))) (audition (out 0 (mul (sin-osc ar (mce2 440 445) 0) (decay (mul 0.1 detect) 0.1)))))

      2.247 (pv-phase-shift270 buffer)

      2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

      2.249 (pv-phase-shift buffer shift)

      2.250 (pv-copy bufferA bufferB)

      2.251 (pv-brick-wall buffer wipe)

      2.252 (pv-mag-smear buffer bins)

      2.253 (pv-mag-above buffer threshold)

      2.254 (pv-bin-shift buffer stretch shift)

      2.255 (fft buffer in hop wintype active)

      2.256 (pv-bin-wipe bufferA bufferB wipe)

      2.257 (pv-copyPhase bufferA bufferB)

      2.258 (pv-phase-shift90 buffer)

      2.259 (convolution2 in bufnum trigger framesize) #| Strict convolution with fixed kernel which can be updated using a trigger signal. in - processing target bufnum - buffer index for the fixed kernel, may be modulated in combination with the trigger trigger - update the kernel on a change from <=0 to >0 framesize - size of fft frame, must be a power of two. convolution uses twice this number internally, maximum value you can give this argument is 2^16=65536. Note that it gets progressively more expensive to run for higher powers! 512, 1024, 2048, 4096 standard. |# (with-sc3 (lambda (fd) (for-each (lambda (b) (async fd (b-alloc b 2048 1))) (list 10 11 12)) (for-each (lambda (n) (send fd (b-set1 10 (+ (* 400 n) 100) 1))) (enum-from-to 0 2)) (for-each (lambda (n) (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1)))) (enum-from-to 0 49)) (for-each (lambda (n) (send fd (b-set1 12 (+ (* 40 n) 20) 1))) (enum-from-to 0 19)) (send-synth fd "c" (letc ((k 0) (t 0)) (let ((i (impulse ar 1 0))) (out 0 (mul (convolution2 i k t 2048) 0.5))))))) (define send-to (lambda (m) (with-sc3 (lambda (fd) (send fd m))))) (define async-to (lambda (m) (with-sc3 (lambda (fd) (async fd m))))) (send-to (s-new1 "c" 1001 1 1 "k" 10)) (send-to (n-set1 1001 "k" 11)) (send-to (n-set1 1001 "t" 0)) (send-to (n-set1 1001 "t" 1)) (send-to (n-set1 1001 "k" 12)) (send-to (n-set1 1001 "t" 0)) (send-to (n-set1 1001 "t" 1)) (async-to (b-zero 12)) (for-each (lambda (n) (send-to (b-set1 12 (+ (* 20 n) 10) 1))) (enum-from-to 0 39)) (send-to (n-set1 1001 "t" 0)) (send-to (n-set1 1001 "t" 1))

      2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

      2.261 (pv-add bufferA bufferB)

      2.262 (pv-rand-comb buffer wipe trig)

      2.263 (pv-local-max buffer threshold)

      2.264 (pv-mag-mul bufferA bufferB)

      2.265 (pv-conformal-map buffer real imag)

      2.266 (pv-diffuser buffer trig)

      2.267 (pv-max bufferA bufferB)

      2.268 (Ifft buffer wintype)

      2.269 (pv-bin-scramble buffer wipe width trig)

      2.270 (pv-rand-wipe bufferA bufferB wipe trig)

      2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

      2.272 (pvcollect chain numframes func frombin tobin zeroothers)

      2.273 (PV_Magclip buffer threshold)

      2.274 (PV_Magfreeze buffer freeze)

      2.275 (pv-rect-comb buffer numTeeth phase width) (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) (let* ((dup (lambda (a) (mce2 a a))) (x (mouse-x kr 0 0.5 0 0.1)) (y (mouse-y kr 0 0.5 0 0.1)) (n (dup (mul (white-noise ar) 0.3))) (c (pv-rect-comb (fft* 10 n) 8 x y))) (audition (out 0 (ifft* c)))) (let* ((dup (lambda (a) (mce2 a a))) (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) (n (dup (mul (white-noise ar) 0.3))) (c (pv-rect-comb (fft* 10 n) 8 p w))) (audition (out 0 (ifft* c))))

      2.276 (pv-mag-shift buffer stretch shift)

      2.277 See allpass-n

      2.278 See comb-n

      2.279 See Bufallpass-c

      2.280 (free-verb in mix room damp)

      2.281 See freeVerb

      2.282 (play-buf numChannels bufnum rate trigger startPos loop)

      2.283 See buf-delay-c

      2.284 (delay2 in)

      2.285 (comb-n in maxDelayTime delayTime decayTime)

      2.286 See Bufallpass-c

      2.287 (allpass-n in maxDelayTime delayTime decayTime)

      2.288 See comb-n

      2.289 (buf-allpass-c buf in delaytime decaytime)

      2.290 See allpass-n

      2.291 See buf-delay-c

      2.292 (buf-delay-c buf in delaytime)

      2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

      2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

      2.295 See buf-comb-c

      2.296 (buf-comb-c buf in delaytime decaytime)

      2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

      2.298 (delay1 in)

      2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

      2.300 See delay-n

      2.301 See buf-comb-c

      2.302 See delay-n

      2.303 (delay-n in maxDelayTime delayTime)

      2.304 (ball in g damp friction)

      2.305 (dswitch1 index array)

      2.306 (t-duty rate duration reset doneAction level gap)

      2.307 See dwhite

      2.308 (dwhite length lo hi)

      2.309 (dbufrd bufnum phase loop)

      2.310 (demand-env-gen rate levels times shapes curves gate reset

      2.311 (demand trig reset ugens)

      2.312 (duty rate duration reset doneAction level)

      2.313 (dser length array)

      2.314 (dgeom length start grow)

      2.315 (drand length array)

      2.316 See drand

      2.317 (dseries length start step)

      2.318 (dswitch index array)

      2.319 See dbrown

      2.320 (dbrown length lo hi step)

      2.321 (dseq length array)

      2.322 See latoocarfian-c.

      2.323 (fb-sine-c rate freq im fb a c xi yi)

      2.324 See fb-sine-c

      2.325 (quad-n rate freq a b c xi)

      2.326 (lorenz-l rate freq s r b h xi yi zi)

      2.327 See standard-l.

      2.328 See quad-n

      2.329 See cusp-n

      2.330 See latoocarfian-c.

      2.331 (logistic rate chaosParam freq)

      2.332 See fb-sine-c

      2.333 (latoocarfian-c rate freq a b c d xi yi)

      2.334 (rossler rate chaosParam dt)

      2.335 (standard-l rate freq k xi yi)

      2.336 See quad-n

      2.337 (cusp-n rate freq a b xi)

      2.338 (lin-cong-c rate freq a c m xi)

      2.339 (crackle rate chaosParam)

      2.340 (henon-n rate freq a b x0 x1)

      2.341 See henon-n

      2.342 See lin-cong-c.

      2.343 See GbmanL.

      2.344 See GbmanL.

      2.345 See henon-n

      2.346 See lin-cong-c.

      2.347 (gbman-c rate freq xi yi)

      2.348 (lin-pan2 in pos level)

      2.349 (rotate2 x y pos)

      2.350 (decode-b2 numChannels w x y orientation)

      2.351 (pan2 in pos level)

      2.352 (pan-b2 in azimuth gain)

      2.353 (detect-silence in amp time doneAction)

      2.354 (line rate start end dur doneAction)

      2.355 (free trig nodeID)

      2.356 (pause-self-when-done src)

      2.357 (pause-self src)

      2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

      2.359 (free-self-when-done src)

      2.360 (pause gate nodeID)

      2.361 (x-line rate start end dur doneAction)

      2.362 (done src)

      2.363 (linen gate attackTime susLevel releaseTime doneAction)

      2.364 (free-self src)

    3 rsc3: tutorials

    Index

Notice to Mice