NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
MIDIMatrix Class Reference

This MIDIProcessor subclass implements a matrix which keeps track of notes on and hold pedal for every channel. More...

#include <matrix.h>

Inheritance diagram for MIDIMatrix:
MIDIProcessor

Public Member Functions

 MIDIMatrix ()
 The constructor creates an empty matrix. More...
 
virtual ~MIDIMatrix ()
 The destructor. More...
 
virtual void Reset ()
 Resets the matrix (no notes on, no pedal hold) More...
 
virtual bool Process (MIDITimedMessage *msg)
 Processes the given MIDI message updating the matrix. More...
 
int GetTotalCount () const
 Returns the total number of notes on. More...
 
int GetChannelCount (int chan) const
 Returns the number of notes on for given channel. More...
 
int GetNoteCount (int chan, int note) const
 Returns the number of sounding notes given the channel and the note MIDI value. More...
 
bool GetHoldPedal (int chan) const
 Returns true if pedal is holding on given channel. More...
 
int GetMinNoteOn (int chan) const
 Returns the minimum note on MIDI value sounding for the given channel (-1 if no note on). More...
 
int GetMaxNoteOn (int chan) const
 Returns the maximum note on MIDI value sounding for the given channel (-1 if no note on). More...
 
- Public Member Functions inherited from MIDIProcessor
 MIDIProcessor ()
 The constructor. More...
 
virtual ~MIDIProcessor ()
 The destructor. More...
 

Protected Member Functions

virtual void DecNoteCount (unsigned char chan, unsigned char note)
 Decrements the note count for the given channel and note. More...
 
virtual void IncNoteCount (unsigned char chan, unsigned char note)
 Increments the note count for the given channel and note. More...
 
virtual void ClearChannel (unsigned char chan)
 Clear the note count and the pedal on the given channel. More...
 
virtual void OtherMessage (const MIDIMessage *msg)
 Called by Process() for non note and non pedal messages. More...
 
void SetNoteCount (unsigned char chan, unsigned char note, unsigned char val)
 Sets the note count. More...
 
void SetChannelCount (unsigned char chan, int val)
 Sets the channel note count. More...
 

Detailed Description

This MIDIProcessor subclass implements a matrix which keeps track of notes on and hold pedal for every channel.

Every time you call Process() giving it a MIDITimedMessage it updates the count of notes on and pedal (it does nothing if the message is not a note or pedal message). It is used by MIDIDriver and MIDISequencerTrackState.

Constructor & Destructor Documentation

◆ MIDIMatrix()

MIDIMatrix::MIDIMatrix ( )

The constructor creates an empty matrix.

◆ ~MIDIMatrix()

virtual MIDIMatrix::~MIDIMatrix ( )
inlinevirtual

The destructor.

Member Function Documentation

◆ Reset()

virtual void MIDIMatrix::Reset ( )
virtual

Resets the matrix (no notes on, no pedal hold)

Implements MIDIProcessor.

◆ Process()

virtual bool MIDIMatrix::Process ( MIDITimedMessage msg)
virtual

Processes the given MIDI message updating the matrix.

Returns true if the message has changed some matrix parameter, false otherwise

Implements MIDIProcessor.

◆ GetTotalCount()

int MIDIMatrix::GetTotalCount ( ) const
inline

Returns the total number of notes on.

◆ GetChannelCount()

int MIDIMatrix::GetChannelCount ( int  chan) const
inline

Returns the number of notes on for given channel.

See Numbering conventions.

◆ GetNoteCount()

int MIDIMatrix::GetNoteCount ( int  chan,
int  note 
) const
inline

Returns the number of sounding notes given the channel and the note MIDI value.

See Numbering conventions.

◆ GetHoldPedal()

bool MIDIMatrix::GetHoldPedal ( int  chan) const
inline

Returns true if pedal is holding on given channel.

See Numbering conventions.

◆ GetMinNoteOn()

int MIDIMatrix::GetMinNoteOn ( int  chan) const
inline

Returns the minimum note on MIDI value sounding for the given channel (-1 if no note on).

See Numbering conventions.

◆ GetMaxNoteOn()

int MIDIMatrix::GetMaxNoteOn ( int  chan) const
inline

Returns the maximum note on MIDI value sounding for the given channel (-1 if no note on).

See Numbering conventions.

◆ DecNoteCount()

virtual void MIDIMatrix::DecNoteCount ( unsigned char  chan,
unsigned char  note 
)
protectedvirtual

Decrements the note count for the given channel and note.

See Numbering conventions.

◆ IncNoteCount()

virtual void MIDIMatrix::IncNoteCount ( unsigned char  chan,
unsigned char  note 
)
protectedvirtual

Increments the note count for the given channel and note.

See Numbering conventions.

◆ ClearChannel()

virtual void MIDIMatrix::ClearChannel ( unsigned char  chan)
protectedvirtual

Clear the note count and the pedal on the given channel.

See Numbering conventions.

◆ OtherMessage()

virtual void MIDIMatrix::OtherMessage ( const MIDIMessage msg)
inlineprotectedvirtual

Called by Process() for non note and non pedal messages.

You can redefine it if you want your own processing (currently does nothing)

◆ SetNoteCount()

void MIDIMatrix::SetNoteCount ( unsigned char  chan,
unsigned char  note,
unsigned char  val 
)
inlineprotected

Sets the note count.

See Numbering conventions.

◆ SetChannelCount()

void MIDIMatrix::SetChannelCount ( unsigned char  chan,
int  val 
)
inlineprotected

Sets the channel note count.

See Numbering conventions.


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