rsc3/doc/rsc3-docs/index.html

192 lines
121 KiB
HTML
Raw Normal View History

2022-08-24 13:53:18 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>rsc3: racket/scheme/supercollider</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="" class="tocviewselflink" data-pltdoc="x">rsc3:<span class="mywbr"> &nbsp;</span> racket/<span class="mywbr"> &nbsp;</span>scheme/<span class="mywbr"> &nbsp;</span>supercollider</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="rsc3__server_commands.html" class="tocviewlink" data-pltdoc="x">rsc3:<span class="mywbr"> &nbsp;</span> server commands</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="rsc3__ugens.html" class="tocviewlink" data-pltdoc="x">rsc3:<span class="mywbr"> &nbsp;</span> ugens</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="rsc3__tutorials.html" class="tocviewlink" data-pltdoc="x">rsc3:<span class="mywbr"> &nbsp;</span> tutorials</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber"></span><a href="#%28part._rsc3__racket_scheme_supercollider%29" class="tocsubseclink" data-pltdoc="x">rsc3:<span class="mywbr"> &nbsp;</span> racket/<span class="mywbr"> &nbsp;</span>scheme/<span class="mywbr"> &nbsp;</span>supercollider</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">8.6</span></div><div class="navsettop"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;<span class="tocsettoggle">&nbsp;&nbsp;<a href="javascript:void(0);" title="show/hide table of contents" onclick="TocsetToggle();">contents</a></span></span><span class="navright">&nbsp;&nbsp;<span class="nonavigation">&larr; prev</span>&nbsp;&nbsp;<span class="nonavigation">up</span>&nbsp;&nbsp;<a href="rsc3__server_commands.html" title="forward to &quot;1 rsc3: server commands&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h2><a name="(part._rsc3__racket_scheme_supercollider)"></a>rsc3: racket/scheme/supercollider</h2><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__server_commands.html" class="toptoclink" data-pltdoc="x">1<span class="hspace">&nbsp;</span>rsc3: server commands</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__server_commands.html#%28part.__g_deep.Free__.Free_all_synths_in_this_group_and_all_its_sub-groups_%29" class="toclink" data-pltdoc="x">1.1<span class="hspace">&nbsp;</span>/g_deepFree Free all synths in this group and all its sub-groups.</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__server_commands.html#%28part.__c_setn___________________________________.Set_ranges_of_bus_value_s_%29" class="toclink" data-pltdoc="x">1.2<span class="hspace">&nbsp;</span>/c_setn Set ranges of bus value(s)</a></p></td></tr><tr>
(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))))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__v-osc_rate_bufpos_freq_phase_%29" class="toclink" data-pltdoc="x">2.103<span class="hspace">&nbsp;</span>(v-osc rate bufpos freq phase)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__var-saw_rate_freq_iphasewidth_%29" class="toclink" data-pltdoc="x">2.104<span class="hspace">&nbsp;</span>(var-saw rate freq iphasewidth)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__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__%29" class="toclink" data-pltdoc="x">2.105<span class="hspace">&nbsp;</span>(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))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__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____%29" class="toclink" data-pltdoc="x">2.106<span class="hspace">&nbsp;</span>(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))))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__import__rsc3_____audition__out_0__mul__blip_ar_440_200__0_15___%29" class="toclink" data-pltdoc="x">2.107<span class="hspace">&nbsp;</span>(import (rsc3))
(audition (out 0 (mul (blip ar 440 200) 0.15)))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__select_which_array_%29" class="toclink" data-pltdoc="x">2.108<span class="hspace">&nbsp;</span>(select which array)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__import__rsc3__%29" class="toclink" data-pltdoc="x">2.109<span class="hspace">&nbsp;</span>(import (rsc3))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__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___%29" class="toclink" data-pltdoc="x">2.110<span class="hspace">&nbsp;</span>(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)))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__v-osc3_rate_bufpos_freq1_freq2_freq3_%29" class="toclink" data-pltdoc="x">2.111<span class="hspace">&nbsp;</span>(v-osc3 rate bufpos freq1 freq2 freq3)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__lf-cub_rate_freq_iphase_%29" class="toclink" data-pltdoc="x">2.112<span class="hspace">&nbsp;</span>(lf-cub rate freq iphase)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__lf-pulse_rate_freq_iphase_width_%29" class="toclink" data-pltdoc="x">2.113<span class="hspace">&nbsp;</span>(lf-pulse rate freq iphase width)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__import__sosc___rsc3__%29" class="toclink" data-pltdoc="x">2.114<span class="hspace">&nbsp;</span>(import (sosc) (rsc3))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_lf-cub_%29" class="toclink" data-pltdoc="x">2.115<span class="hspace">&nbsp;</span>See lf-cub.</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__sync-saw_rate_sync.Freq_saw.Freq_%29" class="toclink" data-pltdoc="x">2.116<span class="hspace">&nbsp;</span>(sync-saw rate syncFreq sawFreq)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__t-choose_trig_array_%29" class="toclink" data-pltdoc="x">2.117<span class="hspace">&nbsp;</span>(t-choose trig array)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__sin-osc_rate_freq_phase_%29" class="toclink" data-pltdoc="x">2.118<span class="hspace">&nbsp;</span>(sin-osc rate freq phase)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__klang_rate_freq.Scale_freq.Offset_spec_%29" class="toclink" data-pltdoc="x">2.119<span class="hspace">&nbsp;</span>(klang rate freqScale freqOffset spec)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__lag-in_num-channels_bus_lag_%29" class="toclink" data-pltdoc="x">2.120<span class="hspace">&nbsp;</span>(lag-in num-channels bus lag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__sound-in_channel_%29" class="toclink" data-pltdoc="x">2.121<span class="hspace">&nbsp;</span>(sound-in channel)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__in_num-channels_rate_bus_%29" class="toclink" data-pltdoc="x">2.122<span class="hspace">&nbsp;</span>(in num-channels rate bus)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__in-trig_num-channels_bus_%29" class="toclink" data-pltdoc="x">2.123<span class="hspace">&nbsp;</span>(in-trig num-channels bus)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__replace-out_bufferindex_inputs_%29" class="toclink" data-pltdoc="x">2.124<span class="hspace">&nbsp;</span>(replace-out bufferindex inputs)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__local-in_num-channels_rate_%29" class="toclink" data-pltdoc="x">2.125<span class="hspace">&nbsp;</span>(local-in num-channels rate)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__offset-out_bufferindex
(let ((n 6)
(o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1))))
(audition (out 0 (mix-fill n o))))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__latch_in_trig_%29" class="toclink" data-pltdoc="x">2.132<span class="hspace">&nbsp;</span>(latch in trig)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__decay_in_decay.Time_%29" class="toclink" data-pltdoc="x">2.133<span class="hspace">&nbsp;</span>(decay in decayTime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__wrap-index_bufnum_in_%29" class="toclink" data-pltdoc="x">2.134<span class="hspace">&nbsp;</span>(wrap-index bufnum in)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__mouse-y_rate_minval_maxval_warp_lag_%29" class="toclink" data-pltdoc="x">2.135<span class="hspace">&nbsp;</span>(mouse-y rate minval maxval warp lag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__degree-to-key_bufnum_in_octave_%29" class="toclink" data-pltdoc="x">2.136<span class="hspace">&nbsp;</span>(degree-to-key bufnum in octave)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__key-state_rate_keynum_minval_maxval_lag_%29" class="toclink" data-pltdoc="x">2.137<span class="hspace">&nbsp;</span>(key-state rate keynum minval maxval lag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__mrg2_left_right_%29" class="toclink" data-pltdoc="x">2.138<span class="hspace">&nbsp;</span>(mrg2 left right)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__mouse-button_rate_minval_maxval_lag_%29" class="toclink" data-pltdoc="x">2.139<span class="hspace">&nbsp;</span>(mouse-button rate minval maxval lag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__slew_in_up_dn_%29" class="toclink" data-pltdoc="x">2.140<span class="hspace">&nbsp;</span>(slew in up dn)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__mouse-x_rate_minval_maxval_warp_lag_%29" class="toclink" data-pltdoc="x">2.141<span class="hspace">&nbsp;</span>(mouse-x rate minval maxval warp lag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__decay2_in_attack.Time_decay.Time_%29" class="toclink" data-pltdoc="x">2.142<span class="hspace">&nbsp;</span>(decay2 in attackTime decayTime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__k2a_in_%29" class="toclink" data-pltdoc="x">2.143<span class="hspace">&nbsp;</span>(k2a in)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__mul-add_a_b_c_%29" class="toclink" data-pltdoc="x">2.144<span class="hspace">&nbsp;</span>(mul-add a b c)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__clip2_a_b_%29" class="toclink" data-pltdoc="x">2.145<span class="hspace">&nbsp;</span>(clip2 a b)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__.Atan2_x_y_%29" class="toclink" data-pltdoc="x">2.146<span class="hspace">&nbsp;</span>(Atan2 x y)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__trunc_a_b_%29" class="toclink" data-pltdoc="x">2.147<span class="hspace">&nbsp;</span>(trunc a b)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&
#|
fft feature detector for onset detection based on work described in
Jensen,K. &amp; 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)))))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-phase-shift270_buffer_%29" class="toclink" data-pltdoc="x">2.247<span class="hspace">&nbsp;</span>(pv-phase-shift270 buffer)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-hainsworth-foote_buffer_proph_propf_threshold_waittime_%29" class="toclink" data-pltdoc="x">2.248<span class="hspace">&nbsp;</span>(pv-hainsworth-foote buffer proph propf threshold waittime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-phase-shift_buffer_shift_%29" class="toclink" data-pltdoc="x">2.249<span class="hspace">&nbsp;</span>(pv-phase-shift buffer shift)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-copy_buffer.A_buffer.B_%29" class="toclink" data-pltdoc="x">2.250<span class="hspace">&nbsp;</span>(pv-copy bufferA bufferB)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-brick-wall_buffer_wipe_%29" class="toclink" data-pltdoc="x">2.251<span class="hspace">&nbsp;</span>(pv-brick-wall buffer wipe)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-mag-smear_buffer_bins_%29" class="toclink" data-pltdoc="x">2.252<span class="hspace">&nbsp;</span>(pv-mag-smear buffer bins)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-mag-above_buffer_threshold_%29" class="toclink" data-pltdoc="x">2.253<span class="hspace">&nbsp;</span>(pv-mag-above buffer threshold)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-bin-shift_buffer_stretch_shift_%29" class="toclink" data-pltdoc="x">2.254<span class="hspace">&nbsp;</span>(pv-bin-shift buffer stretch shift)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__fft_buffer_in_hop_wintype_active_%29" class="toclink" data-pltdoc="x">2.255<span class="hspace">&nbsp;</span>(fft buffer in hop wintype active)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-bin-wipe_buffer.A_buffer.B_wipe_%29" class="toclink" data-pltdoc="x">2.256<span class="hspace">&nbsp;</span>(pv-bin-wipe bufferA bufferB wipe)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-copy.Phase_buffer.A_buffer.B_%29" class="toclink" data-pltdoc="x">2.257<span class="hspace">&nbsp;</span>(pv-copyPhase bufferA bufferB)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-phase-shift90_buffer_%29" class="toclink" data-pltdoc="x">2.258<span class="hspace">&nbsp;</span>(pv-phase-shift90 buffer)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__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__~3d0_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~3d65536__.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____
#|
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 &lt;=0 to &gt;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))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-rect-comb2_buffer.A_buffer.B_num.Teeth_phase_width_%29" class="toclink" data-pltdoc="x">2.260<span class="hspace">&nbsp;</span>(pv-rect-comb2 bufferA bufferB numTeeth phase width)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-add_buffer.A_buffer.B_%29" class="toclink" data-pltdoc="x">2.261<span class="hspace">&nbsp;</span>(pv-add bufferA bufferB)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-rand-comb_buffer_wipe_trig_%29" class="toclink" data-pltdoc="x">2.262<span class="hspace">&nbsp;</span>(pv-rand-comb buffer wipe trig)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-local-max_buffer_threshold_%29" class="toclink" data-pltdoc="x">2.263<span class="hspace">&nbsp;</span>(pv-local-max buffer threshold)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-mag-mul_buffer.A_buffer.B_%29" class="toclink" data-pltdoc="x">2.264<span class="hspace">&nbsp;</span>(pv-mag-mul bufferA bufferB)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-conformal-map_buffer_real_imag_%29" class="toclink" data-pltdoc="x">2.265<span class="hspace">&nbsp;</span>(pv-conformal-map buffer real imag)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-diffuser_buffer_trig_%29" class="toclink" data-pltdoc="x">2.266<span class="hspace">&nbsp;</span>(pv-diffuser buffer trig)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-max_buffer.A_buffer.B_%29" class="toclink" data-pltdoc="x">2.267<span class="hspace">&nbsp;</span>(pv-max bufferA bufferB)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__.Ifft_buffer_wintype_%29" class="toclink" data-pltdoc="x">2.268<span class="hspace">&nbsp;</span>(Ifft buffer wintype)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-bin-scramble_buffer_wipe_width_trig_%29" class="toclink" data-pltdoc="x">2.269<span class="hspace">&nbsp;</span>(pv-bin-scramble buffer wipe width trig)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-rand-wipe_buffer.A_buffer.B_wipe_trig_%29" class="toclink" data-pltdoc="x">2.270<span class="hspace">&nbsp;</span>(pv-rand-wipe bufferA bufferB wipe trig)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__.Packfft_chain_bufsize_frombin_tobin_zeroothers_magsphases_%29" class="toclink" data-pltdoc="x">2.271<span class="hspace">&nbsp;</span>(Packfft chain bufsize frombin tobin zeroothers magsphases)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pvcollect_chain_numframes_func_frombin_tobin_zeroothers_%29" class="toclink" data-pltdoc="x">2.272<span class="hspace">&nbsp;</span>(pvcollect chain numframes func frombin tobin zeroothers)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__.P.V_.Magclip_buffer_threshold_%29" class="toclink" data-pltdoc="x">2.273<span class="hspace">&nbsp;</span>(PV_Magclip buffer threshold)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__.P.V_.Magfreeze_buffer_freeze_%29" class="toclink" data-pltdoc="x">2.274<
(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))))</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__pv-mag-shift_buffer_stretch_shift_%29" class="toclink" data-pltdoc="x">2.276<span class="hspace">&nbsp;</span>(pv-mag-shift buffer stretch shift)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_allpass-n%29" class="toclink" data-pltdoc="x">2.277<span class="hspace">&nbsp;</span>See allpass-n</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_comb-n%29" class="toclink" data-pltdoc="x">2.278<span class="hspace">&nbsp;</span>See comb-n</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_.Bufallpass-c%29" class="toclink" data-pltdoc="x">2.279<span class="hspace">&nbsp;</span>See Bufallpass-c</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__free-verb_in_mix_room_damp_%29" class="toclink" data-pltdoc="x">2.280<span class="hspace">&nbsp;</span>(free-verb in mix room damp)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_free.Verb%29" class="toclink" data-pltdoc="x">2.281<span class="hspace">&nbsp;</span>See freeVerb</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__play-buf_num.Channels_bufnum_rate_trigger_start.Pos_loop_%29" class="toclink" data-pltdoc="x">2.282<span class="hspace">&nbsp;</span>(play-buf numChannels bufnum rate trigger startPos loop)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_buf-delay-c%29" class="toclink" data-pltdoc="x">2.283<span class="hspace">&nbsp;</span>See buf-delay-c</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__delay2_in_%29" class="toclink" data-pltdoc="x">2.284<span class="hspace">&nbsp;</span>(delay2 in)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__comb-n_in_max.Delay.Time_delay.Time_decay.Time_%29" class="toclink" data-pltdoc="x">2.285<span class="hspace">&nbsp;</span>(comb-n in maxDelayTime delayTime decayTime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_.Bufallpass-c%29" class="toclink" data-pltdoc="x">2.286<span class="hspace">&nbsp;</span>See Bufallpass-c</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__allpass-n_in_max.Delay.Time_delay.Time_decay.Time_%29" class="toclink" data-pltdoc="x">2.287<span class="hspace">&nbsp;</span>(allpass-n in maxDelayTime delayTime decayTime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_comb-n%29" class="toclink" data-pltdoc="x">2.288<span class="hspace">&nbsp;</span>See comb-n</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part.__buf-allpass-c_buf_in_delaytime_decaytime_%29" class="toclink" data-pltdoc="x">2.289<span class="hspace">&nbsp;</span>(buf-allpass-c buf in delaytime decaytime)</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_allpass-n%29" class="toclink" data-pltdoc="x">2.290<span class="hspace">&nbsp;</span>See allpass-n</a></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="rsc3__ugens.html#%28part._.See_buf-delay-c%29" class="toclink" data-pltdoc="x">2.291<span class="hspace">&nbsp;</span>See buf-delay-c</a></p></td
you must bring your own straw.</p></li></ul><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;<span class="tocsettoggle">&nbsp;&nbsp;<a href="javascript:void(0);" title="show/hide table of contents" onclick="TocsetToggle();">contents</a></span></span><span class="navright">&nbsp;&nbsp;<span class="nonavigation">&larr; prev</span>&nbsp;&nbsp;<span class="nonavigation">up</span>&nbsp;&nbsp;<a href="rsc3__server_commands.html" title="forward to &quot;1 rsc3: server commands&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>