File: 03-gated-verb.py

package info (click to toggle)
python-pyo 1.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,332 kB
  • sloc: python: 135,133; ansic: 127,822; javascript: 16,116; sh: 395; makefile: 388; cpp: 242
file content (28 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (3)
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
"""
03-gated-verb.py - Gated reverb applied to a drum loop.

The gated reverb effect, which was most popular in the 1980s, is made using a
combination of strong reverb and a noise gate. The drum sound passes through
a strong reverb, which is rapidly cut off with a gate driven by the dry signal.

"""
from pyo import *

s = Server().boot()

# Play the drum lopp..
sf = SfPlayer("../snds/drumloop.wav", loop=True)

# Use a gate to generate the gain curve that will be applied to the reverb.
gate = Gate(sf, thresh=-50, risetime=0.005, falltime=0.04, lookahead=4, outputAmp=True)

# Strong reverb.
rev = Freeverb(sf.mix(2), size=0.95, damp=0.3, bal=1.0)

# Compress the reverb signal and control its amplitude with the gating signal.
cmp = Compress(rev, thresh=-12, ratio=3, risetime=0.005, falltime=0.05, lookahead=4, knee=0.5, mul=gate,)

# Balance between the dry and wet (gated-reverb) signals.
output = Interp(sf.mix(2), cmp, interp=0.2).out()

s.gui(locals())