|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Checks a Standard MIDI File header in memory and finds its track chunks. More...
Checks a Standard MIDI File header in memory and finds its track chunks.
Reads a Standard MIDI File already in memory: no filesystem, no allocation, nothing copied. The reader checks the header and finds the track chunks; an SmfTrack walks one track's events in order, one at a time.
What it understands (Standard MIDI Files 1.0):
Usage:
Definition at line 267 of file smf_reader.hpp.
#include <smf_reader.hpp>
Public Member Functions | |
| SmfError | parse (const uint8_t *data, size_t size) |
| Check the header and find the tracks. | |
| SmfError | error () const |
| The result of the last parse() | |
| uint16_t | format () const |
| The file's format, 0 or 1. | |
| uint8_t | track_count () const |
| Track chunks found. | |
| uint16_t | ticks_per_quarter () const |
| The header's division: ticks per quarter note. | |
| SmfTrack | track (uint8_t index) const |
| A fresh cursor at the start of a track. | |
Static Public Attributes | |
| static constexpr uint8_t | MAX_TRACKS = 16 |
|
inline |
Check the header and find the tracks.
| data | File bytes; they must outlive the reader and its tracks |
| size | File length in bytes |
Definition at line 277 of file smf_reader.hpp.
References sbl::midi::BadHeader, format(), MAX_TRACKS, sbl::midi::None, sbl::midi::NotSmf, sbl::midi::SmpteDivision, sbl::midi::TooManyTracks, sbl::midi::Truncated, and sbl::midi::UnsupportedFormat.
|
inline |
The result of the last parse()
Definition at line 331 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::load().
|
inline |
The file's format, 0 or 1.
Definition at line 333 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::load(), and parse().
|
inline |
Track chunks found.
Definition at line 335 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::load().
|
inline |
The header's division: ticks per quarter note.
Definition at line 337 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::load().
|
inline |
A fresh cursor at the start of a track.
| index | Track number, 0 to track_count() - 1 |
Definition at line 344 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::load().
|
staticconstexpr |
track chunks the reader records
Definition at line 269 of file smf_reader.hpp.
Referenced by parse().