multigrain/synths.scd

46 lines
1.1 KiB
Plaintext

(
SynthDef(\pos_saw, {
arg out, length=1;
Out.kr(out, EnvGen.kr(Env([0, 1], length), doneAction: Done.freeSelf))
}).add();
SynthDef(\pos_sine, {
arg out, length=1;
Out.kr(out, EnvGen.kr(Env.sine(length, 1), doneAction: Done.freeSelf))
}).add();
SynthDef(\pos_reverse, {
arg out, length=1;
Out.kr(out, EnvGen.kr(Env([1, 0], length), doneAction: Done.freeSelf))
}).add();
SynthDef(\pos_step, {
arg out, length=1;
var levels = (0..8) / 8, times = (length / 8) ! 7;
Out.kr(out, EnvGen.kr(Env(levels: levels, times: times, curve: \hold), doneAction: Done.freeSelf));
}).add();
SynthDef(\lfo, {
arg out, freq=1, amp=0;
Out.kr(out, SinOsc.kr(freq, 0, amp));
}).add;
SynthDef(\trigger, {
arg out=1;
Out.kr(out, EnvGen.kr(Env.perc(0.001, 0.2, 2), levelScale:2.0, levelBias:-1,doneAction:Done.freeSelf));
}).add;
SynthDef(\metronome, {
arg out=0, amp=1, pan=0, filter=1000, atk=0.01, rel=0.1;
var sig, env;
env = EnvGen.kr(Env.perc(atk, rel, amp), doneAction: Done.freeSelf);
sig = HPF.ar(WhiteNoise.ar(), filter);
Out.ar(out, Pan2.ar(sig * env, pan));
}
).add;
)