Tuesday, October 30, 2007

Week 12

Creative Computing : Spatialisation

Materials for the week

* Mix.rtf : Mixes an array of channels down to a single channel or an array of arrays of channels down to a single array of channels.

// Mix an array of channels
{ Mix.new([ ClipNoise.ar(0.2), FSinOsc.ar(440, 0.1), LFSaw.ar(20, 0.1)]) }.play;

( // fill an array of channels
{
n = 18; // number of voices
Mix.fill(n, { SinOsc.ar(50 + 500.0.rand, pi, 0.05) });
}.play;
)

* MultiOutUGen.rtf : A superclass for all UGens with multiple ouptuts.MultiOutUGen creates the OutputProxy ugens needed for the multiple outputs.

* OutputProxy.rtf : A place holder for multiple outputs,sometimes used by Ugens.
// Pan2 uses an OutputProxy for each of its two outputs.
({
var out;
out = Pan2.ar(WhiteNoise.ar, SinOsc.kr(0.5));
out}.play;
)
* BiPanB2.rtf : Encodes a two channel signal to two dimensional ambisonic B-format.This puts two channels at opposite poles of a 2D ambisonic field.This is one way to map a stereo sound onto a soundfield.It is equivalent to:
PanB2(inA, azimuth, gain) + PanB2(inB, azimuth + 1, gain)
BiPanB2.kr(inA, inB, azimuth, gain)
{
var w, x, y, source1, source2, a, b, c, d;

source1 = SinOsc.ar(200);
source2 = SinOsc.ar(202);

// B-format encode
#w, x, y = BiPanB2.ar(inA: source1,
inB: source2,
azimuth: MouseX.kr(-1,1),
gain: 0.1);

// B-format decode to quad
#a, b, c, d = DecodeB2.ar(numChans: 4,
w: w,
x: x,
y: y
);
[a, b, d, c] // reorder to speaker arrangement: Lf Rf Lr Rr
}.play;

* DecodeB2.rtf : 2D Ambisonic B-format decoder.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.
( // Theremin model
{
var theremin, w, x, y, a, b, c, d;

theremin = SinOsc.ar(freq: MouseY.kr(3200, 200, lag: 0.5, warp: 1)
*
SinOsc.kr(freq: 6, mul: 0.02, add: 1), // Vibrato
mul: abs(MouseX.kr(0.02, 1))
); //Amplitude

// B-format encode
# w, x, y = PanB2.ar(in: theremin,
azimuth: SinOsc.kr(2* pi),
gain: 0.5
);

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

[a, b, d, c] // reorder to speaker arrangement: Lf Rf Lr Rr
}.play;
)
* LinPan2.rtf : Two channel linear panner.
"Sounds more like the Rhodes tremolo than Pan2."
{ Out.ar(0, LinPan2.ar(VarSaw.ar([200, 201], pi, 0.1), SinOsc.kr(1))) }.play;

* LinXFade2.rtf :
Two channel linear crossfader.
{ LinXFade2.ar(FSinOsc.ar([800,804], 0, 0.2), VarSaw.ar(0.2), FSinOsc.kr(pi)) }.play;
* Pan2.rtf : Two channel equal power panner.
(
{Pan2.ar( //pan position
FSinOsc.ar(exprand(700, 2000), 0,
max(0, LFNoise1.kr(3/5, 0.9))),
LFNoise1.kr(1))
}.play(s)
)
* Pan4.rtf : Four channel equal power panner.
( // phone ring
{
var lfo,in;
lfo = LFPulse.ar(freq: 15, mul: 200, add: 1000);
in = SinOsc.ar(lfo, mul: 0.5);
in = Pan4.ar(in, SinOsc.kr(2), VarSaw.kr(1.2),1);
}.play
)
* PanAz.rtf : Azimuth panner : Multichannel equal power panner.
Server.internal.boot;
(
{
var trig, out, delay;
trig = Impulse.kr(freq: 10);
out = Blip.ar(
freq: TRand.kr(0, 50, trig).midicps,
numharm: TRand.kr(1, 12, trig),
mul: max(0, TRand.kr(-0.5, 0.4, trig))
);
out = Pan2.ar(in: out,
pos: TRand.kr(-1.0, 1.0, trig)
);

out = out * EnvGen.kr(Env.perc(attackTime: 0,
releaseTime: 1),
gate: trig
);
out = Mix.ar({out}.dup(12))*0.2;
delay = CombL.ar(in: out,
maxdelaytime: 2.0,
delaytime: 4/6,
decaytime: 0.1
);
out = out + delay;

// five channel circular panning
PanAz.ar(
numChans: 5,
in: out,
pos: LFSaw.kr(MouseX.kr(0.1, 10, 'exponential')),
level: 0.5,
width: 3
);
}.play(Server.internal);
Server.internal.scope;
)

* PanB.rtf : Ambisonic B format panner.decodes over 4 channels.
* PanB2.rtf : 2D Ambisonic B-format panner. Encodes a mono signal to two dimensional ambisonic B-format.
* Rotate2.rtf : Rotates a sound field : Rotate2.kr(x, y, pos)
Rotate2 can be used for rotating an ambisonic B-format sound field around an axis.It 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:
xout = cos(angle) * xin + sin(angle) * yin;
yout = cos(angle) * yin - sin(angle) * xin;
where angle = pos * pi, so that -1 becomes -pi and +1 becomes +pi.

* SelectX.rtf : =Mix one output from many sources
The output is mixed from an array of inputs, linearly interpolating from two adjacent channels.

* SelectXFocus.rtf : Mix one output from many sources.

The output is mixed from an array of inputs, linearly interpolating from a number of adjacent channels.A focus argument allows to control how many adjacent sources are mixed. (by adc)

* Splay.rtf :
Splay spreads an array of channels across the stereo field.
* SplayZ.rtf : SplayZ spreads an array of channels across a ring of channels.
* XFade2.rtf : Equal power two channel cross fade.
* Select.rtf : Select one output from many sources.

References :

* Haines.Christian."Workshop-12-sem2, conducted on Spatialisation .Programming with SuperCollider".25 October'2007.Electronic Music Unit.University of Adelaide, South Australia.
* McCartney , James et al . 2007,SuperCollider Inbuilt Help.
* Source Forge, http://supercollider.sourceforge.net/

Audio Arts : Film Sound
Class Notes:
* Sourround Sound in Film
*Dialogue; To be crystal clear in the mix. You could filter out the music/ frequencies from the range of 600Hz till 3Khz, from the mix so that the dialogue becomes clear.
Ducking :
It is an effect where the level of one signal is reduced by the presence of another signal, through the use of side chain compression.
Side-chaining uses the dynamic level of another input to control the compression level of the signal.
* THX ( Tomlinson Holman's experiment )is the trade name of a high-fidelity sound reproduction standard for movie theaters, screening rooms, home theaters, computer speakers, gaming consoles, and car audio systems.Itwas developed by Tomlinson Holman at George Lucas's company Lucasfilm in 1982 .THX is mainly a quality assurance system, a playback environment to ensure that any film soundtrack mixed in THX will sound as near as possible to the intentions of the mixing engineer.

(Dolby Digital, SDDS) or analog (Dolby SR, Ultra-Stereo), can be "shown in THX.

References:
Harrald.Luke.2007.Audio Arts 3.Film Sound.Electronic Music Unit.University of Adelaide, South Australia.
* http://en.wikipedia.org/wiki/THX ,viewed on 31.Oct'07
* http://www.thx.com, viewed on 31.Oct'07

No comments: