|
Zrythm v2.0.0-alpha.1+31.4967fd053471
a highly automated and intuitive digital audio workstation
|
Factory functions and algorithms for MidiEvent containers. More...
Data Structures | |
| struct | NoteOffBeforeNoteOnCompare |
| Comparator for sorting MidiEvents by time, with noteOff before noteOn at the same timestamp. More... | |
Functions | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_note_on (midi_byte_t channel, midi_byte_t note_pitch, midi_byte_t velocity, TimeType time) |
| Creates a note on event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_note_off (midi_byte_t channel, midi_byte_t note_pitch, TimeType time) |
| Creates a note off event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_control_change (midi_byte_t channel, midi_byte_t controller, midi_byte_t value, TimeType time) |
| Creates a control change event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_pitchbend (midi_byte_t channel, uint32_t pitchbend, TimeType time) |
| Creates a pitchbend event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_channel_pressure (midi_byte_t channel, midi_byte_t value, TimeType time) |
| Creates a channel pressure (aftertouch) event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_all_notes_off (midi_byte_t channel, TimeType time) |
| Creates an all-notes-off event. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_raw_rt (std::span< const midi_byte_t > raw, TimeType time) noexcept |
| Creates a MIDI event from the given bytes, RT-safe. | |
| template<typename TimeType> | |
| MidiEvent< TimeType > | make_raw (std::span< const midi_byte_t > raw, TimeType time) |
| Creates a raw MIDI event from the given bytes. | |
| template<std::ranges::random_access_range Container> | |
| void | sort_with_note_off_priority (Container &container) |
| Sorts events by time, with noteOff before noteOn at the same timestamp. | |
| template<std::ranges::random_access_range Container> | |
| void | sort (Container &container) |
| Sorts events by time only. | |
| template<std::ranges::random_access_range Container> | |
| void | set_channel (Container &container, midi_byte_t channel) |
| Sets the MIDI channel on all events in the container. | |
| template<typename TimeType, utils::MutableContainerOf< MidiEvent< TimeType > > DestContainer, std::ranges::range SrcContainer> | |
| void | append_in_range (DestContainer &dest, const SrcContainer &src, std::pair< TimeType, TimeType > range) |
| void | sort_with_note_off_priority (MidiEventBuffer &buf) noexcept |
| void | append_in_range (MidiEventBuffer &dst, const MidiEventBuffer &src, std::pair< units::sample_u32_t, units::sample_u32_t > range) noexcept |
Append events from src to dst, filtered by time range [range.first, range.second). | |
Factory functions and algorithms for MidiEvent containers.
| void zrythm::dsp::midi_event::append_in_range | ( | DestContainer & | dest, |
| const SrcContainer & | src, | ||
| std::pair< TimeType, TimeType > | range ) |
Definition at line 387 of file midi_event.h.
|
inlinenoexcept |
Append events from src to dst, filtered by time range [range.first, range.second).
Definition at line 368 of file midi_event_buffer.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_all_notes_off | ( | midi_byte_t | channel, |
| TimeType | time ) |
Creates an all-notes-off event.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 260 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_channel_pressure | ( | midi_byte_t | channel, |
| midi_byte_t | value, | ||
| TimeType | time ) |
Creates a channel pressure (aftertouch) event.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 241 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_control_change | ( | midi_byte_t | channel, |
| midi_byte_t | controller, | ||
| midi_byte_t | value, | ||
| TimeType | time ) |
Creates a control change event.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 195 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_note_off | ( | midi_byte_t | channel, |
| midi_byte_t | note_pitch, | ||
| TimeType | time ) |
Creates a note off event.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 174 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_note_on | ( | midi_byte_t | channel, |
| midi_byte_t | note_pitch, | ||
| midi_byte_t | velocity, | ||
| TimeType | time ) |
Creates a note on event.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 149 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_pitchbend | ( | midi_byte_t | channel, |
| uint32_t | pitchbend, | ||
| TimeType | time ) |
Creates a pitchbend event.
| channel | MIDI channel (0-based, 0-15). |
| pitchbend | 0 to 16384 (8192 = center). |
Definition at line 219 of file midi_event.h.
| MidiEvent< TimeType > zrythm::dsp::midi_event::make_raw | ( | std::span< const midi_byte_t > | raw, |
| TimeType | time ) |
Creates a raw MIDI event from the given bytes.
Handles arbitrarily-sized payloads (including SysEx) by allocating external storage. Not RT-safe — use make_raw_rt() in RT contexts.
Definition at line 298 of file midi_event.h.
|
noexcept |
Creates a MIDI event from the given bytes, RT-safe.
Only handles inline messages (≤ inline_capacity bytes). Asserts on larger payloads — use make_raw() for those (not RT-safe).
Definition at line 280 of file midi_event.h.
| void zrythm::dsp::midi_event::set_channel | ( | Container & | container, |
| midi_byte_t | channel ) |
Sets the MIDI channel on all events in the container.
| channel | MIDI channel (0-based, 0-15). |
Definition at line 365 of file midi_event.h.
| void zrythm::dsp::midi_event::sort | ( | Container & | container | ) |
Sorts events by time only.
Event ordering at the same timestamp is preserved (stable sort). Producers (caches, input processors) are responsible for inserting events in the correct order.
Definition at line 352 of file midi_event.h.
| void zrythm::dsp::midi_event::sort_with_note_off_priority | ( | Container & | container | ) |
Sorts events by time, with noteOff before noteOn at the same timestamp.
Definition at line 340 of file midi_event.h.
|
inlinenoexcept |
Definition at line 352 of file midi_event_buffer.h.