File: 04_degrade_synthesis.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 (30 lines) | stat: -rw-r--r-- 742 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
#!/usr/bin/env python
# encoding: utf-8

"""
Synthesis sound with lot of harmonics passed through a Degrade object.

"""
from pyo import *

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

# Fadein
f = Fader(fadein=4, mul=0.3).play()

# Waveform table
wt = HarmTable([1, 0, 0.2, 0, 0.10, 0, 0, 0.1, 0, 0, 0, 0.15]).normalize()

# 6 waveform readers with amplitude variations
lf = Sine([0.15, 0.2], 0, 0.35, 0.5)
a = Osc(table=wt, freq=[25, 50.1, 101, 149.7, 201.3, 251.8], mul=lf)

# table lookup with waveforms as input indexes
t = ChebyTable([1, 0, 0.3, 0, 0.2, 0, 0.143, 0, 0.111])
b = Lookup(t, a, 1.0 - lf)

# signal with lot of harmonics passed through a Degrade object
c = Degrade(b, bitdepth=5.967, srscale=0.0233, mul=f).out()
c.ctrl()

s.gui(locals())