SuperCollider workshops in New York, early April

SUPERCOLLIDER WORKSHOPS APRIL 2009

All details and sign-up at:
http://tinyurl.com/harvestcollider


SuperCollider workshops will be offered at Harvestworks in New York in early April, in the run up to the 2009 SuperCollider Symposium to be held at Wesleyan. This is a rare opportunity to learn from some of the SuperCollider developers themselves. SuperCollider is an incredible environment and programming language for music and audio. It provides an interpreted object-oriented language which functions as a network client to a state of the art, realtime sound synthesis server. SuperCollider was written by James McCartney over a period of many years, and is now an actively maintained and developed open source project. It is used by musicians, scientists, and artists working with sound and audiovisuals.

All workshops require attendees to bring their own laptops; tutors will assist with installation on OS X (10.4 or later recommended) and Windows as necessary (SC also runs on Linux but it’s assumed you’d have compiled and installed it yourself in advance of the workshop if you’re using that platform).

The workshops being offered are:

1) Saturday 4th April: Beginners day (11am-6pm). A friendly introduction to SuperCollider for absolute beginners, aimed at artists and musicians. Aside from a little familiarity with the digital arts, no prerequisites, though some prior exposure to computer music (perhaps through Max/MSP or Csound) may be helpful. (led by Nick Collins, Dan Stowell, Jan Trützschler) $100

2) Sunday 5th April: Intermediate workshop day (11am-6pm). For those with some experience, but wanting to refresh and broaden their SC skills. Topics will include sound synthesis and analysis, interaction via GUI and controllers, generative and network music, SC programming tips and tricks and SC architecture. We will also be adaptable to participants needs, can take requests for topics, and have some general question and answer sessions. (led by Nick Collins, Dan Stowell, Jan Trützschler) $100

3) Monday 6th April evening (7-10pm). Beginner’s evening session. A friendly introduction to SuperCollider for absolute beginners, aimed at artists and musicians. Aside from a little familiarity with the digital arts, no prerequisites, though some prior exposure to computer music (perhaps through Max/MSP or Csound) may be helpful. (led by Nick Collins, Dan Stowell, Jan Trützschler)

4) Tuesday 7th April daytime (11-6). Abstract pressure cookers and virtual steam machines: Just in time programming in networks.
Not tweaking machines, but writing letters: Programs that program programs, machines that recombine structures. Replacing their parts, in effect writing their user manual at runtime. Instead of giving in to pressure to become virtuosos, we listen how the machines take the pressure – from spooky action at a distance to new exploring logics of distributed noise music. A collective workshop for live coding, sound synthesis, randomness in order. (led by Powerbooks Unplugged) $100

5) Tuesday 7th April evening (7-10pm). Compact version of Tuesday daytime session (led by Powerbooks Unplugged) $50

6) Wednesday 8th April daytime (11-6) SuperCollider Clinic. Flexible topic sessions, following participant needs, adaptable to all intermediate levels (beginners would find Saturday or Mon night helpful before this workshop). Developers will be on hand to answer questions, to present on special topics, and to demonstrate projects and works built with SC. (led by an all star cast of developers) $100

28. ListPatterns

ListPatterns

ListPattern은 여러 방법으로 오브젝트의 array를 반복해서 실행하는 방법이다. 모든 ListPatterns은 공통적으로 instance variables list and repeats를 가진다. List variable 은 array로 구성되어 반복적으로 실행되어질 값들이며, repeats variable은 얼마만큼 실행할것인지를 지정해준다. default repetition은 1이다.

대표적인 예로 Pseq가 있다.

