Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::widgets::MidiConverter Class Reference

Detailed Description

Definition at line 58 of file midi_converter.hpp.

#include <midi_converter.hpp>

Public Member Functions

void note_on (uint8_t note, uint8_t vel)
 Note on. Sets pitch, gate (with velocity strength), and velocity.
 
void note_off (uint8_t note)
 
void cc (uint8_t number, uint8_t value)
 CC value. Stores normalized value for the given CC number.
 
void pitch_bend (int16_t value)
 Pitch bend. Raw MIDI value: -8192 to +8191.
 
void aftertouch (uint8_t value)
 Channel aftertouch.
 
float pitch () const
 Pitch as [0,1] mapped to the configured note range.
 
float gate () const
 Gate state. 0.0 = off, (0,1] = on with velocity strength.
 
float velocity () const
 Last note-on velocity as [0,1]. Held until next note-on.
 
float pressure () const
 Channel aftertouch as [0,1].
 
float bend () const
 Pitch bend as [-1,1].
 
float cc (Cc cc_num) const
 CC value by enum. Returns [0,1].
 
float cc (uint8_t cc_num) const
 CC value by raw index. Returns [0,1].
 
void set_pitch_range (uint8_t min_note, uint8_t max_note)
 Set the note range for pitch normalization. Default: 24–120.
 
void reset ()
 Reset all state to initial values.
 

Member Function Documentation

◆ note_on()

void sbl::dsp::widgets::MidiConverter::note_on ( uint8_t  note,
uint8_t  vel 
)
inline

Note on. Sets pitch, gate (with velocity strength), and velocity.

Definition at line 63 of file midi_converter.hpp.

◆ note_off()

void sbl::dsp::widgets::MidiConverter::note_off ( uint8_t  note)
inline

Note off. Clears gate only if note matches current note (last-note priority). Pitch and velocity are held.

Definition at line 73 of file midi_converter.hpp.

◆ cc() [1/3]

void sbl::dsp::widgets::MidiConverter::cc ( uint8_t  number,
uint8_t  value 
)
inline

CC value. Stores normalized value for the given CC number.

Definition at line 80 of file midi_converter.hpp.

◆ pitch_bend()

void sbl::dsp::widgets::MidiConverter::pitch_bend ( int16_t  value)
inline

Pitch bend. Raw MIDI value: -8192 to +8191.

Definition at line 85 of file midi_converter.hpp.

◆ aftertouch()

void sbl::dsp::widgets::MidiConverter::aftertouch ( uint8_t  value)
inline

Channel aftertouch.

Definition at line 94 of file midi_converter.hpp.

◆ pitch()

float sbl::dsp::widgets::MidiConverter::pitch ( ) const
inline

Pitch as [0,1] mapped to the configured note range.

Definition at line 101 of file midi_converter.hpp.

◆ gate()

float sbl::dsp::widgets::MidiConverter::gate ( ) const
inline

Gate state. 0.0 = off, (0,1] = on with velocity strength.

Definition at line 104 of file midi_converter.hpp.

◆ velocity()

float sbl::dsp::widgets::MidiConverter::velocity ( ) const
inline

Last note-on velocity as [0,1]. Held until next note-on.

Definition at line 107 of file midi_converter.hpp.

◆ pressure()

float sbl::dsp::widgets::MidiConverter::pressure ( ) const
inline

Channel aftertouch as [0,1].

Definition at line 110 of file midi_converter.hpp.

◆ bend()

float sbl::dsp::widgets::MidiConverter::bend ( ) const
inline

Pitch bend as [-1,1].

Definition at line 113 of file midi_converter.hpp.

◆ cc() [2/3]

float sbl::dsp::widgets::MidiConverter::cc ( Cc  cc_num) const
inline

CC value by enum. Returns [0,1].

Definition at line 116 of file midi_converter.hpp.

◆ cc() [3/3]

float sbl::dsp::widgets::MidiConverter::cc ( uint8_t  cc_num) const
inline

CC value by raw index. Returns [0,1].

Definition at line 121 of file midi_converter.hpp.

◆ set_pitch_range()

void sbl::dsp::widgets::MidiConverter::set_pitch_range ( uint8_t  min_note,
uint8_t  max_note 
)
inline

Set the note range for pitch normalization. Default: 24–120.

Definition at line 128 of file midi_converter.hpp.

◆ reset()

void sbl::dsp::widgets::MidiConverter::reset ( )
inline

Reset all state to initial values.

Definition at line 134 of file midi_converter.hpp.


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