File: 03-parallel-proc.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 (34 lines) | stat: -rw-r--r-- 980 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
30
31
32
33
34
03-parallel-proc.py - Multiple processes on a single source.
============================================================================================================================================


This example shows how to play different audio objects side-by-side.
Every processing object (ie the ones that modify an audio source) have
a first argument called "input". This argument takes the audio object
to process.

Note the input variable given to each processing object and the call
to the out() method of each object that should send its samples to the
output.

.. code-block:: python

    from pyo import *
    
    s = Server().boot()
    s.amp = 0.1
    
    # Creates a sine wave as the source to process.
    a = Sine()
    
    # Passes the sine wave through an harmonizer.
    hr = Harmonizer(a).out()
    
    # Also through a chorus.
    ch = Chorus(a).out()
    
    # And through a frequency shifter.
    sh = FreqShift(a).out()
    
    s.gui(locals())