tttapa / Control-Surface

Arduino library for creating MIDI controllers and other MIDI devices.
GNU General Public License v3.0
1.27k stars 140 forks source link

Switching presets Roland FP-30X #981

Closed Wallirec closed 5 months ago

Wallirec commented 11 months ago

`Hello! Please tell me how to use your library and a two-button controller to switch piano presets, there are not many of them, 56 in total. I couldn’t find examples to transfer |MSB|LSB|PC

tttapa commented 11 months ago

You could use something like this:

#include <Control_Surface.h>

USBMIDI_Interface midi;

void setup() {
  Control_Surface.begin();
  // Example: select “Ballad piano”
  Control_Surface.sendControlChange(MIDI_CC::Bank_Select, 16);
  Control_Surface.sendControlChange(MIDI_CC::Bank_Select_LSB, 67);
  Control_Surface.sendProgramChange(1); // Or zero, depends on Roland's convention
}

void loop() {
  Control_Surface.loop();
}
tttapa commented 11 months ago

So you want to cycle through the 56 presets using two buttons?
You'll have to use an integer variable that you update whenever a button is pressed: one button increments the variable (or resets it to zero after hitting the maximum setting), the other decrements it (or resets it to the maximum setting when going below zero). Then you look up the corresponding bank and program number in an array, using your variable as index.