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

Re: GrainUGens (was Re: [Sc-devel] adding UGens / classes)



I noticed something a little problematic with the grain ugens with Envs... they are NOT cheap. There is basically an EnvGen running for every grain, so as density goes up, so does the CPU by quite a bit. So, I wanted to see what others thought about this:

have an envbufnum parameter that
	: if < 0, uses the built-in window
	: if >= 0 uses a table in a buffer

Then, add a method to Buffer that stores an envelope to a the Buffer;

e.g:

GrainSin(numChannels, trigger, graindur, freq, pan, envbufnum, mul, add);

a = Buffer.fromEnv(Env([0, 1, 0], [1, 1], \sin));

How does this sound?


sounds reasonable to me. This is useful also for other cases.
Maybe add an instance method sendEnv too.

actually it would be better to have one instance method of Env like:

discretize { arg n;
	...
}

then you can write
Buffer.sendCollection(env. discretize)
--





.