Update voltage.scd
This commit is contained in:
parent
66d0cc3d29
commit
80db5750a5
43
voltage.scd
43
voltage.scd
|
@ -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
|
||||
);
|
||||
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue