template<class Transport, class _Settings = DefaultSettings, class _Platform = DefaultPlatform>
class MidiInterface< Transport, _Settings, _Platform >
The main class for MIDI handling. It is templated over the type of serial port to provide abstraction from the hardware interface, meaning you can use HardwareSerial, SoftwareSerial or ak47's Uart classes. The only requirement is that the class implements the begin, read, write and available methods.
Definition at line 54 of file MIDI.h.
|
| MidiInterface (Transport &) |
| Constructor for MidiInterface.
|
|
| ~MidiInterface () |
| Destructor for MidiInterface.
|
|
void | begin (Channel inChannel=1) |
| Call the begin method in the setup() function of the Arduino.
|
|
void | sendNoteOn (DataByte inNoteNumber, DataByte inVelocity, Channel inChannel) |
| Send a Note On message.
|
|
void | sendNoteOff (DataByte inNoteNumber, DataByte inVelocity, Channel inChannel) |
| Send a Note Off message.
|
|
void | sendProgramChange (DataByte inProgramNumber, Channel inChannel) |
| Send a Program Change message.
|
|
void | sendControlChange (DataByte inControlNumber, DataByte inControlValue, Channel inChannel) |
| Send a Control Change message.
|
|
void | sendPitchBend (int inPitchValue, Channel inChannel) |
| Send a Pitch Bend message using a signed integer value.
|
|
void | sendPitchBend (double inPitchValue, Channel inChannel) |
| Send a Pitch Bend message using a floating point value.
|
|
void | sendPolyPressure (DataByte inNoteNumber, DataByte inPressure, Channel inChannel) |
| Send a Polyphonic AfterTouch message (applies to a specified note)
|
|
void | sendAfterTouch (DataByte inPressure, Channel inChannel) |
| Send a MonoPhonic AfterTouch message (applies to all notes)
|
|
void | sendAfterTouch (DataByte inNoteNumber, DataByte inPressure, Channel inChannel) |
| Send a Polyphonic AfterTouch message (applies to a specified note)
|
|
void | sendSysEx (unsigned inLength, const byte *inArray, bool inArrayContainsBoundaries=false) |
| Generate and send a System Exclusive frame.
|
|
void | sendTimeCodeQuarterFrame (DataByte inTypeNibble, DataByte inValuesNibble) |
| Send a MIDI Time Code Quarter Frame.
|
|
void | sendTimeCodeQuarterFrame (DataByte inData) |
| Send a MIDI Time Code Quarter Frame.
|
|
void | sendSongPosition (unsigned inBeats) |
| Send a Song Position Pointer message.
|
|
void | sendSongSelect (DataByte inSongNumber) |
| Send a Song Select message.
|
|
void | sendTuneRequest () |
| Send a Tune Request message.
|
|
void | sendCommon (MidiType inType, unsigned=0) |
| Send a Common message. Common messages reset the running status.
|
|
void | sendClock () |
|
void | sendStart () |
|
void | sendStop () |
|
void | sendTick () |
|
void | sendContinue () |
|
void | sendActiveSensing () |
|
void | sendSystemReset () |
|
void | sendRealTime (MidiType inType) |
| Send a Real Time (one byte) message.
|
|
void | beginRpn (unsigned inNumber, Channel inChannel) |
| Start a Registered Parameter Number frame.
|
|
void | sendRpnValue (unsigned inValue, Channel inChannel) |
| Send a 14-bit value for the currently selected RPN number.
|
|
void | sendRpnValue (byte inMsb, byte inLsb, Channel inChannel) |
| Send separate MSB/LSB values for the currently selected RPN number.
|
|
void | sendRpnIncrement (byte inAmount, Channel inChannel) |
|
void | sendRpnDecrement (byte inAmount, Channel inChannel) |
|
void | endRpn (Channel inChannel) |
| Terminate an RPN frame. This will send a Null Function to deselect the currently selected RPN.
|
|
void | beginNrpn (unsigned inNumber, Channel inChannel) |
| Start a Non-Registered Parameter Number frame.
|
|
void | sendNrpnValue (unsigned inValue, Channel inChannel) |
| Send a 14-bit value for the currently selected NRPN number.
|
|
void | sendNrpnValue (byte inMsb, byte inLsb, Channel inChannel) |
| Send separate MSB/LSB values for the currently selected NRPN number.
|
|
void | sendNrpnIncrement (byte inAmount, Channel inChannel) |
|
void | sendNrpnDecrement (byte inAmount, Channel inChannel) |
|
void | endNrpn (Channel inChannel) |
| Terminate an NRPN frame. This will send a Null Function to deselect the currently selected NRPN.
|
|
void | send (const MidiMessage &) |
| Send a MIDI message.
|
|
void | send (MidiType inType, DataByte inData1, DataByte inData2, Channel inChannel) |
| Generate and send a MIDI message from the values given.
|
|
bool | read () |
| Read messages from the serial port using the main input channel.
|
|
bool | read (Channel inChannel) |
| Read messages on a specified channel.
|
|
MidiType | getType () const |
| Get the last received message's type.
|
|
Channel | getChannel () const |
| Get the channel of the message stored in the structure.
|
|
DataByte | getData1 () const |
| Get the first data byte of the last received message.
|
|
DataByte | getData2 () const |
| Get the second data byte of the last received message.
|
|
const byte * | getSysExArray () const |
| Get the System Exclusive byte array.
|
|
unsigned | getSysExArrayLength () const |
| Get the length of the System Exclusive array.
|
|
bool | check () const |
| Check if a valid message is stored in the structure.
|
|
Channel | getInputChannel () const |
|
void | setInputChannel (Channel inChannel) |
| Set the value for the input MIDI channel.
|
|
void | setHandleMessage (void(*fptr)(const MidiMessage &)) |
|
void | setHandleError (ErrorCallback fptr) |
|
void | setHandleNoteOff (NoteOffCallback fptr) |
|
void | setHandleNoteOn (NoteOnCallback fptr) |
|
void | setHandleAfterTouchPoly (AfterTouchPolyCallback fptr) |
|
void | setHandleControlChange (ControlChangeCallback fptr) |
|
void | setHandleProgramChange (ProgramChangeCallback fptr) |
|
void | setHandleAfterTouchChannel (AfterTouchChannelCallback fptr) |
|
void | setHandlePitchBend (PitchBendCallback fptr) |
|
void | setHandleSystemExclusive (SystemExclusiveCallback fptr) |
|
void | setHandleTimeCodeQuarterFrame (TimeCodeQuarterFrameCallback fptr) |
|
void | setHandleSongPosition (SongPositionCallback fptr) |
|
void | setHandleSongSelect (SongSelectCallback fptr) |
|
void | setHandleTuneRequest (TuneRequestCallback fptr) |
|
void | setHandleClock (ClockCallback fptr) |
|
void | setHandleStart (StartCallback fptr) |
|
void | setHandleTick (TickCallback fptr) |
|
void | setHandleContinue (ContinueCallback fptr) |
|
void | setHandleStop (StopCallback fptr) |
|
void | setHandleActiveSensing (ActiveSensingCallback fptr) |
|
void | setHandleSystemReset (SystemResetCallback fptr) |
|
void | disconnectCallbackFromType (MidiType inType) |
| Detach an external function from the given type.
|
|
Thru::Mode | getFilterMode () const |
|
bool | getThruState () const |
|
void | turnThruOn (Thru::Mode inThruFilterMode=Thru::Full) |
|
void | turnThruOff () |
|
void | setThruFilterMode (Thru::Mode inThruFilterMode) |
| Set the filter for thru mirroring.
|
|
Transport * | getTransport () |
|