MichaelBenjamin ·
so far stage (0) does not get retriggered on stolen voices. this sometimes, or quite often, depending on your liking, results in unwanted behaviour. it also might be considered as a bug since you need to add extra code for every variable to reinitialise just for this special case. additionally, the stage(0) only works for pitch and velocity data from the m2p and for green. for every other stream data stage(0) is not usable.
heres a quick roundup on what to do to initialize other stream data and reinitialize on stolen voices, not too complicated:
first part, initialize stream data: needs a variable, called "once" here, it is zero for the first sample and gets set to 1 at the end of the code to be 1 for every following sample. once is bound to a gate, where you specify what data gets passed on the first sample and on the others.
general example: streamin in; streamout out; float once=0; out=(here the usual code)&(once==1)+(here the initialisation code)&(once==0); once=1;
lowpass example: streamin in; streamout out; float once=0; out=(out*0.99+in*0.01)&(once==1)+in&(once==0); once=1;
here the lowpass starts at the original in value and from then on is filtered, its just like the dezip or the stock portamento. note that i use == despite the comarision is made with a float. i use this for better understanding, and it did not gave me any problems for 0 and 1.
second part, reinitializing on stolen voices: to reinitialize you need the output from the env module, its the only module i know of that resets to 1 on stolen voices and otherwise displays the same or a higher number in progrssing time. there may be other modules that are also suited, but since i got the env module in already, i used it.
same example with the lowpass, with initializing on voice and stolen voice this time: now we need to initialize the once variable manually with roughly the same gate comparision like in the example above based on envstg.
streamin in; streamin envstg;//stage output from env module streamout out; float once=0; float lastenv=0; out=(out*0.99+in*0.01)&(once==1)+in&(once==0); once=1&(lastenv<=envstg); lastenv=envstg; //in the case of a stolen voice lastenv is > envstg so once is 0 again.
for a cpu effective version of all this, you could calculate "once" globally and feed it to each module that needs initialisation. the branch itself however needs to be in every module.
hope this helps solving some of the confusion around retriggering, stage(0) stolen voices and initialisation. but naturally a much more effective way to handle this would be if stage 0 would work always, for all data.