|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
MIDI parser, encoder, SMF and sequencer. More...
MIDI parser, encoder, SMF and sequencer.
Namespaces | |
| namespace | cc |
Classes | |
| struct | MidiEvent |
| class | Parser |
| MIDI byte stream parser - state machine with running status. More... | |
| class | Sequencer |
| Plays a Standard MIDI File to a set of outputs. More... | |
| struct | SmfEvent |
| class | SmfReader |
| Checks a Standard MIDI File header in memory and finds its track chunks. More... | |
| class | SmfTrack |
| A cursor over one track chunk. More... | |
Typedefs | |
| using | MidiCallback = void(*)(const MidiEvent &event) |
Enumerations | |
| enum class | SmfError : uint8_t { None , NotSmf , BadHeader , UnsupportedFormat , SmpteDivision , TooManyTracks , Truncated } |
| Result of SmfReader::parse() More... | |
| enum class | MessageType : uint8_t { NoteOff = 0x80 , NoteOn = 0x90 , PolyPressure = 0xA0 , ControlChange = 0xB0 , ProgramChange = 0xC0 , ChannelPressure = 0xD0 , PitchBend = 0xE0 , Clock = 0xF8 , Start = 0xFA , Continue = 0xFB , Stop = 0xFC , ActiveSensing = 0xFE , SystemReset = 0xFF , SysEx = 0xF0 , SysExEnd = 0xF7 , TimeCode = 0xF1 , SongPosition = 0xF2 , SongSelect = 0xF3 , TuneRequest = 0xF6 , None = 0x00 } |
Functions | |
| template<typename Source , typename Thru > | |
| uint32_t | drain (Parser &parser, Thru &&thru) |
Push everything Source has waiting into parser, copying it to a thru. | |
| template<typename Source > | |
| uint32_t | drain (Parser &parser) |
Push everything Source has waiting into parser | |
| constexpr uint8_t | to_7bit (float value) |
| uint8_t | expected_data_bytes (uint8_t status) |
Variables | |
| constexpr uint32_t | DRAIN_CHUNK = 64 |
| constexpr uint8_t | CC_SWITCH_ON = 64 |
| constexpr uint8_t | DATA_MAX = 127 |
| using sbl::midi::MidiCallback = typedef void (*)(const MidiEvent& event) |
|
strong |
Result of SmfReader::parse()
| Enumerator | |
|---|---|
| None | the header and every track were found |
| NotSmf | no MThd header chunk at the start |
| BadHeader | header too short, zero division, or format 0 with more than one track |
| UnsupportedFormat | format 2 |
| SmpteDivision | division in SMPTE frames rather than ticks per quarter note |
| TooManyTracks | more tracks than SmfReader::MAX_TRACKS |
| Truncated | a chunk runs past the end of the data, or tracks are missing |
Definition at line 17 of file smf_reader.hpp.
|
inline |
Push everything Source has waiting into parser, copying it to a thru.
thru(const uint8_t* bytes, uint32_t count) is given every run of bytes as it is read, before the parser has them, to copy to another port.
| Source | A byte source in either shape above; block reads win if both exist |
| Thru | Callable taking (const uint8_t*, uint32_t) |
Definition at line 63 of file drain.hpp.
References DRAIN_CHUNK, and sbl::midi::Parser::push().
|
inline |
|
inlineconstexpr |
A value in [0, 1] as a 7-bit data byte, rounded to nearest; values outside are held to the ends.
Definition at line 56 of file types.hpp.
References DATA_MAX.
Referenced by sbl::control::CcMapper< Target >::on_cc(), and sbl::control::ParamEcho< Target >::poll().
|
inline |
Number of data bytes expected for a channel message status byte
Definition at line 174 of file types.hpp.
Referenced by sbl::midi::Parser::push().
|
inlineconstexpr |
|
inlineconstexpr |