File: 08_bucket_brigade_device.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 (40 lines) | stat: -rw-r--r-- 1,037 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
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# encoding: utf-8
"""
bucket-brigade device (BBD) synthesis. This implementation consists of
two delay lines cross-feeded with an internal ring-modulator and a lowpass
filter inside each delay line. The delay lines are feeded with a sine wave.

"""
from pyo import *

s = Server(duplex=0).boot()

t = HarmTable(size=32768)
src = Osc(t, 100)
src.ctrl(title="Input oscillator controls")
in_src = src * 0.025

feed = 0.8
cross_feed = 0.99

del_1 = Delay(in_src, delay=Sine(0.005, 0, 0.05, 0.25))
sine_1 = Osc(t, Sine(0.007, 0, 50, 250))
ring_1 = del_1 * sine_1
filt_1 = Biquad(ring_1, 3000)

del_2 = Delay(in_src, delay=Sine(0.003, 0, 0.08, 0.3))
sine_2 = Osc(t, Sine(0.008, 0, 40, 200))
ring_2 = del_2 * sine_2
filt_2 = Biquad(ring_2, 3000)

cross_1 = filt_2 * cross_feed
cross_2 = filt_1 * cross_feed

del_1.setInput(filt_1 * feed + cross_1 + in_src)
del_2.setInput(filt_2 * feed + cross_2 + in_src)

mix = Mix([filt_1, filt_2], voices=2)
output = Compress(mix, thresh=-30, ratio=4, knee=0.5).out()

s.gui(locals())