Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Adapter class for reading an externally connected MIDI keyboard. More...
#include <midiadapter.h>
Classes | |
struct | Data |
Structure of the data associated with a MIDI event. More... | |
Public Types | |
enum | MidiEvent { MIDI_UNDEFINED = 0, MIDI_KEY_PRESS, MIDI_KEY_RELEASE, MIDI_CONTROL_CHANGE } |
Enumeration of the possible MIDI events. More... | |
Public Member Functions | |
MidiAdapter () | |
Constructor without function. More... | |
~MidiAdapter () | |
Destructor without function. More... | |
virtual void | init ()=0 |
Initialisation of the implementation. More... | |
virtual void | exit ()=0 |
Shut down the implementation. More... | |
virtual int | GetNumberOfPorts ()=0 |
Get the number of available input devices. More... | |
virtual std::string | GetPortName (int i)=0 |
Get the name of device number i (starting with zero) More... | |
virtual std::string | GetPortNames () |
Get a list of all available input devices. More... | |
virtual bool | OpenPort (int i, std::string AppName="")=0 |
Open Midi input device number i. More... | |
virtual bool | OpenPort (std::string AppName="")=0 |
Open Midi device with the highest port number. More... | |
virtual int | getCurrentPort () const =0 |
Get the current port number. More... | |
void | send (Data &data) |
Send new MIDI data to the messaging system. More... | |
Static Public Member Functions | |
static MidiEvent | byteToEvent (int byte) |
Convert MIDI code to MidiEvent. More... | |
Adapter class for reading an externally connected MIDI keyboard.
This abstract class defines the interface between the EPT and an external MIDI keyboard. It has to be inherited in a specific platform-dependent implementation.
A midi command consists of three bytes, as explained e.g. in https://www.nyu.edu/classes/bello/FMT_files/9_MIDI_code.pdf . In addition, the callback function provides a parameter called 'deltatime', which is basically the time in seconds elapsed since the last event.
Definition at line 43 of file midiadapter.h.
Enumeration of the possible MIDI events.
Midi events processed by the EPT, representing the MIDI operation code in a simplified manner.
Enumerator | |
---|---|
MIDI_UNDEFINED |
Midi event undefined. |
MIDI_KEY_PRESS |
Midi event when a key is pressed. |
MIDI_KEY_RELEASE |
Midi event when a key is released. |
MIDI_CONTROL_CHANGE |
Midi event for changing voice. |
Definition at line 68 of file midiadapter.h.
|
inline |
Constructor without function.
Definition at line 47 of file midiadapter.h.
|
inline |
Destructor without function.
Definition at line 48 of file midiadapter.h.
|
static |
Convert MIDI code to MidiEvent.
Definition at line 63 of file midiadapter.cpp.
|
pure virtual |
Shut down the implementation.
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
pure virtual |
Get the current port number.
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
pure virtual |
Get the number of available input devices.
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
pure virtual |
Get the name of device number i (starting with zero)
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
virtual |
Get a list of all available input devices.
Reimplemented in RtMidiImplementation.
Definition at line 41 of file midiadapter.cpp.
|
pure virtual |
Initialisation of the implementation.
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
pure virtual |
Open Midi input device number i.
Implemented in RtMidiImplementation, and NoMidiImplementation.
|
pure virtual |
Open Midi device with the highest port number.
Implemented in RtMidiImplementation, and NoMidiImplementation.
void MidiAdapter::send | ( | Data & | data | ) |
Send new MIDI data to the messaging system.
This function sends a new data set received from the MIDI implementation as a message to the message handler.
Definition at line 84 of file midiadapter.cpp.