dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx_midi.h File Reference
#include "dx_circular.h"
Include dependency graph for dx_midi.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  dx::midi::parser
 a MIDI 1.0 byte stream into its messages, the state between two bytes: write(const uint8_t* bytes, uint8_t size) takes each as it completes - a channel voice or system common message whole, its status resolved by running status, a real time byte alone wherever it falls, a system exclusive in pieces of up to three bytes with its F0 and F7 among them, which a status byte other than real time ends with an F7; a data byte without status and an F7 outside a system exclusive are dropped. A byte completes two pieces at most. More...
struct  dx::midi::ump::circular
 the ring of stamped Universal MIDI Packets: an entry is the stamp in two words, low first, and the words of one packet; a read cuts on whole entries, so a reader never sees a torn one The ring's size is a multiple of the word, so a word never wraps. More...
struct  dx::midi::ump::packet
 one packet with its moment: the dx::timestamp() it arrived at or is due at, the words of the packet, words() how many of them the message takes More...

Namespaces

namespace  dx
 dynax driver framework interface namespace
namespace  dx::midi
namespace  dx::midi::ump
 the Universal MIDI Packet: whole 32 bit words, one to four a packet, the message type in the top nibble of the first word saying how many, the group in the nibble below it

Enumerations

enum  dx::midi::ump::type : uint8_t {
  dx::midi::ump::utility = 0x0 , dx::midi::ump::system = 0x1 , dx::midi::ump::voice1 = 0x2 , dx::midi::ump::data64 = 0x3 ,
  dx::midi::ump::voice2 = 0x4 , dx::midi::ump::data128 = 0x5 , dx::midi::ump::flex = 0xd , dx::midi::ump::stream = 0xf
}

Functions

uint32_t dx::midi::ump::decode(const uint32_t* src, uint8_t* dst) noexcept
 one packet into MIDI 1.0 bytes: the bytes written returned, 0 for a packet that carries no MIDI 1.0 message (a MIDI 2.0 voice, a utility, a stream) A system exclusive comes out with F0 ahead of a start or a complete packet and F7 behind an end or a complete one; dst holds 8 bytes.
uint32_t dx::midi::ump::encode(uint8_t group, const uint8_t* src, size_t size, uint32_t* dst) noexcept
 MIDI 1.0 bytes into packets on a group: a message or a parser's piece per call, the words it takes returned - a channel voice or system message one word, a system exclusive's payload (its F0 and F7 aside) six bytes a 64 bit packet, the form complete, start, continue or end by the F0 ahead and the F7 behind; dst holds room for the packets, 0 for none.
constexpr bool dx::midi::exclusive(const uint8_t* bytes, size_t size) noexcept
 whether a parser's piece belongs to a system exclusive: its F0 ahead, its F7 behind, or data bytes alone
constexpr uint8_t dx::midi::following(uint8_t status) noexcept
 the data bytes a MIDI 1.0 status byte is followed by (system exclusive open ended: 0xff)
constexpr uint8_t dx::midi::ump::group(uint32_t word0) noexcept
uint8_t dx::midi::transmit(uint8_t& status, const uint8_t* src, uint8_t size, uint8_t* dst) noexcept
 a message or a parser's piece onto a MIDI 1.0 wire under running status: a channel voice status that repeats the wire's status left out, a system common or exclusive one clearing it, real time keeping it; the bytes written into dst, which holds size, returned
constexpr uint8_t dx::midi::ump::type(uint32_t word0) noexcept
constexpr uint8_t dx::midi::ump::words(uint32_t word0) noexcept
 the words a packet holds, by the message type of its first word