Mercurial > hg > beaglert
comparison projects/scope/render.cpp @ 144:55c1e591cb2e ClockSync
Added ifdefs for USE_JUCE compatibility
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 14 Sep 2015 21:31:09 +0100 |
parents | 44d07fa9bd03 |
children | 134bff10e561 |
comparison
equal
deleted
inserted
replaced
143:dd24379336f1 | 144:55c1e591cb2e |
---|---|
75 if(count==0){ | 75 if(count==0){ |
76 // BeagleRT_scheduleAuxiliaryTask(testTime); | 76 // BeagleRT_scheduleAuxiliaryTask(testTime); |
77 clockSyncThread.startThread(); //make sure you uncomment .init in setup() | 77 clockSyncThread.startThread(); //make sure you uncomment .init in setup() |
78 } | 78 } |
79 static float phase=0; | 79 static float phase=0; |
80 float phaseInc=200.0/44100.0*2*M_PI; | 80 float phaseInc=gFrequency1/44100.0*2*M_PI; |
81 // rt_printf("phaseInc: %f, phase: %f\n",phaseInc,phase); | 81 // rt_printf("phaseInc: %f, phase: %f\n",phaseInc,phase); |
82 for(unsigned int n=0; n<context->audioFrames; n++){ | 82 for(unsigned int n=0; n<context->audioFrames; n++){ |
83 context->audioOut[n*2]=sinf(phaseInc);//context->audioIn[n*2]; | 83 context->audioOut[n*2]=sinf(phase);//context->audioIn[n*2]; |
84 context->audioOut[n*2+1]=sinf(phaseInc);//context->audioIn[n*2]; | |
85 phase+=200.0/44100.0*2*M_PI; | 84 phase+=200.0/44100.0*2*M_PI; |
86 if(phase>=2*M_PI) | 85 if(phase>=2*M_PI) |
87 phase-=2*M_PI; | 86 phase-=2*M_PI; |
88 // context->audioOut[n*2+1]=rand()/(float)RAND_MAX;context->audioIn[n*2]; | 87 context->audioOut[n*2+1]=rand()/(float)RAND_MAX;context->audioIn[n*2]; |
89 } | 88 } |
90 count++; | 89 count++; |
91 /* | 90 /* |
92 // if((count&262143)==0){ | 91 // if((count&262143)==0){ |
93 // static int nextCall=160000; | 92 // static int nextCall=160000; |