Hi, I am experimenting with writing a surround panner object for the Teensy Audio Library. This reads a single input channel and applies panning gain to 8 output channels. I notice I'm getting some weird behavior with the receive blocks functions. Paired things down to the bare minimum and I'm finding the problem is with blocks not being received properly:
This code shows the blocks being lost for channels 1-7, and received for 0. I get the same behavior for receiveWritable(och).
Can these functions only be called once? I need 8 copies of the input signal to apply gain to, thought the receive functions would do this.
Seeing as this doesn't work, what is the best practice way to copy the input signal to 8 separate buffers so I can apply gain to all of them?
Thanks!
Code:
void Panner::update(void){
for(int och = 0; och < num_channels; ++och){
audio_block_t *block = receiveReadOnly(0);
if (block) {
transmit(block, och);
release(block);
}else{
Serial.print("Lost block "); Serial.println(och);
}
}
This code shows the blocks being lost for channels 1-7, and received for 0. I get the same behavior for receiveWritable(och).
Can these functions only be called once? I need 8 copies of the input signal to apply gain to, thought the receive functions would do this.
Seeing as this doesn't work, what is the best practice way to copy the input signal to 8 separate buffers so I can apply gain to all of them?
Thanks!