[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] [APPROVE?] SynthDef and non-float args




On Nov 21, 2004, at 11:36 AM, James Harkins wrote:

On Saturday, Nov 20, 2004, at 23:45 US/Eastern, James McCartney wrote:

This is unnecessary. You can just write closures. This is what I am doing for the basic synth lib.
You can put these functions in a dictionary and archive them.

Actually, I'll see your closures and raise you a "know"...

~defs = (
sin1: #{ |self, name, env, numCh = 1|
// also a good idea to have defaults for required func args
env = env ?? { Env.adsr(0.1, 0.5, 0.7, 0.1) };
SynthDef(name, { |out = 0, freq = 440, gate = 1, amp = 0.5|
var sig;
sig = SinOsc.ar(freq, 0, amp) * EnvGen.kr(env, gate, doneAction:2);
Out.ar(out, sig.dup(numCh))
});
}
);

~defs.know = true;



unecessary. know is true by default for Events.

().know

true