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?