- Edited
Hey everyone! I am trying to make an installation where sounds will be input into the Bela and then affected by different effects, and then output via speakers. The FX will be controlled by sliders in javascript via a phone. I have followed this page https://learn.bela.io/tutorials/pure-data/communication/controlling-bela-from-a-gui/ and got to the point where I was able to output and control the pitch of a sine wave via my phone. However, I am trying to connect more sliders to my phone but it's a bit difficult. I am using the Array method and it works for a single slider but I am not sure how to do it for multiple sliders. Perhaps I should be using the control method? I am still finding it hard to decipher how arrays work but when I try to add more sliders it kind of glitches out and feels like there's too much data flowing in.
This is my Java script code.
let reverbSlider;
let delaySlider;
let flangerSlider;
let resonatorSlider;
let combSlider;
let slider
function setup() {
createCanvas(windowWidth, windowHeight);
// slider = createSlider(0, 360, 0, 0);
// slider.position(windowWidth/3, windowHeight/5);
//slider.style('width', '200px');
reverbSlider = createSlider(0, 360, 0, 0);
reverbSlider.position(windowWidth/3, windowHeight/5);
reverbSlider.style('width', '200px');
delaySlider = createSlider(0, 360, 0, 0);
delaySlider.position(windowWidth/3, windowHeight/4);
delaySlider.style('width', '200px');
flangerSlider = createSlider(0, 360, 0, 0);
flangerSlider.position(windowWidth/3, windowHeight/4);
flangerSlider.style('width', '200px');
resonatorSlider = createSlider(0, 360, 0, 0);
resonatorSlider.position(windowWidth/3, windowHeight/4);
resonatorSlider.style('width', '200px');
combSlider = createSlider(0, 360, 0, 0);
combSlider.position(windowWidth/3, windowHeight/4);
combSlider.style('width', '200px');
}
function draw() {
background(220);
line(mouseX, 0, mouseX, height);
line(0, mouseY, width, mouseY);
let reverbSliderVal = reverbSlider.value();
let delaySliderVal = delaySlider.value();
let flangerSliderVal = flangerSlider.value();
let resonatorSliderVal = resonatorSlider.value();
let combSliderVal = combSlider.value();
Bela.data.sendBuffer(0, 'float', [reverbSliderVal]);
Bela.data.sendBuffer(0, 'float', [delaySlider]);
Bela.data.sendBuffer(0, 'float', [flangerSliderVal]);
Bela.data.sendBuffer(0, 'float', [resonatorSlider]);
Bela.data.sendBuffer(0, 'float', [combSliderVal]);
// Bela.data.sendBuffer(0, 'float', [0, 1, 2]);
// Bela.data.sendBuffer(0, 'float', [100, 101, 102]);
}
And this is my pure data patch+how the sliders look like on a web browser. The idea is to have 5 of them (labelled) and the FX will be reverb, flanger etc.

Any ideas or help would be appreciated.
Thanks <3