Ardour  8.7-15-gadf511264b
MIDI::Channel Class Reference

#include <channel.h>

Inheritance diagram for MIDI::Channel:
[legend]

Public Member Functions

 Channel (byte channel_number, Port &)
 
Portmidi_port ()
 
byte channel ()
 
byte program ()
 
unsigned short bank ()
 
byte pressure ()
 
byte poly_pressure (byte n)
 
byte last_note_on ()
 
byte last_on_velocity ()
 
byte last_note_off ()
 
byte last_off_velocity ()
 
pitchbend_t pitchbend ()
 
controller_value_t controller_value (byte n)
 
controller_value_tcontroller_addr (byte n)
 
void set_controller (byte n, byte val)
 
controller_value_t rpn_value (uint16_t rpn_id)
 
controller_value_t nrpn_value (uint16_t rpn_id)
 
bool channel_msg (byte id, byte val1, byte val2, timestamp_t timestamp)
 
bool all_notes_off (timestamp_t timestamp)
 
bool control (byte id, byte value, timestamp_t timestamp)
 
bool note_on (byte note, byte velocity, timestamp_t timestamp)
 
bool note_off (byte note, byte velocity, timestamp_t timestamp)
 
bool aftertouch (byte value, timestamp_t timestamp)
 
bool poly_aftertouch (byte note, byte value, timestamp_t timestamp)
 
bool program_change (byte value, timestamp_t timestamp)
 
bool pitchbend (byte msb, byte lsb, timestamp_t timestamp)
 
float rpn_value (uint16_t rpn) const
 
float nrpn_value (uint16_t nrpn) const
 
float rpn_value_absolute (uint16_t rpn) const
 
float nrpn_value_absolute (uint16_t nrpn) const
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 

Protected Member Functions

void connect_signals ()
 

Private Types

enum  RPNState { HaveLSB = 0x1 , HaveMSB = 0x2 , HaveValue = 0x4 }
 
typedef std::map< uint16_t, float > RPNList
 

Private Member Functions

void reset (timestamp_t timestamp, samplecnt_t nframes, bool notes_off=true)
 
void process_note_off (Parser &, EventTwoBytes *)
 
void process_note_on (Parser &, EventTwoBytes *)
 
void process_controller (Parser &, EventTwoBytes *)
 
void process_polypress (Parser &, EventTwoBytes *)
 
void process_program_change (Parser &, byte)
 
void process_chanpress (Parser &, byte)
 
void process_pitchbend (Parser &, pitchbend_t)
 
void process_reset (Parser &)
 
bool maybe_process_rpns (Parser &, EventTwoBytes *)
 
void rpn_reset ()
 
void nrpn_reset ()
 

Private Attributes

Port_port
 
byte _channel_number
 
unsigned short _bank_number
 
byte _program_number
 
byte _rpn_msb
 
byte _rpn_lsb
 
byte _rpn_val_msb
 
byte _rpn_val_lsb
 
byte _nrpn_msb
 
byte _nrpn_lsb
 
byte _nrpn_val_lsb
 
byte _nrpn_val_msb
 
RPNState _rpn_state
 
RPNState _nrpn_state
 
byte _chanpress
 
byte _polypress [128]
 
bool _controller_14bit [128]
 
controller_value_t _controller_val [128]
 
byte _controller_msb [128]
 
byte _controller_lsb [128]
 
byte _last_note_on
 
byte _last_on_velocity
 
byte _last_note_off
 
byte _last_off_velocity
 
pitchbend_t _pitch_bend
 
bool _omni
 
bool _poly
 
bool _mono
 
size_t _notes_on
 
RPNList rpns
 
RPNList nrpns
 

Static Private Attributes

static const RPNState RPN_READY_FOR_VALUE
 
static const RPNState RPN_VALUE_READY
 

Friends

class Port
 

Detailed Description

Stateful MIDI channel class.

This remembers various useful information about the current 'state' of a MIDI channel (eg current pitch bend value).

Definition at line 39 of file channel.h.

Member Typedef Documentation

◆ RPNList

typedef std::map<uint16_t,float> MIDI::Channel::RPNList
private

Definition at line 164 of file channel.h.

Member Enumeration Documentation

◆ RPNState

Enumerator
HaveLSB 
HaveMSB 
HaveValue 

Definition at line 128 of file channel.h.

Constructor & Destructor Documentation

◆ Channel()

MIDI::Channel::Channel ( byte  channel_number,
Port  
)

Member Function Documentation

◆ aftertouch()

bool MIDI::Channel::aftertouch ( byte  value,
timestamp_t  timestamp 
)
inline

Definition at line 100 of file channel.h.

◆ all_notes_off()

bool MIDI::Channel::all_notes_off ( timestamp_t  timestamp)
inline

Definition at line 84 of file channel.h.

◆ bank()

unsigned short MIDI::Channel::bank ( )
inline

Definition at line 47 of file channel.h.

◆ channel()

byte MIDI::Channel::channel ( )
inline

Definition at line 45 of file channel.h.

◆ channel_msg()

bool MIDI::Channel::channel_msg ( byte  id,
byte  val1,
byte  val2,
timestamp_t  timestamp 
)

◆ connect_signals()

void MIDI::Channel::connect_signals ( )
protected

◆ control()

bool MIDI::Channel::control ( byte  id,
byte  value,
timestamp_t  timestamp 
)
inline

Definition at line 88 of file channel.h.

◆ controller_addr()

controller_value_t* MIDI::Channel::controller_addr ( byte  n)
inline

Definition at line 72 of file channel.h.

◆ controller_value()

controller_value_t MIDI::Channel::controller_value ( byte  n)
inline

Definition at line 68 of file channel.h.

◆ last_note_off()

byte MIDI::Channel::last_note_off ( )
inline

Definition at line 57 of file channel.h.

◆ last_note_on()

byte MIDI::Channel::last_note_on ( )
inline

Definition at line 51 of file channel.h.

◆ last_off_velocity()

byte MIDI::Channel::last_off_velocity ( )
inline

Definition at line 60 of file channel.h.

◆ last_on_velocity()

byte MIDI::Channel::last_on_velocity ( )
inline

Definition at line 54 of file channel.h.

◆ maybe_process_rpns()

bool MIDI::Channel::maybe_process_rpns ( Parser ,
EventTwoBytes  
)
private

◆ midi_port()

Port& MIDI::Channel::midi_port ( )
inline

Definition at line 44 of file channel.h.

◆ note_off()

bool MIDI::Channel::note_off ( byte  note,
byte  velocity,
timestamp_t  timestamp 
)
inline

Definition at line 96 of file channel.h.

◆ note_on()

bool MIDI::Channel::note_on ( byte  note,
byte  velocity,
timestamp_t  timestamp 
)
inline

Definition at line 92 of file channel.h.

◆ nrpn_reset()

void MIDI::Channel::nrpn_reset ( )
private

◆ nrpn_value() [1/2]

float MIDI::Channel::nrpn_value ( uint16_t  nrpn) const

◆ nrpn_value() [2/2]

controller_value_t MIDI::Channel::nrpn_value ( uint16_t  rpn_id)

◆ nrpn_value_absolute()

float MIDI::Channel::nrpn_value_absolute ( uint16_t  nrpn) const

◆ pitchbend() [1/2]

pitchbend_t MIDI::Channel::pitchbend ( )
inline

Definition at line 64 of file channel.h.

◆ pitchbend() [2/2]

bool MIDI::Channel::pitchbend ( byte  msb,
byte  lsb,
timestamp_t  timestamp 
)
inline

Definition at line 112 of file channel.h.

◆ poly_aftertouch()

bool MIDI::Channel::poly_aftertouch ( byte  note,
byte  value,
timestamp_t  timestamp 
)
inline

Definition at line 104 of file channel.h.

◆ poly_pressure()

byte MIDI::Channel::poly_pressure ( byte  n)
inline

Definition at line 49 of file channel.h.

◆ pressure()

byte MIDI::Channel::pressure ( )
inline

Definition at line 48 of file channel.h.

◆ process_chanpress()

void MIDI::Channel::process_chanpress ( Parser ,
byte   
)
private

◆ process_controller()

void MIDI::Channel::process_controller ( Parser ,
EventTwoBytes  
)
private

◆ process_note_off()

void MIDI::Channel::process_note_off ( Parser ,
EventTwoBytes  
)
private

◆ process_note_on()

void MIDI::Channel::process_note_on ( Parser ,
EventTwoBytes  
)
private

◆ process_pitchbend()

void MIDI::Channel::process_pitchbend ( Parser ,
pitchbend_t   
)
private

◆ process_polypress()

void MIDI::Channel::process_polypress ( Parser ,
EventTwoBytes  
)
private

◆ process_program_change()

void MIDI::Channel::process_program_change ( Parser ,
byte   
)
private

◆ process_reset()

void MIDI::Channel::process_reset ( Parser )
private

◆ program()

byte MIDI::Channel::program ( )
inline

Definition at line 46 of file channel.h.

◆ program_change()

bool MIDI::Channel::program_change ( byte  value,
timestamp_t  timestamp 
)
inline

Definition at line 108 of file channel.h.

◆ reset()

void MIDI::Channel::reset ( timestamp_t  timestamp,
samplecnt_t  nframes,
bool  notes_off = true 
)
private

◆ rpn_reset()

