Replies: 1 comment 1 reply
-
If you have a handful of programs, you can use the Program-Changer or ManyAddressesPCButton examples with an IncrementDecrementSelector. If you want a contiguous range of program numbers, you could try something like this: #include <Control_Surface.h>
template <setting_t NumPrograms = 128>
class FullRangeProgramChanger : public Selectable<NumPrograms> {
public:
FullRangeProgramChanger(MIDIAddress firstProgram = 0) : firstProgram(firstProgram) {}
void select(setting_t setting) override {
Control_Surface.sendPC(firstProgram + this->validateSetting(setting));
}
private:
MIDIAddress firstProgram;
};
USBMIDI_Interface midi;
FullRangeProgramChanger<128> pc; // can select any of the 128 MIDI programs
IncrementDecrementSelector<128> selector {
pc, // this selector controls the program changer
{2, 3}, // push button pins (increment, decrement)
Wrap::Wrap, // Wrap around
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, does the library have selectors to switch PC up and down?
One button switches up the PC, the second button lowers the PC.
Beta Was this translation helpful? Give feedback.
All reactions