This example shows you how to read from the extra audio channels of the audio expander capelet.
#include <cmath>
float gPhase[10] = {0};
float gFreq[10];
float inAcc[10] = {0};
unsigned int inAccCount[10] = {0};
{
float baseFreq = 123;
gFreq[ch] = baseFreq * (1 + ch);
return true;
}
{
{
{
inAcc[ch] += in;
++inAccCount[ch];
float out = 0.4f * sinf(gPhase[ch]);
if(gPhase[ch] > M_PI)
gPhase[ch] -= 2.f * (float)M_PI;
}
}
{
{
inAcc[idx] += in;
++inAccCount[idx];
float out = 0.4f * sinf(gPhase[idx]);
if(gPhase[idx] > (float)M_PI)
gPhase[idx] -= 2.f * (float)M_PI;
}
}
static int count = 0;
{
count += 1;
{
rt_printf("Average input:\n");
for(unsigned int n = 0; n < 10; ++n)
{
rt_printf("[%d]:\t%.3f\t", n, inAcc[n]/inAccCount[n]);
if(n % 2 == 1)
rt_printf("\n");
}
}
}
}
{
}