Midi Parser
A simple library that reads and parses binary MIDI files
MidiEvent Class Reference

Contains data of the Midi event. More...

#include <MidiEvent.h>

Inheritance diagram for MidiEvent:
Event

Public Member Functions

 MidiEvent (const char *filePath, long addr)
 
 ~MidiEvent () override=default
 
MidiEventclone () const override
 
MidiType::EventType getType () const override
 
MidiType::MidiMessageStatus getStatus () const
 
uint8_t getChannel () const
 
uint8_t getNote () const
 
uint8_t getVelocity () const
 
uint16_t getData () const
 
- Public Member Functions inherited from Event
virtual ~Event ()=default
 
uint8_t getByteLength () const
 

Protected Attributes

uint8_t status {}
 
uint16_t data {}
 
- Protected Attributes inherited from Event
uint8_t byteLength {}
 

Static Protected Attributes

static uint8_t lastStatus {0}
 

Detailed Description

Contains data of the Midi event.

Contains the data of the Midi event and provides the methods to retrieve it

Constructor & Destructor Documentation

◆ MidiEvent()

MidiEvent::MidiEvent ( const char *  filePath,
long  addr 
)

Reads the Midi file and constructs the event object

Parameters
filePathPath to the Midi file
addrAddress of the event in bytes

◆ ~MidiEvent()

MidiEvent::~MidiEvent ( )
overridedefault

Destroys the event object

Member Function Documentation

◆ clone()

MidiEvent * MidiEvent::clone ( ) const
overridevirtual

Clones the event object

Returns
Pointer to the cloned event

Implements Event.

◆ getChannel()

uint8_t MidiEvent::getChannel ( ) const

Returns the channel of the message

Returns
Channel number

◆ getData()

uint16_t MidiEvent::getData ( ) const

Returns event data

Returns
Data of the event

◆ getNote()

uint8_t MidiEvent::getNote ( ) const

Returns note number for Note on/off events

Returns
Number of the note for note events, otherwise 0

◆ getStatus()

MidiType::MidiMessageStatus MidiEvent::getStatus ( ) const

Returns the event status

Returns
The status of the event

◆ getType()

MidiType::EventType MidiEvent::getType ( ) const
overridevirtual

Returns the type of the event

Returns
Event type. Always equals to MidiType::EventType::MidiEvent

Implements Event.

◆ getVelocity()

uint8_t MidiEvent::getVelocity ( ) const

Returns note velocity for Note on/off events

Returns
Velocity of the note for note events, otherwise 0. Velocity of 0 means Note off

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