30#ifndef _NICMIDI_MATRIX_H
31#define _NICMIDI_MATRIX_H
62 int GetNoteCount(
int chan,
int note)
const {
return note_on_count[chan * 128 + note]; }
69 {
return channel_count[chan] ? min_note[chan] : -1; }
73 {
return channel_count[chan] ? max_note[chan] : -1; }
82 virtual void IncNoteCount (
unsigned char chan,
unsigned char note);
91 void SetNoteCount(
unsigned char chan,
unsigned char note,
unsigned char val)
92 { note_on_count[chan * 128 + note] = val; }
98 unsigned char note_on_count[2048];
99 unsigned char min_note[16];
100 unsigned char max_note[16];
101 int16_t channel_count[16];
This MIDIProcessor subclass implements a matrix which keeps track of notes on and hold pedal for ever...
Definition: matrix.h:43
virtual void DecNoteCount(unsigned char chan, unsigned char note)
Decrements the note count for the given channel and note.
void SetChannelCount(unsigned char chan, int val)
Sets the channel note count.
Definition: matrix.h:95
void SetNoteCount(unsigned char chan, unsigned char note, unsigned char val)
Sets the note count.
Definition: matrix.h:91
virtual bool Process(MIDITimedMessage *msg)
Processes the given MIDI message updating the matrix.
int GetChannelCount(int chan) const
Returns the number of notes on for given channel.
Definition: matrix.h:59
int GetMaxNoteOn(int chan) const
Returns the maximum note on MIDI value sounding for the given channel (-1 if no note on).
Definition: matrix.h:72
bool GetHoldPedal(int chan) const
Returns true if pedal is holding on given channel.
Definition: matrix.h:65
virtual void ClearChannel(unsigned char chan)
Clear the note count and the pedal on the given channel.
MIDIMatrix()
The constructor creates an empty matrix.
virtual void OtherMessage(const MIDIMessage *msg)
Called by Process() for non note and non pedal messages.
Definition: matrix.h:88
int GetMinNoteOn(int chan) const
Returns the minimum note on MIDI value sounding for the given channel (-1 if no note on).
Definition: matrix.h:68
virtual ~MIDIMatrix()
The destructor.
Definition: matrix.h:48
int GetNoteCount(int chan, int note) const
Returns the number of sounding notes given the channel and the note MIDI value.
Definition: matrix.h:62
virtual void IncNoteCount(unsigned char chan, unsigned char note)
Increments the note count for the given channel and note.
int GetTotalCount() const
Returns the total number of notes on.
Definition: matrix.h:56
virtual void Reset()
Resets the matrix (no notes on, no pedal hold)
Stores data representing a MIDI event message.
Definition: msg.h:49
A pure virtual class implementing an object that can manipulate a MIDI message, inspecting or changin...
Definition: processor.h:47
The MIDITimedMessage class inherits from the MIDIMessage and represents a message associated with a s...
Definition: msg.h:382
Contains the definition of the classes MIDIMessage and MIDITimedMessage.
Contains the definition of the pure virtual MIDIProcessor class and its specializations MIDIMultiProc...