Generative synthesis


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);

Then I can play it in a loop:

{, 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.


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:

            [0 ,, 0, 1, 0, 1] , 0.001 , loopNode:0 , releaseNode:4
    ) * 0.1

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