You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
812 B
Plaintext

(
SynthDef(\wtable_vosc_dual, {
var env, sig, freq, buf, wtmod, wtpos;
var wtbufnumRange = [ ~wtbufnums.minItem, ~wtbufnums.maxItem ];
// Main controls
var gate = \gate.kr(1);
freq = \freq.kr(220);
buf = \bufn.kr(wtbufnumRange[0]);
wtmod = \wtmodbufn.kr(wtbufnumRange[1]);
// Envelope
env = EnvGen.kr(
Env.perc(
\attack.kr(0.1),
\release.kr(1.0)
),
gate,
doneAction: 2
).lag(\envLag.kr(0.1));
// Wavetable oscillator modulation
wtpos = VOsc.ar(
wtmod,
\wtmodfreq.kr(2),
\phase.kr(0),
\wtmodamp.kr(1)
)
+ env.pow(1.4)
+ buf;
wtpos = wtpos.lag(1.8).mod(wtbufnumRange[1] - wtbufnumRange[0]) + wtbufnumRange[0];
// Final signal
sig = VOsc.ar(wtpos, freq, \phase.kr(0), 1) * env * \amp.kr(0.2);
// Output
Out.ar(\out.kr(0), sig ! 2);
}).add;
)