Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::control::MidiKeys Class Reference

Detailed Description

Definition at line 27 of file midi_keys.hpp.

Public Member Functions

void note_on (uint8_t note, uint8_t velocity)
 
void note_off (uint8_t note)
 
void all_notes_off ()
 
float pitch_octaves () const
 
bool gate () const
 
float velocity () const
 
uint8_t held () const
 

Static Public Attributes

static constexpr uint8_t REFERENCE_NOTE = 60
 
static constexpr uint8_t HELD_NOTES = 8
 

Member Function Documentation

◆ note_on()

void sbl::control::MidiKeys::note_on ( uint8_t  note,
uint8_t  velocity 
)
inline

A note on. Velocity 0 is a note off, as MIDI has it.

Definition at line 33 of file midi_keys.hpp.

References HELD_NOTES, note_off(), and velocity().

◆ note_off()

void sbl::control::MidiKeys::note_off ( uint8_t  note)
inline

A note off. Releasing the sounding note returns to the newest held note, or drops the gate.

Definition at line 51 of file midi_keys.hpp.

Referenced by note_on().

◆ all_notes_off()

void sbl::control::MidiKeys::all_notes_off ( )
inline

Every note released: the gate drops, pitch and velocity stay.

Definition at line 63 of file midi_keys.hpp.

◆ pitch_octaves()

float sbl::control::MidiKeys::pitch_octaves ( ) const
inline

Octaves relative to REFERENCE_NOTE of the sounding note, or the last one.

Definition at line 69 of file midi_keys.hpp.

◆ gate()

bool sbl::control::MidiKeys::gate ( ) const
inline

High while any note is held.

Definition at line 72 of file midi_keys.hpp.

◆ velocity()

float sbl::control::MidiKeys::velocity ( ) const
inline

The sounding note's velocity in [0, 1], 127 at 1; the last one's after release.

Definition at line 75 of file midi_keys.hpp.

Referenced by note_on().

◆ held()

uint8_t sbl::control::MidiKeys::held ( ) const
inline

How many notes are held.

Definition at line 78 of file midi_keys.hpp.

Member Data Documentation

◆ REFERENCE_NOTE

constexpr uint8_t sbl::control::MidiKeys::REFERENCE_NOTE = 60
staticconstexpr

octave 0: middle C

Definition at line 29 of file midi_keys.hpp.

◆ HELD_NOTES

constexpr uint8_t sbl::control::MidiKeys::HELD_NOTES = 8
staticconstexpr

the stack's depth

Definition at line 30 of file midi_keys.hpp.

Referenced by note_on().


The documentation for this class was generated from the following file: