Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
SerialMIDI_Interface.cpp
Go to the documentation of this file.
3
4#include "PicoUSBInit.hpp"
5
7
8// -------------------------------------------------------------------------- //
9
10// Reading MIDI
11
17
19
20// -------------------------------------------------------------------------- //
21
22// Retrieving the received messages
23
27
31
35
39
40// -------------------------------------------------------------------------- //
41
42// Sending MIDI
43
46 return;
47 stream.write(msg.header);
48 stream.write(msg.data1);
49 if (msg.hasTwoDataBytes())
50 stream.write(msg.data2);
51}
52
55 return;
56 stream.write(msg.header);
57 if (msg.getNumberOfDataBytes() >= 1)
58 stream.write(msg.data1);
59 if (msg.getNumberOfDataBytes() >= 2)
60 stream.write(msg.data2);
61}
62
68
74
MIDIReadEvent
Values returned by the MIDI reading functions.
@ NO_MESSAGE
No new messages were received.
When using the earlephilhower/arduino-pico core with the TinyUSB backend, calling Serial....
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
static void updateIncoming(MIDIInterface_t *iface)
Read, parse and dispatch incoming MIDI messages on the given interface.
ChannelMessage getChannelMessage() const
Get the latest MIDI channel voice message.
RealTimeMessage getRealTimeMessage() const
Get the latest MIDI real-time message.
SysCommonMessage getSysCommonMessage() const
Get the latest MIDI system common message.
MIDIReadEvent pull(BytePuller &&puller)
Parse one incoming MIDI message.
SysExMessage getSysExMessage() const
Get the latest SysEx message.
ChannelMessage getChannelMessage() const
Return the received channel voice message.
RealTimeMessage getRealTimeMessage() const
Return the received real-time message.
void sendChannelMessageImpl(ChannelMessage) override
Low-level function for sending a MIDI channel voice message.
void update() override
Read the MIDI interface and call the callback if a message was received.
SysCommonMessage getSysCommonMessage() const
Return the received system common message.
void sendRealTimeImpl(RealTimeMessage) override
Low-level function for sending a MIDI real-time message.
void sendSysExImpl(SysExMessage) override
Low-level function for sending a system exclusive MIDI message.
void sendSysCommonImpl(SysCommonMessage) override
Low-level function for sending a MIDI system common message.
MIDIReadEvent read()
Try reading and parsing a single incoming MIDI message.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
Helper that pulls bytes out of an Arduino stream.
An array wrapper for easy copying, comparing, and iterating.
Definition Array.hpp:32
static constexpr size_t length
Definition Array.hpp:35
T data[N]
Definition Array.hpp:33