C++ API Overview
Use this reference while building native Matrix OS applications. Start with the app guide, then jump into the API pages that match the behavior you are adding.
Recommended Reading Orderβ
| Need | Start Here |
|---|---|
| Read device input | Input |
| Draw LEDs | LED |
| Send or receive MIDI | MIDI |
| Save settings | NVS |
| Read or write files | FileSystem |
| Control app/system behavior | System |
| Work with USB, HID, or logs | USB, HID, Logging |
| Build on-screen menus | UI Framework |
| Use shared value types | Types |
| Use helper utilities | Utilities |
App Loop Patternβ
Native apps should keep Loop() cooperative: drain input or MIDI events, update app state, draw only when needed, then return so Matrix OS can continue running other work.
void MyApp::Loop() {
InputEvent event;
while (MatrixOS::Input::Get(&event))
{
if (event.inputClass == InputClass::Keypad)
{
// Update app state from event.keypad.
}
}
}
For a complete minimal native app, start with Code Your Application (C++). If you are updating older native code, read Migration From 3.x to 4.x after you understand the current Input API.
Comments