Update voltage.scd

This commit is contained in:
Omar Mashaal 2021-01-03 23:35:42 +11:00 committed by GitHub
parent 66d0cc3d29
commit 80db5750a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 5 deletions

View File

@ -1,10 +1,18 @@
(
(
SynthDef (\pitch, { | out, n, channel, stepsPerOctave = 12, rate = 1, delta, begin, end, portamento = 0, accelerate = 0 |
SynthDef (\pitch, { | out,
n,
channel,
stepsPerOctave = 12,
rate = 1,
delta,
begin,
end,
portamento = 0 |
var slew, env, phase;
n = n + (stepsPerOctave / 12);
n = (n + (n / stepsPerOctave) * (1 / (stepsPerOctave + 1)) / 10);
slew = (portamento * accelerate);
slew = (portamento);
slew = (slew + (slew / stepsPerOctave) * (1 / (stepsPerOctave + 1)) / 10);
env = Env ([n, n + slew], [delta / rate]);
phase = Line.ar (begin, end, delta / rate);
@ -13,10 +21,27 @@
);
(
SynthDef (\voltage, { | out, channel, n, rate = 1, delta, begin, end, portamento = 0, accelerate = 0 |
SynthDef (\gate, { | out,
channel,
n |
n = n * 5;
OffsetOut.ar (channel, DC.ar (n));
}).add
);
(
SynthDef (\voltage, { | out,
channel,
n,
rate = 1,
delta,
begin,
end,
portamento = 0 |
var slew, env, phase;
n = n * 5;
slew = (portamento * accelerate);
slew = (portamento);
rate = rate;
env = Env ([n, n + slew], [delta / rate]);
phase = Line.ar (begin, end, delta / rate);
OffsetOut.ar (channel, IEnvGen.ar (env, phase));
@ -24,11 +49,19 @@
);
(
SynthDef (\adsr, { | out, channel, attack = 0.1, decay = 0.5, sustain = 0.5, release = 0.5, begin, end |
SynthDef (\ar, { | out,
channel,
attack = 0.01,
decay = 0.25,
sustain = 0.25,
release = 0.25,
begin,
end |
var env, phase;
env = Env.adsr (attack, decay, sustain, release);
phase = Line.ar (begin, end, sustain);
OffsetOut.ar (channel, IEnvGen.ar (env, phase));
}).add
);
)