Hi @giuliomoro, The CTAG-BEAST arrived and we are setting it up now!
Thanks again for your input on the CTAG vs. audio expander.
We would like to generate audio on the CTAG every time a digital input is received from a sensor (a finger tap on the sensor).
In our prior code, audio and digital samples were acquired at 44.1 kHz so we sampled the digital input and sent audio output inside the same loop in render.
With the CTAG BEAST the sampling rate for audio is now different than the digital sampling rate: What is your recommended method of sending out audio every time a finger tap is received on the digital input ports?, i.e., can we call digitalRead() inside of a loop that runs at the audio sampling rate (and ignore redundant samples?) such as in the below dummy code? Or is there a better method?
Thanks in advance!
void render(BelaContext *context, void *userData)
{
for(unsigned int n = 0; n < context->audioFrames; n++) {
digital_input = digitalRead(context, n, gInputPin[sensor_i]);
for(unsigned int channel = 0; channel < context->audioOutChannels; channel++) {
float out = somevalue
audioWrite(context, n, channel, gAmplitude * out);
}
}
}
Thanks in advance!