Bounded chord memory: capture a chord once, then play it from single notes. More...
#include <chord_memory.hpp>
Public Member Functions | |
| ChordMemory (ChordMemorySpec spec={}) noexcept | |
| bool | valid () const noexcept |
| ChordMemorySpec | spec () const noexcept |
| bool | memory_empty () const noexcept |
| True while nothing is captured, which is the kernel's declared bypass identity: every event passes through byte for byte. | |
| bool | learn (std::span< const std::uint8_t > notes) noexcept |
| Capture notes as an interval shape relative to its own lowest note. | |
| bool | learn_for (std::uint8_t trigger, std::span< const std::uint8_t > notes) noexcept |
| Capture notes as the shape trigger's pitch class plays. | |
| void | clear_memory () noexcept |
| std::size_t | chord_for (std::uint8_t trigger, std::array< std::uint8_t, kMaxChordNotes > &out) const noexcept |
| The chord trigger produces, written into out. | |
| MidiUtilityProcessReport | process (const MidiBuffer &input, MidiBuffer &output) noexcept |
| MidiUtilityProcessReport | flush (MidiBuffer &output) noexcept |
| Release every note the kernel owns. | |
| MidiUtilityProcessReport | reset (MidiBuffer &output) noexcept |
| MidiUtilityProcessReport | replace_spec (ChordMemorySpec spec, MidiBuffer &output) noexcept |
| Swap the spec. | |
| bool | empty () const noexcept |
Static Public Member Functions | |
| static constexpr MidiUtilityContract | contract () noexcept |
| static constexpr bool | valid_spec (ChordMemorySpec spec) noexcept |
Static Public Attributes | |
| static constexpr std::size_t | kMaxChordNotes = music::ChordFormula::kMaxNotes |
Bounded chord memory: capture a chord once, then play it from single notes.
Memory holds interval shapes, never absolute pitches, so a captured chord is meaningful at every trigger. With nothing captured the kernel is exact passthrough, which is its declared identity.
|
inlineexplicitnoexcept |
|
inlinenoexcept |
The chord trigger produces, written into out.
Returns the note count, or 0 when nothing is captured for that trigger. Pure: it reads memory and the spec but no per-block state, so a test or a UI can predict the chord without pushing events through the kernel.
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Release every note the kernel owns.
|
inlinenoexcept |
Capture notes as an interval shape relative to its own lowest note.
Control-thread work: it validates and stores, and never emits.
|
inlinenoexcept |
Capture notes as the shape trigger's pitch class plays.
Only meaningful in PerKey mode.
|
inlinenoexcept |
True while nothing is captured, which is the kernel's declared bypass identity: every event passes through byte for byte.
|
inlinenoexcept |
|
inlinenoexcept |
Swap the spec.
Applied only once every owned note has been released, so a mode change can never orphan a sounding chord.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
staticconstexpr |