It should work.
For instance, take the bela-to-gui example and apply the following changes:
to the.cpp file:
@@ -63,7 +63,7 @@ void render(BelaContext *context, void *userData)
{
gNumber++;
gui.sendBuffer(0, gNumber);
-
+ gui.sendBuffer(1, gNumber + 1);
//and we reset the counter
count = 0;
}
and to the js side:
@@ -28,7 +28,7 @@ function setup() {
function draw() {
//Read buffer with index 0 coming from render.cpp.
- let counter = Bela.data.buffers[0];
+ let counter = Bela.data.buffers[0] + '+' + Bela.data.buffers[1];
//We change the background color
//When starting the program, if Bela hasn't sent any value yet, counter could take the value NaN (not a number),
@@ -44,7 +44,7 @@ function draw() {
//Format and display text
fill(100, 0, 255);
//Adjust the size of the text to the window width
- textSize(windowWidth / 4);
+ textSize(windowWidth / 10); // ensure we see the whole thing on screen
//Display text
text(counter, 0.4 * (windowWidth), windowHeight / 2);