| 1 |
""" |
| 2 |
05-strange-attractors.py - Non-linear ordinary differential equations. |
| 3 |
|
| 4 |
Oscilloscope part of the tutorial |
| 5 |
--------------------------------- |
| 6 |
|
| 7 |
A strange attractor is a system of three non-linear ordinary |
| 8 |
differential equations. These differential equations define a |
| 9 |
continuous-time dynamical system that exhibits chaotic dynamics |
| 10 |
associated with the fractal properties of the attractor. |
| 11 |
|
| 12 |
There is three strange attractors in the library, the Rossler, |
| 13 |
the Lorenz and the ChenLee objects. Each one can output stereo |
| 14 |
signal if the `stereo` argument is set to True. |
| 15 |
|
| 16 |
Use the "voice" slider of the window "Input interpolator" to |
| 17 |
interpolate between the three sources. |
| 18 |
|
| 19 |
Audio part of the tutorial |
| 20 |
-------------------------- |
| 21 |
|
| 22 |
It's possible to create very interesting LFO with strange |
| 23 |
attractors. The last part of this tutorial shows the use of |
| 24 |
Lorenz's output to drive the frequency of two sine wave oscillators. |
| 25 |
|
| 26 |
""" |
| 27 |
from pyo import * |
| 28 |
|
| 29 |
s = Server().boot() |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
lfo = Sine(0.2).range(0, 1) |
| 35 |
|
| 36 |
|
| 37 |
n1 = Rossler(pitch=0.5, chaos=lfo, stereo=True) |
| 38 |
|
| 39 |
|
| 40 |
n2 = Lorenz(pitch=0.5, chaos=lfo, stereo=True) |
| 41 |
|
| 42 |
|
| 43 |
n3 = ChenLee(pitch=0.5, chaos=lfo, stereo=True) |
| 44 |
|
| 45 |
|
| 46 |
sel = Selector([n1, n2, n3]) |
| 47 |
sel.ctrl(title="Input interpolator (0=Rossler, 1=Lorenz, 2=ChenLee)") |
| 48 |
|
| 49 |
|
| 50 |
sc = Scope(sel) |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
freq = Lorenz(0.005, chaos=0.7, stereo=True, mul=250, add=500) |
| 56 |
a = Sine(freq, mul=0.3).out() |
| 57 |
|
| 58 |
s.gui(locals()) |