| 1 |
""" |
| 2 |
01-complex-oscs.py - Complex spectrum oscillators. |
| 3 |
|
| 4 |
This tutorial presents four objects of the library which are |
| 5 |
useful to generate complex spectrums by means of synthesis. |
| 6 |
|
| 7 |
Blit: |
| 8 |
Impulse train generator with control over the number of harmonics. |
| 9 |
|
| 10 |
RCOsc: |
| 11 |
Aproximation of a RC circuit (a capacitor and a resistor in series). |
| 12 |
|
| 13 |
SineLoop: |
| 14 |
Sine wave oscillator with feedback. |
| 15 |
|
| 16 |
SuperSaw: |
| 17 |
Roland JP-8000 Supersaw emulator. |
| 18 |
|
| 19 |
Use the "voice" slider of the window "Input interpolator" to |
| 20 |
interpolate between the four waveforms. Each one have an LFO |
| 21 |
applied to the argument that change the tone of the sound. |
| 22 |
|
| 23 |
""" |
| 24 |
from pyo import * |
| 25 |
|
| 26 |
s = Server().boot() |
| 27 |
|
| 28 |
|
| 29 |
freq = 187.5 |
| 30 |
|
| 31 |
|
| 32 |
lfo1 = Sine(0.1).range(1, 50) |
| 33 |
osc1 = Blit(freq=freq, harms=lfo1, mul=0.3) |
| 34 |
|
| 35 |
|
| 36 |
lfo2 = Sine(0.1, mul=0.5, add=0.5) |
| 37 |
osc2 = RCOsc(freq=freq, sharp=lfo2, mul=0.3) |
| 38 |
|
| 39 |
|
| 40 |
lfo3 = Sine(0.1).range(0, 0.18) |
| 41 |
osc3 = SineLoop(freq=freq, feedback=lfo3, mul=0.3) |
| 42 |
|
| 43 |
|
| 44 |
lfo4 = Sine(0.1).range(0.1, 0.75) |
| 45 |
osc4 = SuperSaw(freq=freq, detune=lfo4, mul=0.3) |
| 46 |
|
| 47 |
|
| 48 |
sel = Selector([osc1, osc2, osc3, osc4]).out() |
| 49 |
sel.ctrl(title="Input interpolator (0=Blit, 1=RCOsc, 2=SineLoop, 3=SuperSaw)") |
| 50 |
|
| 51 |
|
| 52 |
sc = Scope(sel) |
| 53 |
|
| 54 |
|
| 55 |
sp = Spectrum(sel) |
| 56 |
|
| 57 |
s.gui(locals()) |