34 lines
799 B
Markdown
34 lines
799 B
Markdown
# AppleMIDI (RTP-MIDI over WiFi)
|
|
|
|
RTP-MIDI over WiFi — appears as a Bonjour MIDI device in macOS Audio MIDI Setup,
|
|
Windows rtpMIDI, and iOS. Requires WiFi connection before `Control_Surface.begin()`.
|
|
|
|
Build with `CS_MIDI_APPLEMIDI=ON`.
|
|
|
|
```cpp
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
AppleMIDI_Interface midi {"PicoW-MIDI", 5004};
|
|
|
|
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.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|
|
```
|