box-o-sand/sclang-play/tutorial.sc
2015-10-21 14:30:23 -04:00

124 lines
1.5 KiB
Python

(
{
var pitchOsc;
var ampOsc;
pitchOsc = { 300 + SinOsc.kr(0.1, 1.5pi, 20, 20); };
ampOsc = SinOsc.kr(0.5, 1.5pi, 1.0, 1.0);
SinOsc.ar([pitchOsc, pitchOsc], 0, ampOsc);
}.play;
)
(
{ [SinOsc.ar(440, 0, 0.2), SinOsc.ar(442, 0, 0.2)] }.play;
)
(
{
var freq;
freq = [[600, 880], [400, 660], 1320, 880].choose;
SinOsc.ar(freq, 0, 0.2);
}.play;
)
(
{
Pan2.ar(PinkNoise.ar(0.2), SinOsc.kr(0.5));
}.play;
)
(
{
Pan2.ar(PinkNoise.ar(0.2), -0.3);
}.play;
)
(
{
PinkNoise.ar(0.2) + SinOsc.ar([440, 442], 0, 0.2) + Saw.ar([660, 662], 0.2);
}.play;
)
(
{
var a, b;
a = [
SinOsc.ar(440, 0, 0.2),
Saw.ar(662, 0.2)
];
b = [
SinOsc.ar(442, 0, 0.2),
Saw.ar(660, 0.2)
];
Mix([a, b]).postln;
}.play;
)
(
var n = 8;
{
Mix.fill(n, { SinOsc.ar([220, 500 + 500.0.rand], 0, 1 / n) });
}.play;
)
(
var n = 8;
{
Mix.fill(n, { |index|
var freq;
index.postln;
freq = 440 + index;
freq.postln;
SinOsc.ar(freq, 0, 1 / n)
});
}.play;
)
(
{
PinkNoise.ar(0.2) + SinOsc.ar(440, 0, 0.2) + Saw.ar(660, 0.2)
}.plot;
)
(
{
PinkNoise.ar(0.2) + SinOsc.ar(440, 0, 0.2) + Saw.ar(660, 0.2)
}.plot(1);
)
(
{
PinkNoise.ar(0.2) + SinOsc.ar(440, 0, 0.2) + Saw.ar(660, 0.2)
}.scope;
)
(
{
[
SinOsc.ar(440, 0, 0.2),
SinOsc.ar(442, 0, 0.2)
]
}.scope;
)
(
{
[
SinOsc.ar(440, 0, 0.2),
SinOsc.ar(442, 0, 0.2)
]
}.scope(zoom: 10);
)
(
s.scope;
)
(
s.boot;
)
(
s.kill;
)