-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrender.cpp
More file actions
32 lines (25 loc) · 716 Bytes
/
Copy pathrender.cpp
File metadata and controls
32 lines (25 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <Bela.h>
#include <libraries/Scope/Scope.h>
// instantiate the scope
Scope scope;
bool setup(BelaContext* context, void* userData)
{
// tell the scope how many channels and the sample rate
scope.setup(2, context->audioSampleRate);
return true;
}
void render(BelaContext* context, void* userData)
{
for (unsigned int n = 0; n < context->audioFrames; n++) {
float out_l = audioRead(context, n, 0);
float out_r = audioRead(context, n, 1);
// log to the scope
scope.log(out_l, out_r);
scope.trigger();
audioWrite(context, n, 0, out_l);
audioWrite(context, n, 0, out_r);
}
}
void cleanup(BelaContext* context, void* userData)
{
}