[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] env ugen(s) don't function correctly??
hello list-
I've been having some interesting problems with the Env ugen and some of
it's presets...
The presets I've had the most trouble with are .sine and .triangle. Here's
an example of those acting funny.
//preset SynthDef:
SynthDef(\convolPulse, {arg note = 350, dur = 1.4, vol = 0.5, out = 0;
var in, kernel, sound, env, together, pan;
in = Pulse.ar(note, 0.2, vol);
kernel = WhiteNoise.ar(0.05);
sound = Convolution.ar(in, kernel, 2048, 0.5);
env = EnvGen.kr(Env.sine(dur, 1), doneAction: 2);
together = RLPF.ar(sound*env, note*2.2);
pan = Pan2.ar(together, out);
Out.ar(0, pan);
}).send(s);
//or this one:
SynthDef(\convolPulse, {arg note = 350, dur = 1.4, vol = 0.5, out = 0;
var in, kernel, sound, env, together, pan;
in = Pulse.ar(note, 0.2, vol);
kernel = WhiteNoise.ar(0.05);
sound = Convolution.ar(in, kernel, 2048, 0.5);
env = EnvGen.kr(Env.triangle(dur, 1), doneAction: 2);
together = RLPF.ar(sound*env, note*2.2);
pan = Pan2.ar(together, out);
Out.ar(0, pan);
}).send(s);
//the chord:
(
Synth(\convolPulse,[\note, 80.midicps, \dur,3]);
Synth(\convolPulse,[\note, 66.midicps, \dur,3]);
Synth(\convolPulse,[\note, 53.midicps, \dur,3]);
Synth(\convolPulse,[\note, 45.midicps, \dur,3]);
)
The tail end of the envelope doesn't taper correctly, it seems to get about
3/4 of the way towards the bottom of the "curve" and the drops off
completely (at least on my end). The .triangle env seems much worse than
.sine, but they both sound like they have the same issue.
I've also tried faking a new triangle env SynthDef below:
//new SynthDef attempt:
SynthDef(\convolPulse, {arg note = 350, dur = 1.4, vol = 0.5, out = 0;
var in, kernel, sound, env, together, pan;
in = Pulse.ar(note, 0.2, 0.5);
kernel = WhiteNoise.ar(0.05);
sound = Convolution.ar(in, kernel, 2048, 0.5);
env =
EnvGen.kr(/*tri*/Env.new([0.001,0.15*vol,vol,0.15*vol,0.001],[0.15*dur,0.35*dur,0.35*dur,0.15*dur],'exponential'),
doneAction: 2);
together = RLPF.ar(sound*env, note*2.2);
pan = Pan2.ar(together, out);
Out.ar(0, pan);
}).send(s);
That one seems closer (the shape is a bit off), but the taper doesn't really
work either.
I've had similar problems in the past with Env.perc. SynthDefs and passage
below:
// .perc SynthDefs
SynthDef(\bell1, { arg note = 300, dur = 1.4, vol = 0.5;
var sound, input, env, together;
input = BrownNoise.ar(0.5);
sound = Klank.ar(`[[note, note*3/2, note*8/5, note*18/8], [0.01, 0.02, 0.03,
0.04], [dur, 1.2, 1.3, 1.4]], input).dup;
env = EnvGen.kr(Env.perc(0.001, dur, vol), doneAction: 2);
together = sound*env;
Out.ar(0, together);
}).send(s);
SynthDef(\bell2, { arg note = 300, dur = 1.4, vol = 0.6;
var sound, input, env, together;
input = Impulse.ar(0.1, 0, 10);
sound = Klank.ar(`[[note, note*3/2, note*8/5, note*18/8], [0.02, 0.03, 0.04,
0.05], [dur, 1.2, 1.3, 1.4]], input).dup;
env = EnvGen.kr(Env.perc(0.001,dur,vol), doneAction: 2);
together = sound*env;
Out.ar(0, together);
}).send(s);
//here's the passage:
a = TempoClock(92/60);
//m. 31-32
a.sched(1, {Synth(\bell1, [\note, 48.midicps, \dur, 1.3044, \vol, 0.2])});
a.sched(1, {Synth(\bell2, [\note, 47.midicps])});
a.sched(2, {Synth(\bell2, [\note, 56.midicps])});
a.sched(2, {Synth(\bell2, [\note, 57.midicps])});
a.sched(2.25, {Synth(\bell2, [\note, 81.midicps, \vol, 0.5])});
a.sched(2.4375, {Synth(\bell2, [\note, 65.midicps, \vol, 0.5])});
a.sched(2.625, {Synth(\bell2, [\note, 78.midicps, \vol, 0.5])});
a.sched(2.8125, {Synth(\bell2, [\note, 80.midicps, \vol, 0.5])});
a.sched(3, {Synth(\bell2, [\note, 49.midicps, \vol, 0.5])});
a.sched(5, {
Synth(\bell2, [\note, 50.midicps, \vol, 0.65]);
Synth(\bell2, [\note, 51.midicps, \vol, 0.65]);
Synth(\bell2, [\note, 54.midicps, \vol, 0.65]);
Synth(\bell2, [\note, 61.midicps, \vol, 0.65]);
Synth(\bell2, [\note, 64.midicps, \vol, 0.65]);
Synth(\bell2, [\note, 65.midicps, \vol, 0.65]);
});
a.sched(5, {
Synth(\bell1, [\note, 50.midicps, \dur, 6, \vol, 0.15]);
Synth(\bell1, [\note, 51.midicps, \dur, 6, \vol, 0.15]);
Synth(\bell1, [\note, 54.midicps, \dur, 6, \vol, 0.15]);
Synth(\bell1, [\note, 61.midicps, \dur, 6, \vol, 0.15]);
Synth(\bell1, [\note, 64.midicps, \dur, 6, \vol, 0.15]);
Synth(\bell1, [\note, 65.midicps, \dur, 6, \vol, 0.15]);
});
That one sounds fine, the very end still doesn't seem to taper correctly to
me. Some other sounds in the piece the taper a bit more oddly; sorry about
not fining the best example for that one.
Again, I tried to make some perc-like envs... but I think the preset .perc's
are better, though they still have issues. Even still, I don't understand
why these one's do not sound correct to me. Maybe there're some code
suggestions for these?
// perc-like envs - SynthDefs
SynthDef(\bell1, { arg note = 300, dur = 1.4, vol = 0.5;
var sound, input, env, together;
input = BrownNoise.ar(0.5);
sound = Klank.ar(`[[note, note*3/2, note*8/5, note*18/8], [0.01, 0.02, 0.03,
0.04], [dur, 1.2, 1.3, 1.4]], input).dup;
env =
EnvGen.kr(/*perc*/Env.new([0.001,vol,0.001],[0.001,dur],'exponential'),
doneAction: 2);
together = sound*env;
Out.ar(0, together);
}).send(s);
SynthDef(\bell2, { arg note = 300, dur = 1.4, vol = 0.6;
var sound, input, env, together;
input = Impulse.ar(0.1, 0, 10);
sound = Klank.ar(`[[note, note*3/2, note*8/5, note*18/8], [0.02, 0.03, 0.04,
0.05], [dur, 1.2, 1.3, 1.4]], input).dup;
env =
EnvGen.kr(/*perc*/Env.new([0.001,vol,0.001],[0.001,dur],'exponential'),
doneAction: 2);
together = sound*env;
Out.ar(0, together);
}).send(s);
The \bell2 sound doesn't have as much resonance as the \bell1 sound and I
think that's why the "misshapen" envelope can pass for that sound; but I
don't understand why the envelope has such a steep drop off at the end of
the \bell1 sound.
In working on this piece I've become very confused by these envelope
tapering issues. I find that the attacks all sound nice, but the decays
always have something funny. If it becomes neccessary (or would just help) I
can post the whole piece and which events have the biggest problems to my
ears - maybe that will be the best way to diagnose the problem.
Thanks in advance,
stwbass
--
View this message in context: http://www.nabble.com/env-ugen%28s%29-don%27t-function-correctly---tp14467510p14467510.html
Sent from the Supercollider - User mailing list archive at Nabble.com.