Debian Codegraph @

pyo/examples/x07-effects/02-schroeder-reverb.py

raw symbols SCIP
1 """
2 02-schroeder-reverb.py - Simple reverberator based on Schroeder's algorithms.
3
4 An artificial reverberation based on the work of Manfred Schroeder.
5
6 This reverberator takes a monophonic input and outputs two uncorrelated
7 reverberated signals.
8
9 This algorithm presents four parallel comb filters fedding two serial
10 allpass filters. An additional lowpass filter is used at the end to
11 control the brightness of the reverberator.
12
13 The manual example for the Allpass object presents an other Schroeder's
14 reverberator.
15
16 If you are interested in builtin reverberation objects, see:
17
18 Freeverb, WGVerb, STRev, CvlVerb
19
20 Not really reverbs, but you can build some cool resonant effects with:
21
22 Waveguide, AllpassWG
23
24 """
25 from pyo import *
26
27 s = Server(duplex=0).boot()
28
29 soundfile = SndTable(SNDS_PATH + "/transparent.aif")
30
31 src = Looper(soundfile, dur=2, xfade=0, mul=0.3)
32 src2 = src.mix(2).out()
33
34 # Four parallel stereo comb filters. The delay times are chosen
35 # to be as uncorrelated as possible. Prime numbers are a good
36 # choice for delay lengths in samples.
37 comb1 = Delay(src, delay=[0.0297, 0.0277], feedback=0.65)
38 comb2 = Delay(src, delay=[0.0371, 0.0393], feedback=0.51)
39 comb3 = Delay(src, delay=[0.0411, 0.0409], feedback=0.5)
40 comb4 = Delay(src, delay=[0.0137, 0.0155], feedback=0.73)
41
42 combsum = src + comb1 + comb2 + comb3 + comb4
43
44 # The sum of the original signal and the comb filters
45 # feeds two serial allpass filters.
46 all1 = Allpass(combsum, delay=[0.005, 0.00507], feedback=0.75)
47 all2 = Allpass(all1, delay=[0.0117, 0.0123], feedback=0.61)
48
49 # Brightness control.
50 lowp = Tone(all2, freq=3500, mul=0.25).out()
51
52 s.gui(locals())