/usr/share/SuperCollider/HelpSource/Classes/Rotate2.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | class:: Rotate2
summary:: Rotate a sound field.
related:: Classes/BiPanB2, Classes/DecodeB2, Classes/PanB, Classes/PanB2
categories:: UGens>Multichannel>Ambisonics, UGens>Multichannel>Panners
Description::
Rotate2 can be used for rotating an ambisonic B-format sound field around
an axis. Rotate2 does an equal power rotation so it also works well on
stereo sounds. It takes two audio inputs (x, y) and an angle control
(pos). It outputs two channels (x, y). It computes this:
code::
xout = cos(angle) * xin + sin(angle) * yin;
::
code::
yout = cos(angle) * yin - sin(angle) * xin;
::
where angle = pos * pi, so that -1 becomes -pi and +1 becomes +pi. This
allows you to use an LFSaw to do continuous rotation around a circle.
classmethods::
method::ar, kr
argument::x
Input signal X.
argument::y
Input signal Y.
argument::pos
angle to rotate around the circle from -1 to +1. -1 is 180
degrees, -0.5 is left, 0 is forward, +0.5 is right, +1 is behind.
Examples::
code::
(
{
var w, x, y, p, q, a, b, c, d;
p = WhiteNoise.ar(0.05); // source
q = LFSaw.ar(200,0,0.03)+LFSaw.ar(200.37,0,0.03)+LFSaw.ar(201,0,0.03);
// B-format encode 2 signals at opposite sides of the circle
#w, x, y = PanB2.ar(p, -0.5) + PanB2.ar(q, 0.5);
#x, y = Rotate2.ar(x, y, MouseX.kr(-1,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;
)
// Rotation of stereo sound:
(
{
// rotation via lfo
var x, y;
x = PinkNoise.ar(0.4);
y = LFTri.ar(800) * LFPulse.kr(3,0,0.3,0.2);
#x, y = Rotate2.ar(x, y, LFSaw.kr(0.1));
[x,y]
}.play;
)
{
// rotation via mouse
var x, y;
x = Mix.fill(4, { LFSaw.ar(200 + 2.0.rand2, 0, 0.1) });
y = SinOsc.ar(900) * LFPulse.kr(3,0,0.3,0.2);
#x, y = Rotate2.ar(x, y, MouseX.kr(0,2));
[x,y]
}.play;
// Rotate B-format about Z axis:
wout = win;
zout = zin;
#xout, yout = Rotate2.ar(xin, yin, pos);
// Rotate B-format about Y axis:
wout = win;
yout = yin;
#xout, zout = Rotate2.ar(xin, zin, pos);
// Rotate B-format about X axis:
wout = win;
xout = xin;
#yout, zout = Rotate2.ar(yin, zin, pos);
::
|