| 1 |
""" |
| 2 |
03-fm-generators.py - Frequency modulation synthesis. |
| 3 |
|
| 4 |
There two objects in the library that implement frequency |
| 5 |
modulation algorithms. These objects are very simple, although |
| 6 |
powerful. It is also relatively simple to build a custom FM |
| 7 |
algorithm, this will be covered in the tutorials on custom |
| 8 |
synthesis algorithms. |
| 9 |
|
| 10 |
Use the "voice" slider of the window "Input interpolator" to |
| 11 |
interpolate between the two sources. Use the controller windows |
| 12 |
to change the parameters of the FM algorithms. |
| 13 |
|
| 14 |
Note what happened in the controller window when we give a |
| 15 |
list of floats to an object's argument. |
| 16 |
|
| 17 |
""" |
| 18 |
from pyo import * |
| 19 |
|
| 20 |
s = Server().boot() |
| 21 |
|
| 22 |
|
| 23 |
fm1 = FM(carrier=250, ratio=[1.5, 1.49], index=10, mul=0.3) |
| 24 |
fm1.ctrl() |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
fm2 = CrossFM(carrier=250, ratio=[1.5, 1.49], ind1=10, ind2=2, mul=0.3) |
| 29 |
fm2.ctrl() |
| 30 |
|
| 31 |
|
| 32 |
sel = Selector([fm1, fm2]).out() |
| 33 |
sel.ctrl(title="Input interpolator (0=FM, 1=CrossFM)") |
| 34 |
|
| 35 |
|
| 36 |
sp = Spectrum(sel) |
| 37 |
|
| 38 |
s.gui(locals()) |