Hi all,

i was rehearsing with the Bela and i was losing an audio on the right channel and some times losing it in both. So today i tested it with a simple sine-tone program one sending a different sine-tone to each channel.

after 4 tests the same thing happens

  at 2m 09s  the audio changes get higher in pitch.

  at 6m 55s the right channel fades out.

   after 30m the left channel nothing seemed to change in the left channel

Does any one have any idea whats happening?

Thanks very much

this is the Bela mini
if that changes anything

Can younpodr the code you've been using, or - better - use the example Fundamentals/sinetone for your tests?

  • Edited

here is the code i used :

#include <Bela.h>
 #include <cmath>

 float gFrequency = 440.0;
 float gPhase;
 float gFrequency2 = 660.0;
 float gPhase2;
 float gInverseSampleRate;

 bool setup(BelaContext *context, void *userData)
 {
	gInverseSampleRate = 1.0 / context->audioSampleRate;
	gPhase = 0.0;

	return true;
 }

   void render(BelaContext *context, void *userData)
    {
         for(unsigned int n = 0; n < context->audioFrames; n++) {
                 float out[2]= {0}; 
                 out[0]= 0.8f * sinf(gPhase);
                 gPhase += 2.0f * (float)M_PI * gFrequency * gInverseSampleRate;
                 out[1] = 0.8f * sinf(gPhase2);
                 gPhase2 += 2.0f * (float)M_PI * gFrequency2 * gInverseSampleRate;
		if(gPhase > M_PI)
			gPhase -= 2.0f * (float)M_PI;

		for(unsigned int channel = 0; channel < context->audioOutChannels; channel++) {
			audioWrite(context, n, channel, out[channel]);
                  }
          }
   }

 void cleanup(BelaContext *context, void *userData)
 {

 }

hi
above is what i was using it is basically the Fundamentals/sinetone but with an added sintone for the other channel

Yup you are not wrapping around gPhase2 which is what is causing the disruptions you are observing. You need

if(gPhase2 > M_PI)
			gPhase2 -= 2.0f * (float)M_PI;

Oh thanks! silly mistake on my part !
I though it was odd and different to the problem i had during my rehearsal.
thanks again 🙂
Now I can go back to testing wither my transmitters are causing the audio drop out I had during rehearsal.