Hello,
I love not having to set up control busses for passing triggers around anymore, but now I have a question about what’s going on behind the scenes with all this. If I have something like this in a synth (below), I have a FluidNormalize before and after the MLP, all being trigger by the same Implulse.kr
. Right now it’s hard for me to understand what is happening, especially since the actually processing of the buffers is happening in a different synth in a different place in scsynth. I’m trusting that the buffers are getting filled properly and not overwritten too early, but it’s hard for me to think through exactly what happens in what order to know that that is the case. Any explanations here will be very appreciated.
Thank you!
...
var in_buf = LocalBuf(input_vec_size);
var in_buf_norm = LocalBuf(input_vec_size);
var out_buf = LocalBuf(3);
var out_buf_scaled = LocalBuf(3);
var trig = Impulse.kr(30);
in_buf.numFrames.do({
arg i;
BufWr.kr(vector[i],in_buf,i,1); // vector is a kr stream of analysis parameters
});
x_scaler.kr(trig,in_buf,in_buf_norm); // normalize the vector data
nn.kr(trig,in_buf_norm,out_buf); // mlp prediction
y_scaler.kr(trig,out_buf,out_buf_scaled,invert:1); // scale it back up
out_vec = out_buf_scaled.numFrames.collect({
arg i;
BufRd.kr(1,out_buf_scaled,i,1); // convert back to kr stream
});
out_vec.poll;
...