Mercurial > hg > beaglert
comparison examples/airharp/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 | 9dc5a0ccad25 |
comparison
equal
deleted
inserted
replaced
300:dbeed520b014 | 301:e4392164b458 |
---|---|
11 | 11 |
12 #include "MassSpringDamper.h" | 12 #include "MassSpringDamper.h" |
13 #include "String.h" | 13 #include "String.h" |
14 #include "Plectrum.h" | 14 #include "Plectrum.h" |
15 | 15 |
16 #include <BeagleRT.h> | 16 #include <Bela.h> |
17 #include <cmath> | 17 #include <cmath> |
18 #include <stdio.h> | 18 #include <stdio.h> |
19 #include <cstdlib> | 19 #include <cstdlib> |
20 #include <rtdk.h> | 20 #include <rtdk.h> |
21 #include "../include/Utilities.h" | 21 #include "../include/Utilities.h" |
67 float x2_r = 0; | 67 float x2_r = 0; |
68 float y1_r = 0; | 68 float y1_r = 0; |
69 float y2_r = 0; | 69 float y2_r = 0; |
70 | 70 |
71 | 71 |
72 bool setup(BeagleRTContext *context, void *userData) | 72 bool setup(BelaContext *context, void *userData) |
73 { | 73 { |
74 | 74 |
75 gInverseSampleRate = 1.0 / context->audioSampleRate; | 75 gInverseSampleRate = 1.0 / context->audioSampleRate; |
76 | 76 |
77 // initialise strings & plectrums | 77 // initialise strings & plectrums |
92 } | 92 } |
93 | 93 |
94 return true; | 94 return true; |
95 } | 95 } |
96 | 96 |
97 void render(BeagleRTContext *context, void *userData) | 97 void render(BelaContext *context, void *userData) |
98 { | 98 { |
99 | 99 |
100 float lastAccel = 0; | 100 float lastAccel = 0; |
101 | 101 |
102 for(int n = 0; n < context->audioFrames; n++) { | 102 for(int n = 0; n < context->audioFrames; n++) { |
204 | 204 |
205 | 205 |
206 // cleanup_render() is called once at the end, after the audio has stopped. | 206 // cleanup_render() is called once at the end, after the audio has stopped. |
207 // Release any resources that were allocated in initialise_render(). | 207 // Release any resources that were allocated in initialise_render(). |
208 | 208 |
209 void cleanup(BeagleRTContext *context, void *userData) | 209 void cleanup(BelaContext *context, void *userData) |
210 { | 210 { |
211 | 211 |
212 } | 212 } |