From 06fab891b27b649b8b85ca9ac8dec92657d83572 Mon Sep 17 00:00:00 2001 From: Leo Coogan Date: Mon, 18 Apr 2022 10:18:07 -0400 Subject: [PATCH] added synthdefs --- scd/synthdefs.scd | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scd/synthdefs.scd b/scd/synthdefs.scd index 2b095b2..3477225 100644 --- a/scd/synthdefs.scd +++ b/scd/synthdefs.scd @@ -1,7 +1,21 @@ ( -SynthDef(\sin, { |out| +SynthDef(\sin, { |out, freq = 440| + var sound; + sound = SinOsc.ar(freq); + Out.ar(out, sound) +}).add +); + +( +SynthDef(\sinenv, { |out, sustain = 1, freq = 440, speed = 1, begin=0, end=1, pan, accelerate, offset, modfreq = 40| + var env, sound, rate, phase, amp; + amp = AmpCompA.kr(freq); + env = EnvGen.ar(Env.perc(0.002, sustain, 1, -1), doneAction:2); + phase = Line.ar(begin, end, sustain); + rate = speed + Sweep.kr(1, accelerate); + sound = SinOsc.ar(freq); Out.ar(out, - SinOsc.ar() + DirtPan.ar(sound, ~dirt.numChannels, pan, env) ) }).add );