«Reverse reverb» by zecraum

on 11 Jun'23 17:41 in reverbconvolutionreversefft

Reverb reverb by Click Nilson based on impulse response convolution. Posted on the mailing list.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Reverse reverb

// by Click Nilson
https://sc-users.bham.ac.narkive.com/hA9sdN11/reverse-reverb

/* preparation; essentially, allocate an impulse response buffer, then
follow a special buffer preparation step to set up the data the plugin
needs. Different options are provided commented out for loading
impulse responses from soundfiles. */

(
var lengthinsamples= 40000;
~fftsize=2048; // also 4096 works on my machine; 1024 too often and amortisation too pushed, 8192 more high load FFT

s.waitForBoot {

{
var ir, irbuffer, bufsize;
var nextmod=100;

ir = [0] ++0.dup(100) ++ (Array.fill(lengthinsamples,{|i| if(i%
(nextmod)==0,{nextmod= rrand(80,120); 0.3*((i.asFloat/
lengthinsamples).squared)},{0.0}) }));

irbuffer = Buffer.loadCollection(s, ir);

s.sync;

bufsize= PartConv.calcBufSize(~fftsize, irbuffer);

~irspectrum= Buffer.alloc(s, bufsize, 1);

~irspectrum.preparePartConv(irbuffer, ~fftsize);

s.sync;

irbuffer.free; // don't need time domain data anymore, just needed spectral version
}.fork;

};

)



~target= Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");

(

{ var input, kernel, mix = 0.5;

	
input= PlayBuf.ar(1, ~target, loop:1);
// snare
//input= WhiteNoise.ar(0.125) + SinOsc.ar(200, mul:0.125) * Decay.ar(Impulse.ar(1/4),1);


Out.ar(0, input * mix + (1-mix * PartConv.ar(input, ~fftsize, ~irspectrum.bufnum, 0.25)) );
}.play;
)
raw 1434 chars (focus & ctrl+a+c to copy)
reception
comments