4
Fuzz distortion. High gain followed by, asymmetrical clipping,
5
hard clip on top, soft compression on bottom.
12
SOURCE = "../snds/flute.aif"
19
src = SfPlayer(SOURCE, loop=True).mix(2)
21
# Transfert function for signal lower than 0
22
low_table = ExpTable([(0,-.25),(4096,0),(8192,0)], exp=10)
23
# Transfert function for signal higher than 0
24
high_table = CosTable([(0,0),(4096,0),(4598,1),(8192,1)])
26
# Bandpass filter and boost gain applied on input signal
27
bp = Biquad(src, freq=BP_CENTER_FREQ, q=BP_Q, type=2)
28
boost = Sig(bp, mul=BOOST)
30
# Split signal into positive and negative part
31
sign = Compare(boost, comp=0, mode=">=")
32
sw = Switch(boost, outs=2, voice=sign)
34
# Apply transfert function
35
lowsig = Lookup(low_table, sw[0])
36
highsig = Lookup(high_table, sw[1])
38
# Lowpass filter on distorted signal
39
lp = Tone(lowsig+highsig, freq=LP_CUTOFF_FREQ, mul=.3)
41
# Balance between dry and wet signals
42
out = Interp(src, lp, interp=BALANCE).out()
b'\\ No newline at end of file'