19 #ifndef EVORAL_MIDI_EVENT_HPP
20 #define EVORAL_MIDI_EVENT_HPP
23 #include <boost/shared_ptr.hpp>
29 #ifdef EVORAL_MIDI_XML
41 template<
typename Time>
49 :
Event<Time>(copy, alloc)
52 #ifdef EVORAL_MIDI_XML
60 inline uint8_t
type()
const {
return (this->
_buf[0] & 0xF0); }
64 inline uint8_t
channel()
const {
return (this->
_buf[0] & 0x0F); }
76 inline uint8_t
note()
const {
return (this->
_buf[1]); }
81 if (factor < 0) factor = 0;
82 this->
_buf[2] = (uint8_t) lrintf (this->
_buf[2]*factor);
83 if (this->
_buf[2] > 127) this->
_buf[2] = 127;
92 | (0x7F & this->_buf[1]) ); }
100 || this->
_buf[0] == 0xF7; }
101 inline bool is_spp()
const {
return this->
_buf[0] == 0xF2 && this->
size() == 1; }
104 return this->
size() == 10 && this->
_buf[0] == 0xf0 && this->
_buf[1] == 0x7f &&
105 this->
_buf[3] == 0x01 && this->
_buf[4] == 0x01;
126 #endif // EVORAL_MIDI_EVENT_HPP
bool is_pgm_change() const
#define MIDI_CMD_NOTE_OFF
uint8_t channel_pressure() const
void set_type(uint8_t type)
bool is_smf_meta_event() const
#define MIDI_CMD_CHANNEL_PRESSURE
uint8_t pitch_bender_lsb() const
bool is_channel_event() const
#define MIDI_CMD_PGM_CHANGE
bool is_pitch_bender() const
uint16_t pitch_bender_value() const
bool is_aftertouch() const
void set_channel(uint8_t channel)
MIDIEvent(const Event< Time > ©, bool alloc)
void set_pgm_number(uint8_t number)
bool is_channel_pressure() const
uint8_t pgm_number() const
bool is_mtc_quarter() const
void scale_velocity(float factor)
uint8_t cc_number() const
uint8_t pitch_bender_msb() const
#define MIDI_CMD_NOTE_PRESSURE
void set_cc_number(uint8_t number)
uint8_t aftertouch() const
void set_cc_value(uint8_t value)
MIDIEvent(EventType type=0, Time time=0, uint32_t size=0, uint8_t *buf=NULL, bool alloc=false)
void set_velocity(uint8_t value)