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

Monday, October 22, 2007

Week 11

Creative Computing : FFT(2)

Keywords :
* Josh_PV_Ugens
PV_EvenBin : Returns the even numbered bins in an FFT buffer, resynthesize only even bins. Similarly PV_OddBin resynthesize only odd bins
PV_FreqBuffer(buffer, databuffer) : stores the freq values from an FFT analysis into a buffer to be used outside the FFT process
databuffer - a buffer of (fft buffer size / 2) for storing freq or mag data in
PV_Invert :
PV_MagBuffer(buffer, databuffer) : Store FFT data in another buffer for other uses.
databuffer - a buffer of (fft buffer size / 2) for storing freq or mag data in
PV_MagMap : Remap magnitudes to a new mag curve
PV_MaxMagN : return the N strongest bins
PV_MinMagN : return the N weakest bins
PV_NoiseSynthF : Decisions are based on whether or not freq data across numFrames is within a given threshold.return only bins that are unstable.
PV_NoiseSynthF(buffer, threshold, numFrames)
PV_NoiseSynthP : PV_NoiseSynthP and PV_PartialSynthP base these decisions on whether or not phase data across numFrames is within a given threshold.
buffer - the FFT buffer
threshold - a phase value (in radians) with which to allow values to pass through or be zeroed out
numFrames - the number of FFT frames needed to make the above decision
initflag - if 0, all bins are zeroed out while the initial is calculated, if 1, all bins pass through.

PV_OddBin : Return the odd numbered bins in an FFT buffer

MCLD Ugens

CQ_Diff : Logarithmic spectral difference measure.
CQ_Diff.kr(in1, in2, databufnum)
FFTDiffMags: Compares the spectra of two signals, finding the magnitude of the difference for each frequency bin. These differences are averaged onto the (control-rate) output.
FFTDiffMags.kr(chain1, chain2)

FFTFlatness : Calculates the Spectral Flatness Measure, defined as a power spectrum's geometric mean divided by its arithmetic mean. This gives a measure which ranges from approx 0 for a pure sinusoid, to approx 1 for white noise.
FFTFlatnessSplitPercentile : Splits the FFT power spectrum into two parts - above and below a given percentile and then calculates the spectral flatness measure for the two parts of the spectrum.
# lower, upper = FFTFlatnessSplitPercentile.kr(chain, fraction)
FFTFlux : Calculates the spectral flux of the signal, which is a measure of the rate of change of the FFT power spectrum. It measures the difference between the current and previous FFT frames, by calculating the 2-norm (the Euclidean distance between the two spectra) after normalising for power.
FFTInterleave : Takes two FFT "chain" signals and mixes them together. The FFT data is not actually combined, rather the trigger signals which indicate that a new FFT buffer is ready for processing are combined. The first chain takes priority: if both chains fire at the same time, then the frame from the second will be ignored.
FFTPercentile : Calculates the cumulative distribution of the frequency spectrum, and outputs the frequency value which corresponds to the desired percentile.
FFTPower : Sum of instantaneous FFT magnitudes.Operates on the frequency-domain rather than time-domain representation.
FFTSubbandPower : Calculates the spectral power measure, in the same manner as FFTPower, but divides the spectrum into (adjacent, non-overlapping) subbands, so returns separate power measures for the different subbands.
#[power1, power2, ... powerN+1] = FFTSubbandPower.kr(chain, [cutfreq1, cutfreq2, ... cutfreqN], incdc)
FFTTriggered : Based on [FFT], but analyses the signal only when triggered, rather than in a continuous sequence. The point is to be able to synchronise analysis windows exactly with trigger signals. Its purpose is for spectral analysis rather than "phase vocoder" manipulation, since IFFT typically won't be able to reconstruct a continuous audio signal.
chain = FFTTriggered(buffer, input, trig, maxoverlap=0.5)
FincoSprottL : chaotic system UGen
FincoSprottM : chaotic system UGen
FincoSprottS : chaotic system UGen
ListTrig : Emit a sequence of triggers at specified time offsets
Logger : Store values to a buffer, whenever triggered
RosslerL : A strange attractor discovered by Otto Rossler based on work in chemical kinetics.
The system is composed of three ordinary differential equations:

x' = - y - z
y' = x + ay
z' = b + z(x - c)

Readings :
More Simple Chaotic Flows with ABS Nonlinearity : http://sprott.physics.wisc.edu/chaos/finco/abs.html
some of the examples might use the FFT plugins from the library of Bhob Rainey
http://bhobrainey.net

Referenes:
* Haines.Christian."Workshop-11-sem2 conducted on Fast fourier Transform .Programming with SuperCollider".18 October'2007.Electronic Music Unit.University of Adelaide, South Australia.
* Parmenter, Josh 2007, JoshPV SuperCollider Library, 2007,
* Stowell, Dan. 2007, Signal Analysis - SuperCollider Plugins - MCLD UGens, 2007,
* IXI Tutorial 10 on FFT. www.ixi-software.net
* McCartney , James et al . 2007,SuperCollider Inbuilt Help.
* Source Forge, http://supercollider.sourceforge.net/

Audio Arts : Film Music
This week was presenting a draft for our alloted films. If you are not aware, I am doing the film made by Dan. I like the feel and question raised in the film, " What is Music". So far I have added the background track and the audio present with the video. I somehow like the minimalist characterstic to what I presented. After spending a bit more time on the musical ideas, I thought they are not really required. After adding the foley sounds the film can have a quite a different and unique characterstic to it. I do want to implement a paced motive when the car scecne comes up. Ther are two interviews in the film with a little more voice to be added on. The sound design work has to be quite precise and effective. Thats where i am .. What is Music : -- succesfully conveying the idea across and convincing the listener that this is music - Mark carrol ..

Wednesday, October 17, 2007

Week 10

Creative Computing : GUI(3)

Keywords and lecture Notes:

* BoxGrid.help.rtf :
* Grid.help.rtf :
* MIDIKeyboard.help.rtf :
* ParaSpace.help.rtf :
* ScrollNumberBox.help.rtf :
* Software, IXI 2006, Experimental Music Software -
Backyard, IXI, 2007... www.ixi-software.net

Task of the Week:
===================================================================
/*
VarSaw : Variable duty saw
Lag2 : It is equivalent to Lag.kr(Lag.kr(in, time), time), thus resulting in a smoother transition. This saves on CPU as you only have to calculate the decay factor once instead of twice.
*/
// Sound Source
(
SynthDef("saw+tri",{|freq, amp=0.90|

var signal,
signal1;

signal = VarSaw.ar(Lag2.kr(freq, 60.1), 0, amp)!2;
signal1 = LFTri.ar(Lag3.kr(freq, 62.1), 0, amp)!2;
signal = (signal * signal1) ;
Out.ar(0, signal);
}).load(s);
)
/* List is a subclass of SequenceableCollection with unlimited growth in size.
SCWindow : User interface Window
ParaSpace is a GUI widget, similar to the SCEnvelopeView, but has some
additional functionality and it is easier to use. One can select many nodes
at the same time and drag them around.
A Synth is the client-side representation of a synth node on the server. It represents a single sound producing unit.
*/
// Set up the ParaSpace
(
l = List.new;
w = SCWindow("ParaSpace", Rect(10, 500, 800, 300));
a = ParaSpace.new(w, bounds: Rect(20, 20, 760, 260));

76.do({arg i;
a.createNode(3+(i*10), 130);
l.add(Synth("saw+tri", [\freq, 150, \amp, 0.04])); // starting frequency
});
75.do({arg i;
a.createConnection(i, i+1);
});

/* Task is a pauseable process. It is implemented by wrapping a PauseStream around a Routine. Most of it's methods (start, stop, reset) are inherited from PauseStream.
SystemClock is more accurate, but cannot call Cocoa primitives.
AppClock uses NSTimers but is less accurate,it can call Cocoa primitives.
*/
t = Task({
var d;
inf.do({arg i;
76.do({arg j;
d = ((i*(j/100)).sin*120)+130;
a.setNodeLoc_(j, 3+((j%76)*10), d);
l[j].set(\freq, 500+(400 - (d*4))); // emerging frequency,travelling range
});
0.25.wait;
})
}, AppClock);
t.start;
)
t.stop;
===========================================================

