File: DecodeB2.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 (69 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download | duplicates (6)
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
class:: DecodeB2
summary:: 2D Ambisonic B-format decoder.
related:: Classes/BiPanB2, Classes/PanB, Classes/PanB2, Classes/Rotate2
categories::  UGens>Multichannel>Ambisonics


Description::

Decode a two dimensional ambisonic B-format signal to a set of speakers
in a regular polygon. The outputs will be in clockwise order. The
position of the first speaker is either center or left of center.


classmethods::

method::ar, kr

argument::numChans

Number of output speakers. Typically 4 to 8.


argument::w

The B-format signal.


argument::x

The B-format signal.


argument::y

The B-format signal.


argument::orientation

Should be zero if the front is a vertex of the polygon. The first
speaker will be directly in front. Should be 0.5 if the front
bisects a side of the polygon. Then the first speaker will be the
one left of center.

returns::
An array of channels, one for each speaker.

Examples::

code::

(
{
	var w, x, y, p, a, b, c, d;

	p = PinkNoise.ar; // source

	// B-format encode
	#w, x, y = PanB2.ar(p, MouseX.kr(-1,1), 0.1);

	// B-format decode to quad
	#a, b, c, d = DecodeB2.ar(4, w, x, y);

	[a, b, d, c] // reorder to my speaker arrangement: Lf Rf Lr Rr
}.play;
)

::