File: InBus.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (78 lines) | stat: -rw-r--r-- 2,447 bytes parent folder | download | duplicates (4)
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
TITLE:: InBus
summary::Return a range of channels from a bus, irrespective of node order
categories::UGens>InOut
related:: Classes/In, Classes/XIn, Classes/InFeedback, Classes/XInFeedback

DESCRIPTION::InBus provides a simple interface to the signal on a bus, crossfading between adjacent values.
code::
(
b = Bus.control(s, 9); // nine channel control rate
b.setn([244, 737, 20, 271, 382, 172, 4, 2399, 251]);
{
	var index = MouseX.kr(0, 30);
	Blip.ar(InBus.ar(b, 2, index, \wrap)) * 0.1
}.play;
)
::



CLASSMETHODS::


METHOD:: ar, kr
Return a new instance with the respective rate. If the bus rate doesn't match the signal is converted. Multi channel arguments expand.

ARGUMENT:: bus
An instance of link::Classes/Bus::

ARGUMENT:: numChannels
Number of output channels

ARGUMENT:: offset
Offset to the starting index in the bus.

ARGUMENT:: clip
If clip is set to 'wrap', the indices into the bus will not be clipped to the last bus channel, but will wrap around.

returns:: A UGen output, usually an array of UGens or, if the arguments are arrays, an array of arrays.


INSTANCEMETHODS::


EXAMPLES::

code::
(
s.waitForBoot({
	b = Bus.control(s, 3);
	b.setn([1, 10, 100]);
})
)
{ InBus.kr(b, 1, 0).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 1, 1).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 1, 2).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 1, 3).poll(2, "val"); 0.0 }.play;


{ InBus.kr(b, 2, 0).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 3, 0).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 4, 0).poll(2, "val"); 0.0 }.play;

{ InBus.kr(b, 3, 5).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 3, 5, \wrap).poll(2, "val"); 0.0 }.play;

 InBus.kr(b, 2, [1, 3, 4]); // multi channel expansion

{ InBus.kr(b, 1, MouseX.kr(0, 10).round.poll(2, "index")).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 2, MouseX.kr(0, 10).round.poll(2, "index")).postln.poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 3, MouseX.kr(0, 10).round.poll(2, "index")).postln.poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 4, MouseX.kr(0, 10).round.poll(2, "index")).postln.poll(2, "val"); 0.0 }.play;

{ InBus.kr(b, 1, MouseX.kr(0, 10).round.poll(2, "index"), \wrap).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 2, MouseX.kr(0, 10).round.poll(2, "index"), \wrap).postln.poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 3, MouseX.kr(0, 10).round.poll(2, "index"), \wrap).postln.poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 4, MouseX.kr(0, 10).round.poll(2, "index"), \wrap).postln.poll(2, "val"); 0.0 }.play;

::