35 lines
873 B
C++
35 lines
873 B
C++
// Dual transport — BLE + AppleMIDI with pipe routing.
|
|
// Elements send to both interfaces simultaneously.
|
|
// BLE for direct iOS/macOS connection, AppleMIDI for DAW integration.
|
|
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface ble;
|
|
AppleMIDI_Interface applemidi {"PicoW-MIDI", 5004};
|
|
|
|
MIDI_PipeFactory<2> pipes;
|
|
|
|
NoteButton button {5, {MIDI_Notes::C[4], Channel_1}};
|
|
CCRotaryEncoder enc {{0, 2}, {16, Channel_1}, 1, 4};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
|
|
cyw43_arch_enable_sta_mode();
|
|
cyw43_arch_wifi_connect_blocking("SSID", "PASS", CYW43_AUTH_WPA2_AES_PSK);
|
|
|
|
Control_Surface >> pipes >> ble;
|
|
Control_Surface >> pipes >> applemidi;
|
|
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|