Tuesday, March 11, 2008

CC3 Week 1 - Introduction To SuperCollider I

Everyone was surprised to see me back at uni this year after my constant complaining about Max/MSP last year. I suppose this year could be the same with SuperCollider (SC), but we don't know yet. After our first class today, I felt that SC could be easier to work with simply because it seems to work linearly. Obviously I haven't really started using it yet so I can't make any assumptions just yet.

I have a decent mathematical background so I think I will be fine with the logical side of the programming language. I just need to learn the syntax. For this week's exercise I just put strings together and also created some mathematical functions. I couldn't work out how to do a power symbol (i.e. ^). If anyone knows let me know.

[1]
Photobucket
the original SuperCollider. . .


(
// Function 1 - Basic Maths

x = 10;
y = 20;
z = 30;
(x - y * z).postln;
)


(
// Function 2 - Maths

x = 10;
y = 20;
z = 30;
(x + y / z).postln;
)



(
// Function 3 - Maths

var one, two, three;
one = 1;
two = 2;
three = 3;
(one + two + three).postln;
)



(
// Function 4 - Maths

var apple, pear, orange, banana;
apple = pi;
pear = 12.5;
orange = 100;
banana = 1000;
(apple / orange + banana * pear).postln;
)



(
// Function 5 - Strings

a = "this";
b = "is";
c = "a";
d = "string";
e = "......woohoo!";

(a + b + c + d + e).postln;

)



(
// Function 6 - Strings

a = "there";
b = "is";
c = "no";
d = "spoon";

(a + b + c + d).postln;

)



(
// Function 7 - Complex Maths

f = {
arg a,b,c,d;

var apple = 19.8;
apple.postln;

(a - b - c - d + pi * a * b * c * d).postln;
};

f.value(10000,1000,100,10);
)



(
// Functions 8 - Complex Maths

f = {
arg a,b,c,d;

var piano = pi;
piano.postln;

(tan(sin(a - b - c - d * c * b * a))).postln;

};

f.value(121,232,343,454);
)



(
// Functions 9 - Complex Maths

f = {
arg a,b;

((1 / b) * (a*(sin(cos(cos(a - b * b * a)))))).postln;

};

f.value(pi,12.34);
)


(
// Function 10 - Strings

a = "Finally";
b = "this";
c = "is";
d = "it!";

(a + b + c + d).postln;

)


[1] Neatorama, 'Super Conduction SuperCollider'. www.neatorama.com (Accessed 12th March 2008)
[2] Christian Haines. "Creative Computing: Semester 1 - Week 1 - Introduction To SuperCollider". Lecture presented at the Electronic Music Unit, University of Adelaide, South Australia, 6th March 2008.