Arduino MIDI Library  Version 5.0.1
MIDI.h
Go to the documentation of this file.
1 
28 #pragma once
29 
30 #include "midi_Defs.h"
31 #include "midi_Platform.h"
32 #include "midi_Settings.h"
33 #include "midi_Message.h"
34 
35 #include "serialMIDI.h"
36 
37 // -----------------------------------------------------------------------------
38 
40 
41 #define MIDI_LIBRARY_VERSION 0x050000
42 #define MIDI_LIBRARY_VERSION_MAJOR 5
43 #define MIDI_LIBRARY_VERSION_MINOR 0
44 #define MIDI_LIBRARY_VERSION_PATCH 0
45 
52 template<class Transport, class _Settings = DefaultSettings, class _Platform = DefaultPlatform>
54 {
55 public:
56  typedef _Settings Settings;
57  typedef _Platform Platform;
59 
60 public:
61  inline MidiInterface(Transport&);
62  inline ~MidiInterface();
63 
64 public:
65  void begin(Channel inChannel = 1);
66 
67  // -------------------------------------------------------------------------
68  // MIDI Output
69 
70 public:
71  inline void sendNoteOn(DataByte inNoteNumber,
72  DataByte inVelocity,
73  Channel inChannel);
74 
75  inline void sendNoteOff(DataByte inNoteNumber,
76  DataByte inVelocity,
77  Channel inChannel);
78 
79  inline void sendProgramChange(DataByte inProgramNumber,
80  Channel inChannel);
81 
82  inline void sendControlChange(DataByte inControlNumber,
83  DataByte inControlValue,
84  Channel inChannel);
85 
86  inline void sendPitchBend(int inPitchValue, Channel inChannel);
87  inline void sendPitchBend(double inPitchValue, Channel inChannel);
88 
89  inline void sendPolyPressure(DataByte inNoteNumber,
90  DataByte inPressure,
91  Channel inChannel) __attribute__ ((deprecated));
92 
93  inline void sendAfterTouch(DataByte inPressure,
94  Channel inChannel);
95  inline void sendAfterTouch(DataByte inNoteNumber,
96  DataByte inPressure,
97  Channel inChannel);
98 
99  inline void sendSysEx(unsigned inLength,
100  const byte* inArray,
101  bool inArrayContainsBoundaries = false);
102 
103  inline void sendTimeCodeQuarterFrame(DataByte inTypeNibble,
104  DataByte inValuesNibble);
105  inline void sendTimeCodeQuarterFrame(DataByte inData);
106 
107  inline void sendSongPosition(unsigned inBeats);
108  inline void sendSongSelect(DataByte inSongNumber);
109  inline void sendTuneRequest();
110 
111  inline void sendCommon(MidiType inType, unsigned = 0);
112 
113  inline void sendClock() { sendRealTime(Clock); };
114  inline void sendStart() { sendRealTime(Start); };
115  inline void sendStop() { sendRealTime(Stop); };
116  inline void sendTick() { sendRealTime(Tick); };
117  inline void sendContinue() { sendRealTime(Continue); };
120 
121  inline void sendRealTime(MidiType inType);
122 
123  inline void beginRpn(unsigned inNumber,
124  Channel inChannel);
125  inline void sendRpnValue(unsigned inValue,
126  Channel inChannel);
127  inline void sendRpnValue(byte inMsb,
128  byte inLsb,
129  Channel inChannel);
130  inline void sendRpnIncrement(byte inAmount,
131  Channel inChannel);
132  inline void sendRpnDecrement(byte inAmount,
133  Channel inChannel);
134  inline void endRpn(Channel inChannel);
135 
136  inline void beginNrpn(unsigned inNumber,
137  Channel inChannel);
138  inline void sendNrpnValue(unsigned inValue,
139  Channel inChannel);
140  inline void sendNrpnValue(byte inMsb,
141  byte inLsb,
142  Channel inChannel);
143  inline void sendNrpnIncrement(byte inAmount,
144  Channel inChannel);
145  inline void sendNrpnDecrement(byte inAmount,
146  Channel inChannel);
147  inline void endNrpn(Channel inChannel);
148 
149  inline void send(const MidiMessage&);
150 
151 public:
152  void send(MidiType inType,
153  DataByte inData1,
154  DataByte inData2,
155  Channel inChannel);
156 
157  // -------------------------------------------------------------------------
158  // MIDI Input
159 
160 public:
161  inline bool read();
162  inline bool read(Channel inChannel);
163 
164 public:
165  inline MidiType getType() const;
166  inline Channel getChannel() const;
167  inline DataByte getData1() const;
168  inline DataByte getData2() const;
169  inline const byte* getSysExArray() const;
170  inline unsigned getSysExArrayLength() const;
171  inline bool check() const;
172 
173 public:
174  inline Channel getInputChannel() const;
175  inline void setInputChannel(Channel inChannel);
176 
177 public:
178  static inline MidiType getTypeFromStatusByte(byte inStatus);
179  static inline Channel getChannelFromStatusByte(byte inStatus);
180  static inline bool isChannelMessage(MidiType inType);
181 
182  // -------------------------------------------------------------------------
183  // Input Callbacks
184 
185 public:
186  inline void setHandleMessage(void (*fptr)(const MidiMessage&)) { mMessageCallback = fptr; };
187  inline void setHandleError(ErrorCallback fptr) { mErrorCallback = fptr; }
188  inline void setHandleNoteOff(NoteOffCallback fptr) { mNoteOffCallback = fptr; }
189  inline void setHandleNoteOn(NoteOnCallback fptr) { mNoteOnCallback = fptr; }
190  inline void setHandleAfterTouchPoly(AfterTouchPolyCallback fptr) { mAfterTouchPolyCallback = fptr; }
191  inline void setHandleControlChange(ControlChangeCallback fptr) { mControlChangeCallback = fptr; }
192  inline void setHandleProgramChange(ProgramChangeCallback fptr) { mProgramChangeCallback = fptr; }
193  inline void setHandleAfterTouchChannel(AfterTouchChannelCallback fptr) { mAfterTouchChannelCallback = fptr; }
194  inline void setHandlePitchBend(PitchBendCallback fptr) { mPitchBendCallback = fptr; }
195  inline void setHandleSystemExclusive(SystemExclusiveCallback fptr) { mSystemExclusiveCallback = fptr; }
196  inline void setHandleTimeCodeQuarterFrame(TimeCodeQuarterFrameCallback fptr) { mTimeCodeQuarterFrameCallback = fptr; }
197  inline void setHandleSongPosition(SongPositionCallback fptr) { mSongPositionCallback = fptr; }
198  inline void setHandleSongSelect(SongSelectCallback fptr) { mSongSelectCallback = fptr; }
199  inline void setHandleTuneRequest(TuneRequestCallback fptr) { mTuneRequestCallback = fptr; }
200  inline void setHandleClock(ClockCallback fptr) { mClockCallback = fptr; }
201  inline void setHandleStart(StartCallback fptr) { mStartCallback = fptr; }
202  inline void setHandleTick(TickCallback fptr) { mTickCallback = fptr; }
203  inline void setHandleContinue(ContinueCallback fptr) { mContinueCallback = fptr; }
204  inline void setHandleStop(StopCallback fptr) { mStopCallback = fptr; }
205  inline void setHandleActiveSensing(ActiveSensingCallback fptr) { mActiveSensingCallback = fptr; }
206  inline void setHandleSystemReset(SystemResetCallback fptr) { mSystemResetCallback = fptr; }
207 
208  inline void disconnectCallbackFromType(MidiType inType);
209 
210 private:
211  void launchCallback();
212 
213  void (*mMessageCallback)(const MidiMessage& message) = nullptr;
214  ErrorCallback mErrorCallback = nullptr;
215  NoteOffCallback mNoteOffCallback = nullptr;
216  NoteOnCallback mNoteOnCallback = nullptr;
217  AfterTouchPolyCallback mAfterTouchPolyCallback = nullptr;
218  ControlChangeCallback mControlChangeCallback = nullptr;
219  ProgramChangeCallback mProgramChangeCallback = nullptr;
220  AfterTouchChannelCallback mAfterTouchChannelCallback = nullptr;
221  PitchBendCallback mPitchBendCallback = nullptr;
222  SystemExclusiveCallback mSystemExclusiveCallback = nullptr;
223  TimeCodeQuarterFrameCallback mTimeCodeQuarterFrameCallback = nullptr;
224  SongPositionCallback mSongPositionCallback = nullptr;
225  SongSelectCallback mSongSelectCallback = nullptr;
226  TuneRequestCallback mTuneRequestCallback = nullptr;
227  ClockCallback mClockCallback = nullptr;
228  StartCallback mStartCallback = nullptr;
229  TickCallback mTickCallback = nullptr;
230  ContinueCallback mContinueCallback = nullptr;
231  StopCallback mStopCallback = nullptr;
232  ActiveSensingCallback mActiveSensingCallback = nullptr;
233  SystemResetCallback mSystemResetCallback = nullptr;
234 
235  // -------------------------------------------------------------------------
236  // MIDI Soft Thru
237 
238 public:
239  inline Thru::Mode getFilterMode() const;
240  inline bool getThruState() const;
241 
242  inline void turnThruOn(Thru::Mode inThruFilterMode = Thru::Full);
243  inline void turnThruOff();
244  inline void setThruFilterMode(Thru::Mode inThruFilterMode);
245 
246 private:
247  void thruFilter(byte inChannel);
248 
249  // -------------------------------------------------------------------------
250  // MIDI Parsing
251 
252 private:
253  bool parse();
254  inline void handleNullVelocityNoteOnAsNoteOff();
255  inline bool inputFilter(Channel inChannel);
256  inline void resetInput();
257  inline void UpdateLastSentTime();
258 
259  // -------------------------------------------------------------------------
260  // Transport
261 
262 public:
263  Transport* getTransport() { return &mTransport; };
264 
265 private:
266  Transport& mTransport;
267 
268  // -------------------------------------------------------------------------
269  // Internal variables
270 
271 private:
272  Channel mInputChannel;
273  StatusByte mRunningStatus_RX;
274  StatusByte mRunningStatus_TX;
275  byte mPendingMessage[3];
276  unsigned mPendingMessageExpectedLength;
277  unsigned mPendingMessageIndex;
278  unsigned mCurrentRpnNumber;
279  unsigned mCurrentNrpnNumber;
280  bool mThruActivated : 1;
281  Thru::Mode mThruFilterMode : 7;
282  MidiMessage mMessage;
283  unsigned long mLastMessageSentTime;
284  unsigned long mLastMessageReceivedTime;
285  unsigned long mSenderActiveSensingPeriodicity;
286  bool mReceiverActiveSensingActivated;
287  int8_t mLastError;
288 
289 private:
290  inline StatusByte getStatus(MidiType inType,
291  Channel inChannel) const;
292 };
293 
294 // -----------------------------------------------------------------------------
295 
296 unsigned encodeSysEx(const byte* inData,
297  byte* outSysEx,
298  unsigned inLength,
299  bool inFlipHeaderBits = false);
300 unsigned decodeSysEx(const byte* inSysEx,
301  byte* outData,
302  unsigned inLength,
303  bool inFlipHeaderBits = false);
304 
306 
307 #include "MIDI.hpp"
MidiInterface::setInputChannel
void setInputChannel(Channel inChannel)
Set the value for the input MIDI channel.
Definition: MIDI.hpp:1205
MidiInterface::~MidiInterface
~MidiInterface()
Destructor for MidiInterface.
Definition: MIDI.hpp:59
MidiInterface::sendNrpnDecrement
void sendNrpnDecrement(byte inAmount, Channel inChannel)
Definition: MIDI.hpp:658
Clock
@ Clock
System Real Time - Timing Clock.
Definition: midi_Defs.h:113
SongSelectCallback
void(*)(byte songnumber) SongSelectCallback
Definition: midi_Defs.h:81
MidiInterface::setHandleNoteOn
void setHandleNoteOn(NoteOnCallback fptr)
Definition: MIDI.h:189
MidiInterface::turnThruOn
void turnThruOn(Thru::Mode inThruFilterMode=Thru::Full)
Definition: MIDI.hpp:1371
SystemReset
@ SystemReset
System Real Time - System Reset.
Definition: midi_Defs.h:121
MidiInterface::getData1
DataByte getData1() const
Get the first data byte of the last received message.
Definition: MIDI.hpp:1152
midi_Defs.h
MIDI Library for the Arduino - Definitions.
NoteOnCallback
void(*)(Channel channel, byte note, byte velocity) NoteOnCallback
Definition: midi_Defs.h:72
Thru::Mode
Mode
Definition: midi_Defs.h:130
MidiInterface::getData2
DataByte getData2() const
Get the second data byte of the last received message.
Definition: MIDI.hpp:1159
PitchBendCallback
void(*)(Channel channel, int) PitchBendCallback
Definition: midi_Defs.h:77
ProgramChangeCallback
void(*)(Channel channel, byte) ProgramChangeCallback
Definition: midi_Defs.h:75
MidiInterface::check
bool check() const
Check if a valid message is stored in the structure.
Definition: MIDI.hpp:1187
MidiInterface::sendRpnDecrement
void sendRpnDecrement(byte inAmount, Channel inChannel)
Definition: MIDI.hpp:578
StartCallback
void(*)(void) StartCallback
Definition: midi_Defs.h:84
MidiInterface::setHandleTimeCodeQuarterFrame
void setHandleTimeCodeQuarterFrame(TimeCodeQuarterFrameCallback fptr)
Definition: MIDI.h:196
MidiInterface::MidiInterface
MidiInterface(Transport &)
Constructor for MidiInterface.
Definition: MIDI.hpp:34
MidiInterface::setHandleStop
void setHandleStop(StopCallback fptr)
Definition: MIDI.h:204
MidiInterface::beginRpn
void beginRpn(unsigned inNumber, Channel inChannel)
Start a Registered Parameter Number frame.
Definition: MIDI.hpp:523
midi_Platform.h
MIDI Library for the Arduino - Platform @license MIT - Copyright (c) 2015 Francois Best.
MidiInterface::sendSongSelect
void sendSongSelect(DataByte inSongNumber)
Send a Song Select message.
Definition: MIDI.hpp:430
MidiInterface::setHandleSongSelect
void setHandleSongSelect(SongSelectCallback fptr)
Definition: MIDI.h:198
SongPositionCallback
void(*)(unsigned beats) SongPositionCallback
Definition: midi_Defs.h:80
decodeSysEx
unsigned decodeSysEx(const byte *inSysEx, byte *outData, unsigned inLength, bool inFlipHeaderBits=false)
Decode System Exclusive messages. SysEx messages are encoded to guarantee transmission of data bytes ...
Definition: MIDI.cpp:87
END_MIDI_NAMESPACE
#define END_MIDI_NAMESPACE
Definition: midi_Namespace.h:32
Start
@ Start
System Real Time - Start.
Definition: midi_Defs.h:116
AfterTouchPolyCallback
void(*)(Channel channel, byte note, byte velocity) AfterTouchPolyCallback
Definition: midi_Defs.h:73
MidiInterface::sendSongPosition
void sendSongPosition(unsigned inBeats)
Send a Song Position Pointer message.
Definition: MIDI.hpp:423
MidiInterface::sendControlChange
void sendControlChange(DataByte inControlNumber, DataByte inControlValue, Channel inChannel)
Send a Control Change message.
Definition: MIDI.hpp:270
MidiInterface::endNrpn
void endNrpn(Channel inChannel)
Terminate an NRPN frame. This will send a Null Function to deselect the currently selected NRPN.
Definition: MIDI.hpp:669
MidiInterface::sendCommon
void sendCommon(MidiType inType, unsigned=0)
Send a Common message. Common messages reset the running status.
Definition: MIDI.hpp:443
MidiInterface::setHandleTuneRequest
void setHandleTuneRequest(TuneRequestCallback fptr)
Definition: MIDI.h:199
MidiInterface::sendNoteOn
void sendNoteOn(DataByte inNoteNumber, DataByte inVelocity, Channel inChannel)
Send a Note On message.
Definition: MIDI.hpp:226
MidiInterface::sendNrpnValue
void sendNrpnValue(unsigned inValue, Channel inChannel)
Send a 14-bit value for the currently selected NRPN number.
Definition: MIDI.hpp:621
MidiInterface::getFilterMode
Thru::Mode getFilterMode() const
Definition: MIDI.hpp:1359
MidiInterface::setHandleActiveSensing
void setHandleActiveSensing(ActiveSensingCallback fptr)
Definition: MIDI.h:205
midi_Message.h
MIDI Library for the Arduino - Message struct definition.
ErrorCallback
void(*)(int8_t) ErrorCallback
Definition: midi_Defs.h:70
MidiInterface::getTransport
Transport * getTransport()
Definition: MIDI.h:263
MidiInterface::sendRealTime
void sendRealTime(MidiType inType)
Send a Real Time (one byte) message.
Definition: MIDI.hpp:492
MidiInterface::turnThruOff
void turnThruOff()
Definition: MIDI.hpp:1378
MidiInterface::sendTimeCodeQuarterFrame
void sendTimeCodeQuarterFrame(DataByte inTypeNibble, DataByte inValuesNibble)
Send a MIDI Time Code Quarter Frame.
Definition: MIDI.hpp:400
MidiInterface::sendRpnValue
void sendRpnValue(unsigned inValue, Channel inChannel)
Send a 14-bit value for the currently selected RPN number.
Definition: MIDI.hpp:541
MidiInterface::setHandleTick
void setHandleTick(TickCallback fptr)
Definition: MIDI.h:202
MidiInterface::send
void send(const MidiMessage &)
Send a MIDI message.
Definition: MIDI.hpp:118
MIDI.hpp
MIDI Library for the Arduino - Inline implementations.
ActiveSensingCallback
void(*)(void) ActiveSensingCallback
Definition: midi_Defs.h:88
MidiInterface::beginNrpn
void beginNrpn(unsigned inNumber, Channel inChannel)
Start a Non-Registered Parameter Number frame.
Definition: MIDI.hpp:603
MidiInterface::setHandleProgramChange
void setHandleProgramChange(ProgramChangeCallback fptr)
Definition: MIDI.h:192
MidiInterface::sendProgramChange
void sendProgramChange(DataByte inProgramNumber, Channel inChannel)
Send a Program Change message.
Definition: MIDI.hpp:257
encodeSysEx
unsigned encodeSysEx(const byte *inData, byte *outSysEx, unsigned inLength, bool inFlipHeaderBits=false)
Encode System Exclusive messages. SysEx messages are encoded to guarantee transmission of data bytes ...
Definition: MIDI.cpp:46
MidiInterface::sendNoteOff
void sendNoteOff(DataByte inNoteNumber, DataByte inVelocity, Channel inChannel)
Send a Note Off message.
Definition: MIDI.hpp:245
MidiInterface::isChannelMessage
static bool isChannelMessage(MidiType inType)
Definition: MIDI.hpp:1242
MidiInterface::getTypeFromStatusByte
static MidiType getTypeFromStatusByte(byte inStatus)
Extract an enumerated MIDI type from a status byte.
Definition: MIDI.hpp:1218
TuneRequestCallback
void(*)(void) TuneRequestCallback
Definition: midi_Defs.h:82
TimeCodeQuarterFrameCallback
void(*)(byte data) TimeCodeQuarterFrameCallback
Definition: midi_Defs.h:79
MidiInterface::sendClock
void sendClock()
Definition: MIDI.h:113
MidiInterface::setHandleSystemReset
void setHandleSystemReset(SystemResetCallback fptr)
Definition: MIDI.h:206
MidiInterface::Platform
_Platform Platform
Definition: MIDI.h:57
StatusByte
byte StatusByte
Definition: midi_Defs.h:56
AfterTouchChannelCallback
void(*)(Channel channel, byte) AfterTouchChannelCallback
Definition: midi_Defs.h:76
MidiInterface::getThruState
bool getThruState() const
Definition: MIDI.hpp:1365
MidiInterface
The main class for MIDI handling. It is templated over the type of serial port to provide abstraction...
Definition: MIDI.h:54
MidiInterface::sendAfterTouch
void sendAfterTouch(DataByte inPressure, Channel inChannel)
Send a MonoPhonic AfterTouch message (applies to all notes)
Definition: MIDI.hpp:297
MidiInterface::getSysExArray
const byte * getSysExArray() const
Get the System Exclusive byte array.
Definition: MIDI.hpp:1169
MidiInterface::setHandleError
void setHandleError(ErrorCallback fptr)
Definition: MIDI.h:187
ContinueCallback
void(*)(void) ContinueCallback
Definition: midi_Defs.h:86
MidiInterface::setHandleControlChange
void setHandleControlChange(ControlChangeCallback fptr)
Definition: MIDI.h:191
MidiInterface::setHandleClock
void setHandleClock(ClockCallback fptr)
Definition: MIDI.h:200
Continue
@ Continue
System Real Time - Continue.
Definition: midi_Defs.h:117
MidiInterface::getType
MidiType getType() const
Get the last received message's type.
Definition: MIDI.hpp:1134
MidiInterface::disconnectCallbackFromType
void disconnectCallbackFromType(MidiType inType)
Detach an external function from the given type.
Definition: MIDI.hpp:1262
MidiInterface::sendPolyPressure
void sendPolyPressure(DataByte inNoteNumber, DataByte inPressure, Channel inChannel) __attribute__((deprecated))
Send a Polyphonic AfterTouch message (applies to a specified note)
Definition: MIDI.hpp:285
MidiInterface::getSysExArrayLength
unsigned getSysExArrayLength() const
Get the length of the System Exclusive array.
Definition: MIDI.hpp:1180
MidiInterface::MidiMessage
Message< Settings::SysExMaxSize > MidiMessage
Definition: MIDI.h:58
SystemExclusiveCallback
void(*)(byte *array, unsigned size) SystemExclusiveCallback
Definition: midi_Defs.h:78
MidiInterface::begin
void begin(Channel inChannel=1)
Call the begin method in the setup() function of the Arduino.
Definition: MIDI.hpp:72
SystemResetCallback
void(*)(void) SystemResetCallback
Definition: midi_Defs.h:89
ClockCallback
void(*)(void) ClockCallback
Definition: midi_Defs.h:83
MidiInterface::endRpn
void endRpn(Channel inChannel)
Terminate an RPN frame. This will send a Null Function to deselect the currently selected RPN.
Definition: MIDI.hpp:589
MidiInterface::setThruFilterMode
void setThruFilterMode(Thru::Mode inThruFilterMode)
Set the filter for thru mirroring.
Definition: MIDI.hpp:1352
MidiInterface::getInputChannel
Channel getInputChannel() const
Definition: MIDI.hpp:1195
StopCallback
void(*)(void) StopCallback
Definition: midi_Defs.h:87
MidiInterface::sendTick
void sendTick()
Definition: MIDI.h:116
ActiveSensing
@ ActiveSensing
System Real Time - Active Sensing.
Definition: midi_Defs.h:120
MidiType
MidiType
Definition: midi_Defs.h:95
midi_Settings.h
MIDI Library for the Arduino - Settings.
MidiInterface::setHandlePitchBend
void setHandlePitchBend(PitchBendCallback fptr)
Definition: MIDI.h:194
BEGIN_MIDI_NAMESPACE
#define BEGIN_MIDI_NAMESPACE
Definition: midi_Namespace.h:31
Channel
byte Channel
Definition: midi_Defs.h:58
MidiInterface::sendTuneRequest
void sendTuneRequest()
Send a Tune Request message.
Definition: MIDI.hpp:388
Thru::Full
@ Full
Fully enabled Thru (every incoming message is sent back).
Definition: midi_Defs.h:132
MidiInterface::setHandleStart
void setHandleStart(StartCallback fptr)
Definition: MIDI.h:201
Stop
@ Stop
System Real Time - Stop.
Definition: midi_Defs.h:118
MidiInterface::Settings
_Settings Settings
Definition: MIDI.h:56
Tick
@ Tick
System Real Time - Timing Tick (1 tick = 10 milliseconds)
Definition: midi_Defs.h:115
MidiInterface::setHandleAfterTouchChannel
void setHandleAfterTouchChannel(AfterTouchChannelCallback fptr)
Definition: MIDI.h:193
ControlChangeCallback
void(*)(Channel channel, byte, byte) ControlChangeCallback
Definition: midi_Defs.h:74
MidiInterface::sendNrpnIncrement
void sendNrpnIncrement(byte inAmount, Channel inChannel)
Definition: MIDI.hpp:648
MidiInterface::setHandleSystemExclusive
void setHandleSystemExclusive(SystemExclusiveCallback fptr)
Definition: MIDI.h:195
MidiInterface::setHandleContinue
void setHandleContinue(ContinueCallback fptr)
Definition: MIDI.h:203
TickCallback
void(*)(void) TickCallback
Definition: midi_Defs.h:85
MidiInterface::getChannel
Channel getChannel() const
Get the channel of the message stored in the structure.
Definition: MIDI.hpp:1145
MidiInterface::read
bool read()
Read messages from the serial port using the main input channel.
Definition: MIDI.hpp:704
serialMIDI.h
MIDI Library for the Arduino - Platform @license MIT - Copyright (c) 2015 Francois Best.
MidiInterface::sendRpnIncrement
void sendRpnIncrement(byte inAmount, Channel inChannel)
Definition: MIDI.hpp:568
MidiInterface::sendSysEx
void sendSysEx(unsigned inLength, const byte *inArray, bool inArrayContainsBoundaries=false)
Generate and send a System Exclusive frame.
Definition: MIDI.hpp:357
MidiInterface::setHandleNoteOff
void setHandleNoteOff(NoteOffCallback fptr)
Definition: MIDI.h:188
MidiInterface::setHandleAfterTouchPoly
void setHandleAfterTouchPoly(AfterTouchPolyCallback fptr)
Definition: MIDI.h:190
MidiInterface::sendContinue
void sendContinue()
Definition: MIDI.h:117
MidiInterface::sendStop
void sendStop()
Definition: MIDI.h:115
MidiInterface::getChannelFromStatusByte
static Channel getChannelFromStatusByte(byte inStatus)
Returns channel in the range 1-16.
Definition: MIDI.hpp:1236
MidiInterface::sendPitchBend
void sendPitchBend(int inPitchValue, Channel inChannel)
Send a Pitch Bend message using a signed integer value.
Definition: MIDI.hpp:324
MidiInterface::sendSystemReset
void sendSystemReset()
Definition: MIDI.h:119
MidiInterface::setHandleSongPosition
void setHandleSongPosition(SongPositionCallback fptr)
Definition: MIDI.h:197
MidiInterface::setHandleMessage
void setHandleMessage(void(*fptr)(const MidiMessage &))
Definition: MIDI.h:186
Message< Settings::SysExMaxSize >
NoteOffCallback
void(*)(Channel channel, byte note, byte velocity) NoteOffCallback
Definition: midi_Defs.h:71
MidiInterface::sendStart
void sendStart()
Definition: MIDI.h:114
MidiInterface::sendActiveSensing
void sendActiveSensing()
Definition: MIDI.h:118
DataByte
byte DataByte
Definition: midi_Defs.h:57