FastLED 3.9.15
Loading...
Searching...
No Matches

◆ send() [1/2]

template<class Transport, class Settings, class Platform>
void MidiInterface< Transport, Settings, Platform >::send ( const MidiMessage & inMessage)
inline

Send a MIDI message.

Parameters
inMessageThe message

This method is used when you want to send a Message that has not been constructed by the library, but by an external source. This method does not check against any of the constraints. Typically this function is use by MIDI Bridges taking MIDI messages and passing them thru.

Definition at line 118 of file MIDI.hpp.

119{
120 if (!inMessage.valid)
121 return;
122
123 if (mTransport.beginTransmission(inMessage.type))
124 {
125 const StatusByte status = getStatus(inMessage.type, inMessage.channel);
126 mTransport.write(status);
127
129 {
130 if (inMessage.length > 1) mTransport.write(inMessage.data1);
131 if (inMessage.length > 2) mTransport.write(inMessage.data2);
132 } else
133 {
134 // sysexArray does not contain the start and end tags
136
137 for (size_t i = 0; i < inMessage.getSysExSize(); i++)
138 mTransport.write(inMessage.sysexArray[i]);
139
141 }
142 }
143 mTransport.endTransmission();
145}
StatusByte getStatus(MidiType inType, Channel inChannel) const
Definition MIDI.hpp:681
Transport & mTransport
Definition MIDI.h:267
The main class for MIDI handling. It is templated over the type of serial port to provide abstraction...
Definition MIDI.h:55
void UpdateLastSentTime()
Definition MIDI.hpp:1385

References Message< SysExMaxSize >::channel, Message< SysExMaxSize >::data1, Message< SysExMaxSize >::data2, getStatus(), Message< SysExMaxSize >::getSysExSize(), Message< SysExMaxSize >::length, mTransport, Message< SysExMaxSize >::sysexArray, SystemExclusive, SystemExclusiveEnd, SystemExclusiveStart, Message< SysExMaxSize >::type, UpdateLastSentTime(), and Message< SysExMaxSize >::valid.

Referenced by sendAfterTouch(), sendAfterTouch(), sendControlChange(), sendNoteOff(), sendNoteOn(), sendPitchBend(), sendPolyPressure(), sendProgramChange(), and thruFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: