Crate helgoboss_midi

Source
Expand description

Interfaces, data structures and utilities for dealing with MIDI messages.

§Features

  • Complete support for the following message types:
    • Short messages (3 bytes)
    • 14-bit Control Change messages
    • (N)RPN messages
  • Scanners for extracting 14-bit Control Change and (N)RPN messages from a stream of short messages
  • Suitable for real-time usage (no heap allocation, no dynamic dispatch, no locking)
  • Unified API to work with different short message data structures (see ShortMessage trait)
  • Uses wording which is as close as possible to the MIDI 1.0 specification

§Not yet implemented

Data structures and utilities for dealing with System Exclusive messages are not yet implemented. They will be added eventually as separate structures on top of the existing ones (similar to (N)RPN and 14-bit Control Change).

§Examples

See how to …

Modules§

controller_numbers
Contains predefined controller numbers.
test_util
Contains convenience functions for creating messages with minimum boilerplate

Structs§

Channel
A MIDI channel (0 - 15).
ControlChange14BitMessage
A 14-bit MIDI Control Change message.
ControlChange14BitMessageScanner
Scanner for detecting 14-bit Control Change messages in a stream of short MIDI messages.
ControllerNumber
A controller number (0 - 127) of a MIDI Control Change message.
FromBytesError
An error which can occur when trying to create a ShortMessage from raw bytes.
KeyNumber
A key number (0 - 127), e.g. of a MIDI Note On message.
ParameterNumberMessage
A MIDI Parameter Number message, either registered (RPN) or non-registered (NRPN).
ParameterNumberMessageScanner
Scanner for detecting (N)RPN messages in a stream of short messages without polling.
ParseIntError
An error which can occur when parsing a string to one of the MIDI integer types.
PollingParameterNumberMessageScanner
Scanner for detecting (N)RPN messages in a stream of short messages with polling.
RawShortMessage
A short message implemented as a tuple of bytes.
TryFromGreaterError
An error which can occur when converting from a type with a greater value range to one with a smaller one.
U4
A 4-bit integer (0 - 15).
U7
A 7-bit integer (0 - 127).
U14
A 14-bit integer (0 - 16383).

Enums§

DataEntryByteOrder
The desired byte order of a data entry value.
DataType
Type of the value that is encoded in a parameter number message.
FuzzyMessageSuperType
Like MessageSuperType but without distinction between different channel messages.
MessageMainCategory
The most high-level classification of MIDI messages.
MessageSuperType
A more coarse-grained classification of MIDI messages than ShortMessageType.
ShortMessageType
The most fine-grained classification of short MIDI messages.
StructuredShortMessage
A short message implemented as an enum where each variant contains exactly the data which is relevant for the particular message type.
TimeCodeQuarterFrame
Possible contents of a MIDI Time Code Quarter Frame message.
TimeCodeType
Possible time code types of a MIDI Time Code Quarter Frame message.

Traits§

ShortMessage
A single short MIDI message, where short means it’s made up by a maximum of 3 bytes.
ShortMessageFactory
Static methods for creating short MIDI messages.