File: 07-multichannel-expansion-2.rst.txt

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 (29 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (2)
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
07-multichannel-expansion-2.py - Extended multichannel expansion.
============================================================================================================================================


When using multichannel expansion with lists of different lengths,
the longer list is used to set the number of streams and smaller
lists will be wrap-around to fill the holes.

This feature is very useful to create complex sonorities.

.. code-block:: python

    from pyo import *
    
    s = Server().boot()
    
    # 12 streams with different combinations of `freq` and `ratio`.
    a = SumOsc(
        freq=[100, 150.2, 200.5, 250.7],
        ratio=[0.501, 0.753, 1.255],
        index=[0.3, 0.4, 0.5, 0.6, 0.7, 0.4, 0.5, 0.3, 0.6, 0.7, 0.3, 0.5],
        mul=0.05,
    )
    
    # Adds a stereo reverberation to the signal
    rev = Freeverb(a.mix(2), size=0.80, damp=0.70, bal=0.30).out()
    
    s.gui(locals())