void MIDI::Channel::rpn_reset ( )
private

◆ rpn_value() [1/2]

float MIDI::Channel::rpn_value ( uint16_t  rpn) const

◆ rpn_value() [2/2]

controller_value_t MIDI::Channel::rpn_value ( uint16_t  rpn_id)

◆ rpn_value_absolute()

float MIDI::Channel::rpn_value_absolute ( uint16_t  rpn) const

◆ set_controller()

void MIDI::Channel::set_controller ( byte  n,
byte  val 
)
inline

Definition at line 76 of file channel.h.

Friends And Related Function Documentation

◆ Port

friend class Port
friend

Definition at line 122 of file channel.h.

Member Data Documentation

◆ _bank_number

unsigned short MIDI::Channel::_bank_number
private

Definition at line 136 of file channel.h.

◆ _channel_number

byte MIDI::Channel::_channel_number
private

Definition at line 135 of file channel.h.

◆ _chanpress

byte MIDI::Channel::_chanpress
private

Definition at line 148 of file channel.h.

◆ _controller_14bit

bool MIDI::Channel::_controller_14bit[128]
private

Definition at line 150 of file channel.h.

◆ _controller_lsb

byte MIDI::Channel::_controller_lsb[128]
private

Definition at line 153 of file channel.h.

◆ _controller_msb

byte MIDI::Channel::_controller_msb[128]
private

Definition at line 152 of file channel.h.

◆ _controller_val

controller_value_t MIDI::Channel::_controller_val[128]
private

Definition at line 151 of file channel.h.

◆ _last_note_off

byte MIDI::Channel::_last_note_off
private

Definition at line 156 of file channel.h.

◆ _last_note_on

byte MIDI::Channel::_last_note_on
private

Definition at line 154 of file channel.h.

◆ _last_off_velocity

byte MIDI::Channel::_last_off_velocity
private

Definition at line 157 of file channel.h.

◆ _last_on_velocity

byte MIDI::Channel::_last_on_velocity
private

Definition at line 155 of file channel.h.

◆ _mono

bool MIDI::Channel::_mono
private

Definition at line 161 of file channel.h.

◆ _notes_on

size_t MIDI::Channel::_notes_on
private

Definition at line 162 of file channel.h.

◆ _nrpn_lsb

byte MIDI::Channel::_nrpn_lsb
private

Definition at line 143 of file channel.h.

◆ _nrpn_msb

byte MIDI::Channel::_nrpn_msb
private

Definition at line 142 of file channel.h.

◆ _nrpn_state

RPNState MIDI::Channel::_nrpn_state
private

Definition at line 147 of file channel.h.

◆ _nrpn_val_lsb

byte MIDI::Channel::_nrpn_val_lsb
private

Definition at line 144 of file channel.h.

◆ _nrpn_val_msb

byte MIDI::Channel::_nrpn_val_msb
private

Definition at line 145 of file channel.h.

◆ _omni

bool MIDI::Channel::_omni
private

Definition at line 159 of file channel.h.

◆ _pitch_bend

pitchbend_t MIDI::Channel::_pitch_bend
private

Definition at line 158 of file channel.h.

◆ _poly

bool MIDI::Channel::_poly
private

Definition at line 160 of file channel.h.

◆ _polypress

byte MIDI::Channel::_polypress[128]
private

Definition at line 149 of file channel.h.

◆ _port

Port& MIDI::Channel::_port
private

Definition at line 126 of file channel.h.

◆ _program_number

byte MIDI::Channel::_program_number
private

Definition at line 137 of file channel.h.

◆ _rpn_lsb

byte MIDI::Channel::_rpn_lsb
private

Definition at line 139 of file channel.h.

◆ _rpn_msb

byte MIDI::Channel::_rpn_msb
private

Definition at line 138 of file channel.h.

◆ _rpn_state

RPNState MIDI::Channel::_rpn_state
private

Definition at line 146 of file channel.h.

◆ _rpn_val_lsb

byte MIDI::Channel::_rpn_val_lsb
private

Definition at line 141 of file channel.h.

◆ _rpn_val_msb

byte MIDI::Channel::_rpn_val_msb
private

Definition at line 140 of file channel.h.

◆ nrpns

RPNList MIDI::Channel::nrpns
private

Definition at line 167 of file channel.h.

◆ RPN_READY_FOR_VALUE

const RPNState MIDI::Channel::RPN_READY_FOR_VALUE
staticprivate

Definition at line 184 of file channel.h.

◆ RPN_VALUE_READY

const RPNState MIDI::Channel::RPN_VALUE_READY
staticprivate

Definition at line 185 of file channel.h.

◆ rpns

RPNList MIDI::Channel::rpns
private

Definition at line 166 of file channel.h.


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