Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: A Multichannel Convolution Reverb
name
code content
( ~numIRs = 4; ~fftsize = 2048; s.waitForBoot { var irs, irbuffs, bufsizes, nextmod, numSamples; nextmod = 100; numSamples = 40000 ; /* an array of multiple IRs */ irs = ~numIRs.collect{ arg nth; // nth is here not used, but can be useful to scale decay time. [0] ++ 0.dup(100) ++ Array.fill( numSamples, { arg i; (i%nextmod==0).if { nextmod= rrand(80, 120); (i.asFloat/numSamples).squared * 0.3 } { 0 } } ) }; { irs.plot }.defer; // to show irs. /* an array of buffers. */ irbuffs = ~numIRs.collect{ arg i; Buffer.loadCollection(s, irs[i]) }; irbuffs.postln; // to show irbuffs info. s.sync; bufsizes= irbuffs.collect{ |nth|PartConv.calcBufSize(~fftsize, nth) }; ~irSpctrms = bufsizes.collect{ arg size, i; Buffer .alloc(s, size, 1) .preparePartConv(irbuffs[i], ~fftsize) }; s.sync; ~numIRs.do{|i| irbuffs[i].free} } ) ( fork{ ~target= Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"); s.sync; { var in, krnl; in= PlayBuf.ar(1, ~target, loop:1); /* an array of multiple instances of PartConv */ krnl= ~numIRs.collect{ arg i; PartConv.ar(in, ~fftsize, ~irSpctrms[i].bufnum, 0.2)}; // By iterating, each PartConv processes a mono-channel buffer in the array ~irSpctrms. Out.ar(0, krnl); }.play } )
code description
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change