comparison examples/cape_test/render.cpp @ 301:e4392164b458 prerelease

RENAMED BeagleRT to Bela AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, scripts probably not working
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 27 May 2016 14:34:41 +0100
parents dbeed520b014
children 493a07f6ec09
comparison
equal deleted inserted replaced
300:dbeed520b014 301:e4392164b458
4 * Created on: Oct 24, 2014 4 * Created on: Oct 24, 2014
5 * Author: parallels 5 * Author: parallels
6 */ 6 */
7 7
8 8
9 #include <BeagleRT.h> 9 #include <Bela.h>
10 #include <cmath> 10 #include <cmath>
11 11
12 #define ANALOG_LOW (2048.0 / 65536.0) 12 #define ANALOG_LOW (2048.0 / 65536.0)
13 #define ANALOG_HIGH (50000.0 / 65536.0) 13 #define ANALOG_HIGH (50000.0 / 65536.0)
14 14
45 // userData holds an opaque pointer to a data structure that was passed 45 // userData holds an opaque pointer to a data structure that was passed
46 // in from the call to initAudio(). 46 // in from the call to initAudio().
47 // 47 //
48 // Return true on success; returning false halts the program. 48 // Return true on success; returning false halts the program.
49 49
50 bool setup(BeagleRTContext *context, void *userData) 50 bool setup(BelaContext *context, void *userData)
51 { 51 {
52 return true; 52 return true;
53 } 53 }
54 54
55 // render() is called regularly at the highest priority by the audio engine. 55 // render() is called regularly at the highest priority by the audio engine.
56 // Input and output are given from the audio hardware and the other 56 // Input and output are given from the audio hardware and the other
57 // ADCs and DACs (if available). If only audio is available, numMatrixFrames 57 // ADCs and DACs (if available). If only audio is available, numMatrixFrames
58 // will be 0. 58 // will be 0.
59 59
60 void render(BeagleRTContext *context, void *userData) 60 void render(BelaContext *context, void *userData)
61 { 61 {
62 static float phase = 0.0; 62 static float phase = 0.0;
63 static int sampleCounter = 0; 63 static int sampleCounter = 0;
64 static int invertChannel = 0; 64 static int invertChannel = 0;
65 float frequency = 0; 65 float frequency = 0;
271 } 271 }
272 272
273 // cleanup() is called once at the end, after the audio has stopped. 273 // cleanup() is called once at the end, after the audio has stopped.
274 // Release any resources that were allocated in setup(). 274 // Release any resources that were allocated in setup().
275 275
276 void cleanup(BeagleRTContext *context, void *userData) 276 void cleanup(BelaContext *context, void *userData)
277 { 277 {
278 278
279 } 279 }