Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::midi::MidiMessageSequence Class Reference

Ordered sequence of MIDI events with editing operations. More...

#include <midi_message_sequence.hpp>

Public Member Functions

 MidiMessageSequence ()=default
void add_event (const TimestampedMidiEvent &event)
 Add an event (maintains sorted order by timestamp).
void add_note_on (double timestamp, int channel, int note, int velocity)
 Add a note-on event.
void add_note_off (double timestamp, int channel, int note)
 Add a note-off event.
void add_cc (double timestamp, int channel, int cc, int value)
 Add a CC event.
int size () const
 Number of events.
const TimestampedMidiEvent & operator[] (int i) const
 Access event by index.
void clear ()
 Clear all events.
double duration () const
 Duration (timestamp of last event).
std::vector< const TimestampedMidiEvent * > events_in_range (double start, double end) const
 Find events in a time range [start, end).
std::optional< int > find_note_off (int note_on_index) const
 Find matching note-off for a note-on event.
void offset_timestamps (double offset)
 Shift all timestamps by an offset.
const std::vector< TimestampedMidiEvent > & events () const
 Get all events (const).
auto begin () const
 Iterator support.
auto end () const

Detailed Description

Ordered sequence of MIDI events with editing operations.

Constructor & Destructor Documentation

◆ MidiMessageSequence()

pulp::midi::MidiMessageSequence::MidiMessageSequence ( )
default

Member Function Documentation

◆ add_cc()

void pulp::midi::MidiMessageSequence::add_cc ( double timestamp,
int channel,
int cc,
int value )
inline

Add a CC event.

◆ add_event()

void pulp::midi::MidiMessageSequence::add_event ( const TimestampedMidiEvent & event)
inline

Add an event (maintains sorted order by timestamp).

◆ add_note_off()

void pulp::midi::MidiMessageSequence::add_note_off ( double timestamp,
int channel,
int note )
inline

Add a note-off event.

◆ add_note_on()

void pulp::midi::MidiMessageSequence::add_note_on ( double timestamp,
int channel,
int note,
int velocity )
inline

Add a note-on event.

◆ begin()

auto pulp::midi::MidiMessageSequence::begin ( ) const
inline

Iterator support.

◆ clear()

void pulp::midi::MidiMessageSequence::clear ( )
inline

Clear all events.

◆ duration()

double pulp::midi::MidiMessageSequence::duration ( ) const
inline

Duration (timestamp of last event).

◆ end()

auto pulp::midi::MidiMessageSequence::end ( ) const
inline

◆ events()

const std::vector< TimestampedMidiEvent > & pulp::midi::MidiMessageSequence::events ( ) const
inline

Get all events (const).

◆ events_in_range()

std::vector< const TimestampedMidiEvent * > pulp::midi::MidiMessageSequence::events_in_range ( double start,
double end ) const
inline

Find events in a time range [start, end).

◆ find_note_off()

std::optional< int > pulp::midi::MidiMessageSequence::find_note_off ( int note_on_index) const
inline

Find matching note-off for a note-on event.

◆ offset_timestamps()

void pulp::midi::MidiMessageSequence::offset_timestamps ( double offset)
inline

Shift all timestamps by an offset.

◆ operator[]()

const TimestampedMidiEvent & pulp::midi::MidiMessageSequence::operator[] ( int i) const
inline

Access event by index.

◆ size()

int pulp::midi::MidiMessageSequence::size ( ) const
inline

Number of events.


The documentation for this class was generated from the following file: