File: 09-handling-channels-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-- 838 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
09-handling-channels-2.py - The `out` method and the physical outputs.
============================================================================================================================================


In a multichannel environment, we can carefully choose which stream
goes to which output channel. To achieve this, we use the `chnl` and
`inc` arguments of the out method.

chnl : Physical output assigned to the first audio stream of the object.
inc : Output channel increment value.

.. code-block:: python

    from pyo import *
    
    # Creates a Server with 8 channels
    s = Server(nchnls=8).boot()
    
    # Generates a sine wave
    a = Sine(freq=500, mul=0.3)
    
    # Mixes it up to four streams
    b = a.mix(4)
    
    # Outputs to channels 0, 2, 4 and 6
    b.out(chnl=0, inc=2)
    
    s.gui(locals())