MIDI utils.
More...
#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <optional>
#include <span>
#include <string>
Go to the source code of this file.
|
| constexpr size_t | zrythm::utils::midi::midi_max_sysex_size () |
|
std::string_view | zrythm::utils::midi::midi_get_controller_name (midi_byte_t cc) |
| | Return the name of the given cc (0-127).
|
| void | zrythm::utils::midi::midi_get_bytes_from_combined (uint32_t val, midi_byte_t *lsb, midi_byte_t *msb) |
| | Used for MIDI controls whose values are split between MSB/LSB.
|
|
std::optional< std::string > | zrythm::utils::midi::midi_ctrl_change_get_description (std::span< const midi_byte_t > ctrl_change) |
| | Returns a string representation of the given control change event, if control change.
|
| std::optional< int > | zrythm::utils::midi::midi_ctrl_change_get_channel (std::span< const midi_byte_t > ctrl_change) |
| | Returns the MIDI channel of the given control change event, if control change.
|
|
int | zrythm::utils::midi::midi_get_msg_length (const uint8_t status_byte) |
| | Returns the length of the MIDI message based on the status byte.
|
|
std::string_view | zrythm::utils::midi::midi_get_note_name (midi_byte_t note) |
| | Returns the note name (eg, "C") for a value between 0 and 127.
|
|
std::string | zrythm::utils::midi::midi_get_note_name_with_octave (std::span< const midi_byte_t > short_msg) |
|
std::string | zrythm::utils::midi::midi_get_hex_str (std::span< const midi_byte_t > msg) |
|
std::string | zrythm::utils::midi::midi_print_to_str (std::span< const midi_byte_t > msg) |
|
void | zrythm::utils::midi::midi_print (std::span< const midi_byte_t > msg) |
|
std::string | zrythm::utils::midi::midi_get_meta_event_type_name (midi_byte_t type) |
MIDI utils.
Definition in file midi.h.
◆ midi_byte_t
MIDI byte.
Definition at line 43 of file midi.h.
◆ midi_ctrl_change_get_channel()
| std::optional< int > zrythm::utils::midi::midi_ctrl_change_get_channel |
( |
std::span< const midi_byte_t > | ctrl_change | ) |
|
Returns the MIDI channel of the given control change event, if control change.
- Parameters
-
- Returns
- int
◆ midi_get_bytes_from_combined()
Used for MIDI controls whose values are split between MSB/LSB.
- Parameters
-
| lsb | First byte (pos 1). |
| msb | Second byte (pos 2). |
◆ midi_max_sysex_size()
| size_t zrythm::utils::midi::midi_max_sysex_size |
( |
| ) |
|
|
constexpr |