52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Bank with bankable CC input elements.
|
|
// Demonstrates bank switching with input-side bankable elements.
|
|
// Note: bankable OUTPUT elements (e.g. Bankable::CCPotentiometer) are not yet
|
|
// extracted. This example uses bankable INPUT elements instead.
|
|
// Original concept: examples/5.Banks/Bank/Bank.ino
|
|
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface midi;
|
|
|
|
// 4 banks, 2 tracks per bank
|
|
Bank<4> bank(2);
|
|
|
|
// Selector: two buttons to increment/decrement the active bank
|
|
IncrementDecrementSelector<4> selector {
|
|
bank,
|
|
{2, 3},
|
|
Wrap::Wrap,
|
|
};
|
|
|
|
// Bankable CC value readers — bank switching changes the CC address.
|
|
// Bank 1: reads CC 16, CC 17
|
|
// Bank 2: reads CC 18, CC 19
|
|
// Bank 3: reads CC 20, CC 21
|
|
// Bank 4: reads CC 22, CC 23
|
|
Bankable::CCValue<4> ccVal1 {
|
|
{bank, BankType::ChangeAddress},
|
|
{16, Channel_1},
|
|
};
|
|
Bankable::CCValue<4> ccVal2 {
|
|
{bank, BankType::ChangeAddress},
|
|
{17, Channel_1},
|
|
};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
uint8_t v1 = ccVal1.getValue();
|
|
uint8_t v2 = ccVal2.getValue();
|
|
(void)v1;
|
|
(void)v2;
|
|
sleep_ms(1);
|
|
}
|
|
}
|