Generative synthesis

Hi!

I know how to generate a sound buffer with an array of breakpoints, something like this:

(
var env, sig, wt;

env = Env([0, 0.5, -0.9, 0], [1,2,3], \sine);
sig = env.asSignal(512);
b.loadCollection(sig);
)

Then I can play it in a loop:

{PlayBuf.ar(1, b, loop: 1)!2}.play

But, can I generate a new buffer in each iteration? I want to generate a new breakpoints array in each iteration (something like Xenakis stochastic synthesis).

Maybe should be better to do it in scsynth, coding a new ugen in C++, but I want to try it in sclang. Is it possible?

thank you very much!!

There are a few Gendy units already – which doesn’t help you implement your own, but maybe you don’t need to.

hjh

Yes, I know theese Gendy ugen, but I want to implememt my own. Is it possible from sclang? thank you!!!

well recall that you can vary the parameters of an Env while the synth is running:

{
	EnvGen.ar(
		Env.new(
            [0 , LFNoise0.kr(100), 0, 1, 0, 1] , 0.001 , loopNode:0 , releaseNode:4
        ),
        gate:1
    ) * 0.1
}.play

so starting there you ought to be able to hack together what you want

If you want very tight timing for the changes you might need to get more fancy