20#ifndef SBL_CONTROL_MIDI_KEYS_HPP_
21#define SBL_CONTROL_MIDI_KEYS_HPP_
40 for (uint8_t i = 1; i < count_; ++i) {
41 held_[i - 1] = held_[i];
46 sound(held_[count_ - 1]);
56 sound(held_[count_ - 1]);
72 bool gate()
const {
return gate_; }
78 uint8_t
held()
const {
return count_; }
87 bool remove(uint8_t note) {
88 for (uint8_t i = 0; i < count_; ++i) {
89 if (held_[i].note != note) {
92 for (uint8_t j = i + 1; j < count_; ++j) {
93 held_[j - 1] = held_[j];
101 void sound(
const Held& h) {
102 pitch_ =
static_cast<float>(
static_cast<int>(h.note) -
REFERENCE_NOTE) / 12.0f;
103 velocity_ =
static_cast<float>(h.velocity) / 127.0f;
110 float velocity_ = 0.0f;
static constexpr uint8_t REFERENCE_NOTE
void note_on(uint8_t note, uint8_t velocity)
float pitch_octaves() const
static constexpr uint8_t HELD_NOTES
void note_off(uint8_t note)
The control stack: scheduler, event queue, merge, CC mapping, calibration.