301 lines
3.6 KiB
Python
301 lines
3.6 KiB
Python
(
|
|
s.boot;
|
|
)
|
|
|
|
(
|
|
FreqScope.new;
|
|
)
|
|
|
|
(
|
|
{SinOsc.ar(440, 0, 0.1)}.scope
|
|
)
|
|
|
|
(
|
|
{SinOsc.ar(440, 0, Line.kr(0.1, 0.0, 1.0))}.scope
|
|
)
|
|
|
|
(
|
|
{SinOsc.ar(440, 0, Line.kr(0.1, 0, 1, doneAction: 2))}.scope
|
|
)
|
|
|
|
(
|
|
Env([1, 0, 1], [1, 1]).plot
|
|
)
|
|
|
|
(
|
|
Env([0, 1, 0], [1.0, 0.5]).plot
|
|
)
|
|
|
|
(
|
|
Env.linen(0.03, 0.5, 0.1).plot
|
|
)
|
|
|
|
(
|
|
Env.adsr(0.01, 0.5, 0.5, 0.1, 1.0, 0).plot
|
|
)
|
|
|
|
(
|
|
Env.perc(0.05, 0.5, 1.0, 0).plot
|
|
)
|
|
|
|
(
|
|
Env([1, 0], [1.0]).plot
|
|
)
|
|
|
|
(
|
|
{EnvGen.ar(Env([1, 0], [1.0]))}.scope
|
|
)
|
|
|
|
(
|
|
{SinOsc.ar(440, 0, 0.1) * EnvGen.kr(Env([1, 0], [1.0]))}.scope
|
|
)
|
|
|
|
(
|
|
Env([1000, 20], [1.0]).plot
|
|
)
|
|
|
|
(
|
|
{Saw.ar(EnvGen.ar(Env([1000, 20], [1.0])), 0.1)}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Saw.ar(
|
|
EnvGen.ar(Env([1000, 20], [0.5])),
|
|
EnvGen.ar(Env([0.1, 0], [2.0]))
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Saw.ar(
|
|
EnvGen.kr(Env([1000, 20], [0.5])),
|
|
EnvGen.kr(Env([0.1, 0], [2.0]))
|
|
)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(
|
|
SinOsc.ar(10, 0, 10, 440),
|
|
0.0,
|
|
EnvGen.kr(Env([0.5, 0.0], [1.0]), doneAction: 2)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Saw.ar(
|
|
EnvGen.kr(Env([500, 100], [1.0]), doneAction: 2),
|
|
0.1
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Saw.ar(
|
|
SinOsc.ar(1, 0, 10, 440),
|
|
Line.kr(0, 1, 1, doneAction: 2)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Saw.ar(
|
|
SinOsc.ar(1, 0, 10, 440),
|
|
XLine.kr(0.0001, 1, 1, doneAction: 2)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
EnvGen.ar(
|
|
Env([0, 0.1, 0], [0.1, 0.9]), doneAction: 2
|
|
) * SinOsc.ar(330)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
a = {
|
|
EnvGen.ar(
|
|
Env.asr(0.1, 0.1, 1.0), doneAction: 2
|
|
) * SinOsc.ar(330)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.release(2.0);
|
|
)
|
|
|
|
(
|
|
a = {
|
|
arg gate=1;
|
|
|
|
EnvGen.ar(
|
|
Env.asr(0.1, 0.1, 0.9), gate, doneAction: 2
|
|
) * SinOsc.ar(330)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.set(\gate, 0)
|
|
)
|
|
|
|
(
|
|
e = Env([0.2, 1.0, 0.0], [0.1, 3.0], 0, 1);
|
|
|
|
a = {
|
|
arg gate=1;
|
|
|
|
EnvGen.ar(
|
|
e, gate, doneAction: 2
|
|
) * SinOsc.ar(550, 0, 0.1)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.set(\gate, 0);
|
|
)
|
|
|
|
(
|
|
e = Env([0.0, 0.0, 1.0, 0.0], [0.5, 1.0, 2.0], 0, 2, 0);
|
|
|
|
a = {
|
|
arg gate=1;
|
|
|
|
EnvGen.ar(
|
|
e, gate, doneAction: 2
|
|
) * SinOsc.ar(550, 0, 0.1)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.set(\gate, 0);
|
|
)
|
|
|
|
(
|
|
e = Env(
|
|
[0.0, 1.0, -1.0, 0.0],
|
|
[0.01, 0.01, 2.0],
|
|
0,
|
|
2, // releaseNode
|
|
0 // loopNode
|
|
);
|
|
|
|
e.plot;
|
|
|
|
a = {
|
|
arg gate=1;
|
|
|
|
EnvGen.ar(
|
|
e, gate, timeScale: MouseX.kr(0.1, 2.0), doneAction: 2
|
|
)
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.set(\gate, 0);
|
|
)
|
|
|
|
(
|
|
SynthDef(\sine,
|
|
{
|
|
Out.ar(
|
|
0, SinOsc.ar(
|
|
Rand(440, 880), 0, 0.1
|
|
)
|
|
)
|
|
}
|
|
).add;
|
|
)
|
|
|
|
(
|
|
Synth(\sine);
|
|
)
|
|
|
|
(
|
|
a = Synth(\sine);
|
|
a.writeDefFile("synth.out");
|
|
)
|
|
|
|
(
|
|
SynthDef(\sine, {
|
|
arg freq=440, amp=0.1;
|
|
Out.ar(
|
|
0,
|
|
SinOsc.ar(freq, 0, amp)
|
|
)
|
|
}).add;
|
|
)
|
|
|
|
(
|
|
Synth("sine");
|
|
Synth("sine", [\freq, 880])
|
|
)
|
|
|
|
(
|
|
a = Synth(\sine);
|
|
b = Synth(\sine, [\freq, 550]);
|
|
c = Synth(\sine, [\freq, 660, \amp, 0.5]);
|
|
)
|
|
|
|
(
|
|
c.set(\freq, 1000);
|
|
b.set(\amp, 0.3, \freq, 100);
|
|
)
|
|
|
|
(
|
|
a.free;
|
|
b.free;
|
|
c.free;
|
|
)
|
|
|
|
(
|
|
SynthDef(\hum, {
|
|
arg freq=440;
|
|
var finaloutput = Mix(
|
|
[
|
|
SinOsc.ar(freq, 0, 0.3),
|
|
SinOsc.ar(freq*2, 0, 0.2),
|
|
SinOsc.ar(freq*3, 0, 0.1),
|
|
SinOsc.ar(freq*3.33, 0, 0.01),
|
|
SinOsc.ar(freq*4, 0, 0.1),
|
|
SinOsc.ar(freq*4.5, 0, 0.01),
|
|
SinOsc.ar(freq*4.75, 0, 0.02)
|
|
]
|
|
);
|
|
Out.ar(0, finaloutput);
|
|
}).add;
|
|
)
|
|
|
|
(
|
|
Synth(\hum, [\freq, 220]);
|
|
)
|
|
|
|
(
|
|
Synth(\hum, [\freq, 880]);
|
|
)
|
|
|
|
(
|
|
Synth(\hum, [\freq, 440]);
|
|
)
|
|
|
|
(
|
|
SynthDescLib.global.synthDescs[\sine].def.func.postcs
|
|
)
|
|
|
|
(
|
|
SynthDescLib.global.synthDescs.do { |desc|
|
|
if(desc.def.notNil) {
|
|
"\nSynthDef %\n".postf(desc.name.asCompileString);
|
|
desc.def.func.postcs;
|
|
};
|
|
}
|
|
)
|