Operator SDK
Build MIDI processing and UI modes for the Operator device
Loading...
Searching...
No Matches
midi.h File Reference

MIDI helper library (scales, chords, CC constants). More...

#include <cstdint>

Namespaces

namespace  op::sdk::midi
 MIDI note-name formatting and related helpers.
namespace  op
 Root namespace for the Operator SDK.
namespace  op::sdk
 Core SDK helpers for modes (timing, text, MIDI, and math).

Functions

void op::sdk::midi::note_name (uint8_t note, char out[5])
 Write the human-readable name for a MIDI note into out.
uint8_t op::sdk::midi::voice_chord (const uint8_t *input_notes, uint8_t count, int8_t octave_shift, uint8_t *out)
 Copy a chord voicing into out, transposed by octave_shift octaves and clamped to the MIDI range [0, 127].

Variables

constexpr uint8_t op::sdk::midi::kScaleMajor [] = {0, 2, 4, 5, 7, 9, 11}
 Major scale (Ionian).
constexpr uint8_t op::sdk::midi::kScaleNaturalMinor [] = {0, 2, 3, 5, 7, 8, 10}
 Natural minor scale (Aeolian).
constexpr uint8_t op::sdk::midi::kScaleHarmonicMinor [] = {0, 2, 3, 5, 7, 8, 11}
 Harmonic minor scale.
constexpr uint8_t op::sdk::midi::kScaleMelodicMinor [] = {0, 2, 3, 5, 7, 9, 11}
 Melodic minor scale (ascending).
constexpr uint8_t op::sdk::midi::kScaleDorian [] = {0, 2, 3, 5, 7, 9, 10}
 Dorian mode.
constexpr uint8_t op::sdk::midi::kScaleMixolydian [] = {0, 2, 4, 5, 7, 9, 10}
 Mixolydian mode.
constexpr uint8_t op::sdk::midi::kScaleBlues [] = {0, 3, 5, 6, 7, 10}
 Blues (hexatonic) scale.
constexpr uint8_t op::sdk::midi::kScaleWholeTone [] = {0, 2, 4, 6, 8, 10}
 Whole-tone scale.
constexpr uint8_t op::sdk::midi::kScalePentatonicMajor [] = {0, 2, 4, 7, 9}
 Major pentatonic scale.
constexpr uint8_t op::sdk::midi::kScalePentatonicMinor [] = {0, 3, 5, 7, 10}
 Minor pentatonic scale.
constexpr uint8_t op::sdk::midi::kScaleChromatic [] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
 Chromatic (12-tone) scale.
constexpr uint8_t op::sdk::midi::kCCModWheel = 1
 Modulation Wheel (CC 1).
constexpr uint8_t op::sdk::midi::kCCBreath = 2
 Breath controller (CC 2).
constexpr uint8_t op::sdk::midi::kCCFootPedal = 4
 Foot pedal (CC 4).
constexpr uint8_t op::sdk::midi::kCCPortamentoTime = 5
 Portamento Time (CC 5).
constexpr uint8_t op::sdk::midi::kCCDataEntry = 6
 Data Entry MSB (CC 6).
constexpr uint8_t op::sdk::midi::kCCVolume = 7
 Channel Volume (CC 7).
constexpr uint8_t op::sdk::midi::kCCBalance = 8
 Balance (CC 8).
constexpr uint8_t op::sdk::midi::kCCPan = 10
 Pan (CC 10).
constexpr uint8_t op::sdk::midi::kCCExpression = 11
 Expression (CC 11).
constexpr uint8_t op::sdk::midi::kCCEffect1 = 12
 Effect Controller 1 (CC 12).
constexpr uint8_t op::sdk::midi::kCCEffect2 = 13
 Effect Controller 2 (CC 13).
constexpr uint8_t op::sdk::midi::kCCSustain = 64
 Damper / Sustain pedal (CC 64).
constexpr uint8_t op::sdk::midi::kCCPortamento = 65
 Portamento on/off (CC 65).
constexpr uint8_t op::sdk::midi::kCCSostenuto = 66
 Sostenuto (CC 66).
constexpr uint8_t op::sdk::midi::kCCSoftPedal = 67
 Soft pedal (CC 67).
constexpr uint8_t op::sdk::midi::kCCLegato = 68
 Legato footswitch (CC 68).
constexpr uint8_t op::sdk::midi::kCCReset = 121
 Reset all controllers (CC 121).
constexpr uint8_t op::sdk::midi::kCCAllSoundOff = 120
 All Sound Off (CC 120).
constexpr uint8_t op::sdk::midi::kCCAllNotesOff = 123
 All Notes Off (CC 123).
constexpr uint8_t op::sdk::midi::kCCLocalControl = 122
 Local control on/off (CC 122).

Detailed Description

MIDI helper library (scales, chords, CC constants).

Header-only, opt-in, so usage is on demand.

Convention: note numbers use the standard MIDI scheme (middle C = 60, note 0 = C-1). Note-name formatting uses sharps only (never flats) for simplicity.