43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
# cs-midi
|
|
|
|
A standalone pico-sdk extraction of [tttapa/Control-Surface](https://github.com/tttapa/Control-Surface) (GPL-3.0).
|
|
|
|
cs-midi provides the core MIDI element system, BLE MIDI transport, banks, selectors, and the declarative `Control_Surface` singleton for use with the Raspberry Pi Pico SDK and the CYW43 radio module (BTstack BLE backend).
|
|
|
|
## Getting Started
|
|
|
|
```cpp
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface midi;
|
|
|
|
NoteButton button {5, {MIDI_Notes::C[4], Channel_1}};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|
|
```
|
|
|
|
## Differences from Control Surface
|
|
|
|
- `#include <cs_midi.h>` replaces `#include <Control_Surface.h>`
|
|
- `cs::BluetoothMIDI_Interface` replaces `USBMIDI_Interface`
|
|
- Standard `main()` with `cyw43_arch_init()` replaces Arduino `setup()`/`loop()`
|
|
- All types live in the `cs::` namespace
|
|
- No `MCU::` namespace — use raw CC numbers or `MIDI_CC::` constants
|
|
|
|
## Credits
|
|
|
|
Original library: [Control Surface](https://github.com/tttapa/Control-Surface) by **Pieter P (tttapa)** (GPL-3.0).
|
|
pico-sdk port: [pszsh](https://else-if.org).
|