File: 05-output-channels.py

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 (31 lines) | stat: -rw-r--r-- 870 bytes parent folder | download | duplicates (7)
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
"""
05-output-channels.py - Sending signals to different physical outputs.

The simplest way to choose the output channel where to send the sound
is to give it as the first argument of the out() method. In fact, the
signature of the out() method reads as:

.out(chnl=0, inc=1, dur=0, delay=0)

`chnl` is the output where to send the first audio channel (stream) of
the object. `inc` is the output increment for other audio channels.
`dur` is the living duration, in seconds, of the process and `delay`
is a delay, in seconds, before activating the process. A duration of
0 means play forever.

"""
from pyo import *

s = Server().boot()
s.amp = 0.1

# Creates a source (white noise)
n = Noise()

# Sends the bass frequencies (below 1000 Hz) to the left
lp = ButLP(n).out()

# Sends the high frequencies (above 1000 Hz) to the right
hp = ButHP(n).out(1)

s.gui(locals())