(
var a, b;
a = Pseq.new(#[1, 2, 3], 2); // 1, 2, 3을 2번 반복.
b = a.asStream;//stream으로 만들어 줍니다. 
7.do({ b.next.postln; });
)

위를 실행해보면, 총 7번 실행해야 하는데 stream은 6개의 값(1,2,3,1,2,3)만 가지고 있어서 마지막 값은 nil이 나오고 7을 출력해주는데, 그 7은 stream에 있는 수가 아닌 do의 실행횟수를 의미합니다. 

(
var a, b;
a = Pseq.new(#[1, 2, 3, 4], 3, 2); // repeat 3, offset 2, 실행시켜보면 3부터 읽기 시작합니다.
b = a.asStream;
13.do({ b.next.postln; });
)

Pseq을 pitch 값으로 사용해 봅니다. 

(
s = Server.internal;
SynthDef( “Help-SPE3-SimpleSine”, {
 arg freq, sustain=1.0;
 var osc;
 osc = SinOsc.ar( [freq,freq+0.05.rand] ) * EnvGen.ar( 
  Env.perc, doneAction: 2, levelScale: 0.3, timeScale: sustain
 );
 Out.ar(0,osc);
}).send(s);
)

(
var a, d;
a = Pseq(#[60, 61, 63, 65, 67, 63], inf ).asStream.midicps;//숫자들을 midi값으로 지정해주고
d = 0.3;
Task({
 12.do({
  Synth(“Help-SPE3-SimpleSine”, [ freq, a.next, sustain, d ]);
  d.wait;
 });
}).play
)
Pser는 list의 수를 순서대로 주어진 수 만큼 출력한다. 
(
var a, b;
a = Pser.new(#[1, 2, 3], 5); // return 5 items
b = a.asStream;
6.do({ b.next.postln; });
)
Prand는 주어진 수를 random으로 추출하여 두번째 argument에 주어진 수 만큼 출력한다.
(
var a, b;
a = Prand.new(#[1, 2, 3, 4, 5], 6); // return 6 items
b = a.asStream;
7.do({ b.next.postln; });
)
(
var a, d;
a = Prand(#[60, 61, 63, 65], inf).midicps.asStream;//inf라고 되어있는것은 무한대로 추출한다는 뜻. 값의 중복도 일어남.
d = 0.3;
Task({
 12.do({
  Synth(“Help-SPE3-SimpleSine”,[freq, a.next]);
  d.wait;
 });
}).play;
)
Pxrand 는 Prand와 비슷하지만, Prand 에서 처럼 이웃하는 값이 중복값으로 주어지지 않는다. 
(
var a, b;
a = Pxrand.new(#[1, 2, 3], 10); // return 10 items
b = a.asStream;
11.do({ b.next.postln; });
)
Psuf는 Pser와 값으나 그 값이 scramble 된다. 그러나 이와 Pxrand 와 다른점은 list가 단 한번 scramble된 후, 그것을 반복한다.
(
var a, b;
a = Pshuf.new(#[1, 2, 3, 4], 3);
b = a.asStream;
13.do({ b.next.postln; });
)
(
var a, b;
a = Pshuf(#[60, 61, 65, 67], inf).midicps.asStream;
Task({
 12.do({
  Synth(“Help-SPE3-SimpleSine”,[freq, a.next]);
  0.5.wait;
 });
}).play;
)

Nesting Patterns

Pattern을 Pattern내부에 사용하여 Stream을 만들수 있다.
(
var a, b;
a = Pseq.new([1, Pseq.new([100,200], 2), 3], 3); 
b = a.asStream;
19.do({ b.next.postln; });
)
(
var a, b;
a = Prand.new([
  Pseq.new([1, 2], 2), 
  Pseq.new([3, 4], 2), 
  Pseq.new([5, 6], 2)
 ], 3); 
b = a.asStream;
13.do({ b.next.postln; });
)
//Pitch변화를 위한 Sequence. 
(
var a;
a = Prand([
  Pseq(#[60, 61, 63, 65, 67, 63]),
  Prand(#[72, 73, 75, 77, 79], 6),
  Pshuf(#[48, 53, 55, 58], 2)
 ], inf 
).midicps.asStream;
Task({
 loop({
  Synth( “Help-SPE3-SimpleSine”, [freq, a.next.postln] );
  0.3.wait;
 });
}).play;
)
(
var a;
a = Pseq(#[60, 62, 63, 65, 67, 63], inf) + Pseq(#[0, 0, 0, 0, -12], inf);
a = a.asStream.midicps;
Task({
 25.do({
  Synth(“Help-SPE3-SimpleSine”,[freq, a.next]);
  0.3.wait;
 });
}).play;
)




27. Environment

Environments 와 Events는 patterns을 위한 상징적인 event framework를 세우기 위해 사용되며, pattern을 사용한 composition을 컨트롤 하도록 한다. 

-Environment

Environment 는 IdentityDictionary으로 symbol들을 value들로 맵핑한다. 
언제나 하나의 current Environment가 존재하여 class Object의 currentEnvironment class variable에 저장된다.

Symbol 과 value는 다음과 같이 하나의 짝으로 current Environment에 저장된다.:

currentEnvironment.put(myvariable, 999);

다시 symbol에 저장된 값을 보고 싶다면 다음과 같이 출력한다.

currentEnvironment.at(myvariable).postln;

맨위에 있는 것을 다음과 같이 간단하게 쓸 수 있다. :

~myvariable = 888;

또한 값을 확인하려면:

~myvariable.postln;


-Environment 만들기

Environment는 class method “make”로 만들어 진다. 그리고 그 안에 값을 저장한다. 
make가 하는일은 일시적으로 current Environment에 새로운 값을 할당하는 일이다. 

(
var a;
a = Environment.make({
 ~a = 100;
 ~b = 200;
 ~c = 300;
});
a.postln;
)

-Environment 사용하기 

instance method “use” 는 currentEnvironment의 값을 사용하도록 한다.

(
var a;
a = Environment.make({
 ~a = 10;
 ~b = 200;
 ~c = 3000;
});
a.use({
 ~a + ~b + ~c
}).postln;
)

There is also a use class method for when you want to make and use the result from an Environment directly.

(
var a;
a = Environment.use({
 ~a = 10;
 ~b = 200;
 ~c = 3000;
 ~a + ~b + ~c
}).postln;
)

-current Environment로부터 arguments와 함께 Function불러내기

아래 예제를 보면, x, y, z를 가진 function f 를 생성하여, 그 값을 .valueEnvir(또는 valueArrayEnvir)를 통해서 지정해준다. 여기서 지정되지 않은 값은 .use에 있는 값으로 사용된다. 

(
var f;

//function
f = { arg x, y, z; [x, y, z].postln; };

Environment.use({
 ~x = 7;
 ~y = 8;
 ~z = 9;
 
 f.valueEnvir(1, 2, 3); // 모든 값이 설정됨
 f.valueEnvir(1, 2); // z 는 current Environment lookup에서
 f.valueEnvir(1); // 
 f.valueEnvir; // 
 f.valueEnvir(z: 1); // 
});
)

다음은 SynthDefs와 함께 Environment를 사용할 수 있는 예제를 보자.
아래와 같이 3개의 function들이 각각 freq, amp 와 pan 의 argument들이 서로 다른 순서로 설정되었으나, 그것과 상관없이 valueEnvir 가 environment에서 각각의 값을 불러낼 수 있다.

(
var a, b, c, n;

n = 40;
a = { arg freq, amp, pan;
 Pan2.ar(SinOsc.ar(freq), pan, amp);
};
b = { arg amp, pan, freq;
 Pan2.ar(RLPF.ar(Saw.ar(freq), freq * 6, 0.1), pan, amp);
};
c = { arg pan, freq, amp;
 Pan2.ar(Resonz.ar(GrayNoise.ar, freq * 2, 0.1), pan, amp * 2);
};

Task({
 n.do({ arg i;
  SynthDef(“Help-SPE4-EnvirDef-” ++ i.asString, {//n개 만큼의 SynthDef가 만들어 지려면 그 각각 이름에 다른 번호가 매겨지도록 사용된 것이 ++i.asString이다. 
  var out;
  Environment.use({
  //environment에 값을 지정해준다.
  ~freq = exprand(80, 600);
  ~amp = 0.1 + 0.3.rand;
  ~pan = 1.0.rand2;
   
  // 다음은 random으로 instrument function을 그 value와 함께 고르도록 한다.
  out = [a,b,c].choose.valueEnvir;
  });
  out = CombC.ar(out, 0.2, 0.2, 3, 1, out);
  out = out * EnvGen.kr( 
  Env.sine, doneAction: 2, timeScale: 1.0 + 6.0.rand, levelScale: 0.3 
  );
  Out.ar( 0, out );
  }).send(s);//서버에 보내는것을 잊지 말아야.
  0.02.wait;//task에 사용될 시간 지정
 });
 loop({
  Synth( “Help-SPE4-EnvirDef-” ++ n.rand.asString .postln);//random으로 synthdef를 뽑도록 해준다. 
  (0.5 + 2.0.rand).wait;//여기서 바로 synth를 불러준다. 
 });
}).play;
)