27 lines
545 B
Markdown
27 lines
545 B
Markdown
# USB MIDI
|
|
|
|
USB MIDI device interface via TinyUSB.
|
|
|
|
Requires `tusb_config.h` and `usb_descriptors.c` in the project — see `lib/cs-midi/templates/` for reference files. Link `tinyusb_device` and `tinyusb_board` in CMake.
|
|
|
|
```cpp pico
|
|
#include "pico/stdlib.h"
|
|
#include "tusb.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
USBMIDI_Interface midi;
|
|
|
|
NoteButton button {5, {MIDI_Notes::C[4], Channel_1}};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
tusb_init();
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
}
|
|
}
|
|
```
|