File: 09_Buses.schelp

package info (click to toggle)
supercollider 1%3A3.6.6~repack-2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,792 kB
  • ctags: 25,269
  • sloc: cpp: 177,129; lisp: 63,421; ansic: 11,297; python: 1,787; perl: 766; yacc: 311; sh: 286; lex: 181; ruby: 173; makefile: 168; xml: 13
file content (80 lines) | stat: -rw-r--r-- 2,035 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
title:: 09_Buses
summary:: Mark Polishook tutorial
categories:: Tutorials>Mark_Polishook_tutorial
related:: Tutorials/Mark_Polishook_tutorial/00_Introductory_tutorial


By default, SuperCollider has 128 buses for audio signals and 4096 for control signals. The buses, which are items in an array, are what SuperCollider uses to represent audio and control rate data.

////////////////////////////////////////////////////////////////////////////////////////////////////

code::
// the array of audio buses (channels)
[ channel0, channel1, channel2, channel3, channel4, ... , ..., ..., etc., ... channel127 ]

// the array of control buses (channels)
[ channel0, channel1, channel2, channel3, channel4, ... , ..., ..., etc., ... channel4095 ]
::

section::Placing audio into a bus

Use an Out ugen at the audio rate to put data into an audio bus.

code::
(
SynthDef("dataForABus", {
	Out.ar(
		0,		// write 1 channel of audio into bus 0
		Saw.ar(100, 0.1)
	)
}).add;
)

Synth("dataForABus");
::

A SynthDef browser

code::
(
SynthDescLib.global.read;
SynthDescLib.global.browse;
)
::

shows 1 channel of output on channel 0.

section::Getting audio from a bus

Send an .ar message to an In ugen to get data from an audio bus.

code::
(
SynthDef("dataFromABus", {
	Out.ar(
		0,
		[	// the left channel gets input from an audio bus
			In.ar(0, 1),
			SinOsc.ar(440, 0.2)
		]
	)
}).add;
)

(
Synth("dataForABus");	// synthesize a sawtooth wave on channel 0
Synth("dataFromABus");	// pair it with a sine wave on channel 1
)
::

section::Control rate buses

Use code::In.kr:: and code::Out.kr:: to read from or write to control buses.

////////////////////////////////////////////////////////////////////////////////////////////////////

For additional information, see the link::Classes/Out::, link::Classes/In::, and link::Classes/Bus:: files in the SuperCollider help system.

////////////////////////////////////////////////////////////////////////////////////////////////////

go to link::Tutorials/Mark_Polishook_tutorial/10_Controls::