cs-midi-docs/docs/manual/01-getting-started/04-faq.md

1.7 KiB

FAQ

Original: Frequently Asked Questions

Can cs-midi be used as a general MIDI library?

Yes. You can use the MIDI interface objects directly for sending and receiving, without using the element system or Control_Surface singleton.

Sending:

BluetoothMIDI_Interface midi;

int main() {
    stdio_init_all();
    if (cyw43_arch_init()) return 1;
    midi.begin();
    midi.sendNoteOn({MIDI_Notes::C[4], Channel_1}, 127);
    midi.sendNoteOff({MIDI_Notes::C[4], Channel_1}, 127);
    while (true) { midi.update(); sleep_ms(1); }
}

Receiving with callbacks:

struct MyCallbacks : MIDI_Callbacks {
    void onChannelMessage(MIDI_Interface &, ChannelMessage msg) override {
        // handle msg
        (void)msg;
    }
} cb;

// in main(): midi.setCallbacks(cb);

Can addresses or channels be changed at runtime?

Yes, through banks. A Bank<N> groups bankable elements and a selector controls which bank is active. See the Banks examples.

What's the difference from Control Surface?

cs-midi is a source-level extraction of Control Surface for pico-sdk. Key differences:

  • #include <cs_midi.h> instead of #include <Control_Surface.h>
  • Standard main() replaces Arduino setup()/loop()
  • cs:: namespace instead of top-level
  • BTstack BLE backend instead of ArduinoBLE/Bluedroid
  • No MCU protocol, displays, FastLED, or hardware expanders (yet)

What radio modules are supported?

The BLE transport uses BTstack with the CYW43 radio. Only the Infineon RM2 module has been tested. Other CYW43 variants may work but are unverified.