122 lines
1.3 KiB
Python
122 lines
1.3 KiB
Python
(
|
|
s.boot;
|
|
)
|
|
|
|
(
|
|
2 + 2
|
|
)
|
|
|
|
(
|
|
"I am SuperCollider 3".speak
|
|
)
|
|
|
|
(
|
|
{
|
|
Pan2.ar(SinOsc.ar(440, 0, 0.1), 0.0)
|
|
}.play;
|
|
)
|
|
|
|
(
|
|
{
|
|
Pan2.ar(SinOsc.ar(MouseX.kr(440, 880), 0, 0.1), 0.0)
|
|
}.play;
|
|
)
|
|
|
|
(
|
|
{
|
|
var n = 11;
|
|
|
|
Resonz.ar(
|
|
Mix.fill(n, {
|
|
var freq = rrand(50, 560.3);
|
|
var numcps = rrand(2, 20);
|
|
|
|
Pan2.ar(
|
|
Gendy1.ar(
|
|
6.rand, 6.rand, 1.0.rand, 1.0.rand, freq, freq,
|
|
1.0.rand, 1.0.rand, numcps,
|
|
SinOsc.kr(exprand(0.02, 0.2), 0, numcps/2, numcps/2),
|
|
0.5/(n.sqrt)
|
|
),
|
|
1.0.rand2
|
|
)
|
|
}),
|
|
MouseX.kr(100, 2000),
|
|
MouseY.kr(0.1, 1.0)
|
|
);
|
|
}.play
|
|
)
|
|
|
|
(
|
|
{
|
|
Pan2.ar(
|
|
SinOsc.ar(440, 0, 0.1),
|
|
0.0
|
|
)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(440, 0, 0.1) + Pulse.ar(443, 0.6, 0.05)
|
|
}.play;
|
|
)
|
|
|
|
(
|
|
if(4 == 4, {
|
|
if(3 == 3, {
|
|
"correct!".postln
|
|
});
|
|
});
|
|
)
|
|
|
|
(
|
|
2.postln;
|
|
|
|
Post << [2, 3, 4, 5] << nl;
|
|
)
|
|
|
|
(
|
|
var freq;
|
|
freq = rrand(300, 600);
|
|
|
|
{
|
|
SinOsc.ar(freq, 0, 0.1)
|
|
}.play;
|
|
)
|
|
|
|
// :boom:
|
|
(
|
|
{ SinOsc.ar(nil) }.play
|
|
)
|
|
|
|
// :boom:
|
|
(
|
|
Array.series(9, 0, 1) + nil
|
|
)
|
|
|
|
(
|
|
"ls -l".unixCmd
|
|
)
|
|
|
|
(
|
|
var p, l, d = "";
|
|
p = Pipe.new("ls -l", "r");
|
|
l = p.getLine;
|
|
while(
|
|
{ l.notNil },
|
|
{
|
|
d = d ++ l ++ "\n";
|
|
l = p.getLine;
|
|
}
|
|
);
|
|
p.close;
|
|
|
|
Post << d << nl;
|
|
d[0..20]
|
|
)
|
|
|
|
(
|
|
Array.browse
|
|
)
|