halalkebabhut
Newbie
Karma: 0
Posts: 9
|
 |
« on: August 30, 2008, 02:52:31 AM » |
|
Hi,
I seem to get a lot of problems when using control busses in combination with synth defs and envelopes. The below example 1 works fine, but when I attempt more complicated proceedures eg. controling several parameters simultaneously and using tasks to sequence them, SC behaves a little unpredictably, producing various different glitches. The second example produces small percussive pops at when the width paramater reaches its extremity. I have a feeling that it could be an issue with timing inaccuracy and the various envelopes overlapping. What can I do about this. I've tried adding latency but it doesn't seem to work.
S
example 1.
(
a = Bus.control; //width variable is assigned here
( SynthDef.new(\Saw, { arg sig,amp = 1; sig = Pan2.ar(VarSaw.ar(50,0,In.kr(a),0.2),0); sig = sig * amp; Out.ar(0, sig); } ).send(s); );
//Single Sweep ( SynthDef.new(\WidSweep, { arg sig; sig = EnvGen.kr(Env.new([0.02,0.5,0.98],[3,1],[4,1]),1,1,0,1,2); Out.kr(a, sig); } ).send(s); ); //Looping Synth ( SynthDef.new(\WidReg, { arg sig, times = 8; sig = EnvGen.kr(Env.new([0.98,0.02,0.98, 0.02],[0.5,0.5,0.5],'linear',2,0),Trig1.kr(1,times),1,0,1,2); Out.kr(a, sig); } ).send(s); );
)
w = {Synth.new(\Saw)}.play; x = {Synth.before(w,\WidReg)}.play;
example 2.
( t = Task({
var delta, dur, wid, wids, widIndex = [0,\WidSweep, \WidReg ];
w = {Synth.new(\Saw)}.play;
dur = Pseq( [3, 4, 8.5,]).asStream; wids = Pseq( [0, 1, 2, ]).asStream;
while { delta = dur.next; delta.notNil
}{ wid = wids.next; x = if(wid > 0,{Synth.before(w,widIndex[wid])},{0}); delta.yield; };
}).play; )
|