References :
Referenes:
* Haines.Christian."Workshop-10-sem2 conducted on GUI(3) .Programming with SuperCollider".11 October'2007.Electronic Music Unit.University of Adelaide, South Australia.
* IXI softwares, www.ixi-software.net
* McCartney , James et al . 2007,SuperCollider Inbuilt Help.
* Source Forge, http://supercollider.sourceforge.net/

Tuesday, October 09, 2007

Week 9

Creative Computing : GUI(2)
Keywords for the Week:
* Color : Each component has a value from 0.0 to 1.0 except in new255 :
Color.new(red, green,blue, alpha), Color.rand(hue, sat, val, alpha)
* Document: Opens up a text document.Document(title, text, isPostWindow);
background_set the background color of a Document
(
a = Document("background", "'documentwindow");
a.background_(Color.blue(alpha:0.8));
)

* Font : command-T to look for Font names.
* SC2DSlider : 2 dimensional slider
* SC2DTabletSlider : a 2D slider with support for extended wacom data
* SCButton : each state: [ name, text color, background color ] . Failure to set any states at all results in an invisible button.
SCCompositeView : A view that contains other views.
SCEnvelopeView : opens the envelope window whose nodes can be moved.
SCHLayoutView : Puts the sliders etc horizontally in a formatted layout.
SCVLayoutView : Puts the sliders etc vertically in a formatted layout.
SCMultiSliderView : Multisliders in a single window.
SCNumberBox : Number Box
SCPopUpMenu : Pop up menu
SCRangeSlider : sliders within a specified range
SCTabletView : Tablet view. Can receive data ffrom wacom or mouse.
SCTextField : Text based entry
SCView : SCView is the abstract superclass for all SC GUI widgets.
SCWindow : User Interface window : SCWindow.new(name, bounds, resizable, border);
resize : resize behavior for SCView..
1 - fixed to left, fixed to top
2 - horizontally elastic, fixed to top
3 - fixed to right, fixed to top

4 - fixed to left, vertically elastic
5 - horizontally elastic, vertically elastic
6 - fixed to right, vertically elastic

7 - fixed to left, fixed to bottom
8 - horizontally elastic, fixed to bottom
9 - fixed to right, fixed to bottom
-------------------------------------------------------------------------
Quiz : The error was there should be "states" instead of "state"..
Right : but.states = [["suffering",Color.black,Color.red] and not
Wrong : but.state = [["suffering",Color.black,Color.red],
code
(
var win, but;

win = SCWindow(
name: "Panel"
);
win.front;

but = SCButton(
parent: win,
bounds: Rect(20, 20, 230, 50)
);
but.states = [["suffering",Color.black,Color.red],
["living",Color.black,Color.blue]];
but.action = {"hello".postln;}
)

References :
* Haines.Christian."Workshop-9-sem2 conducted on GUI(2) .Programming with SuperCollider".4 October'2007.Electronic Music Unit.University of Adelaide, South Australia.
* IXI softwares, www.ixi-software.net
* McCartney , James et al . 2007,SuperCollider Inbuilt Help.
* Source Forge, http://supercollider.sourceforge.net/

Film Sound:
Forum : Bent Leather Band

Mid sem break

What did i do << had to move my house, one of the key problems i have faced in being here as an international student(which was obviously my decision)..Do i need that, wont it be nice to go back home, have a stable place,my own place, a permanent drumkit/percussion setup/piano and my own studio setup and I can spend all my time, without worrying literally about anything.. the answer is I have already spent that time, now I am away fom home, far away and the time for that is over,it wil come bacj though, nt now, however I am in search of another home, is it adeladie, not so far, not in 4 years, how cum now.. {i hate to move * inf;}.println
I did have some great time in the holidays, although not alot of study, alas, I am kicking now babay, dont you worry, I will fly high,I believe can fly, I believe i can touch the sky,tara ra ra ra rara,I want to spead my wings and flyaway.. shhhhhhhhhhhhhhhhhh