Control Surface  1.2.0
MIDI Control Surface library for Arduino
Classes | Typedefs | Functions
MIDI Routing

Operators and utilities for MIDI routing. More...

Classes

class  MIDI_Sink
 Class that can receive MIDI messages from a MIDI pipe. More...
 
class  MIDI_Source
 Class that can send MIDI messages to a MIDI pipe. More...
 
struct  TrueMIDI_Sink
 A MIDI_Sink that is not a MIDI_Pipe. More...
 
struct  TrueMIDI_Source
 A MIDI_Source that is not a MIDI_Pipe. More...
 
class  MIDI_Pipe
 Class that routes MIDI messages from a MIDI_Source to a MIDI_Sink. More...
 
struct  TrueMIDI_SinkSource
 A struct that is both a TrueMIDI_Sink and a TrueMIDI_Source. More...
 
struct  MIDI_PipeFactory< N, Pipe >
 Class that produces multiple MIDI_Pipes. More...
 

Typedefs

using BidirectionalMIDI_Pipe = std::pair< MIDI_Pipe, MIDI_Pipe >
 A bidirectional pipe consists of two unidirectional pipes. More...
 
template<size_t N>
using BidirectionalMIDI_PipeFactory = MIDI_PipeFactory< N, BidirectionalMIDI_Pipe >
 

Functions

MIDI_Pipeoperator>> (TrueMIDI_Source &source, MIDI_Pipe &pipe)
 Connect a source to a pipe (source >> pipe). More...
 
TrueMIDI_Sinkoperator>> (MIDI_Pipe &pipe, TrueMIDI_Sink &sink)
 Connect a pipe to a sink (pipe >> sink). More...
 
MIDI_Pipeoperator<< (TrueMIDI_Sink &sink, MIDI_Pipe &pipe)
 Connect a sink to a pipe (sink << pipe). More...
 
TrueMIDI_Sourceoperator<< (MIDI_Pipe &pipe, TrueMIDI_Source &source)
 Connect a pipe to a source (pipe << source). More...
 
TrueMIDI_SinkSourceoperator| (BidirectionalMIDI_Pipe &pipe, TrueMIDI_SinkSource &sinksource)
 Connect a pipe to a sink+source (pipe | source+sink). More...
 
BidirectionalMIDI_Pipeoperator| (TrueMIDI_SinkSource &sinksource, BidirectionalMIDI_Pipe &pipe)
 Connect a sink+source to a pipe (source+sink | pipe). More...
 
template<size_t N, class Pipe >
MIDI_Pipeoperator>> (TrueMIDI_Source &source, MIDI_PipeFactory< N, Pipe > &pipe_fact)
 
template<size_t N, class Pipe >
TrueMIDI_Sinkoperator>> (MIDI_PipeFactory< N, Pipe > &pipe_fact, TrueMIDI_Sink &sink)
 
template<size_t N, class Pipe >
MIDI_Pipeoperator<< (TrueMIDI_Sink &sink, MIDI_PipeFactory< N, Pipe > &pipe_fact)
 
template<size_t N, class Pipe >
TrueMIDI_Sourceoperator<< (MIDI_PipeFactory< N, Pipe > &pipe_fact, TrueMIDI_Source &source)
 
template<size_t N>
TrueMIDI_SinkSourceoperator| (BidirectionalMIDI_PipeFactory< N > &pipe_fact, TrueMIDI_SinkSource &sinksource)
 
template<size_t N>
BidirectionalMIDI_Pipeoperator| (TrueMIDI_SinkSource &sinksource, BidirectionalMIDI_PipeFactory< N > &pipe_fact)
 

Detailed Description

Operators and utilities for MIDI routing.

Allows you to use syntax like:

midiA = Serial1, midiB = Serial2, midiC = Serial3;
MIDI_PipeFactory<3> pipes; // Factory that can produce 3 pipes
midiA >> pipes >> midiB;
midiC >> pipes >> midiB;
midiC << pipes << midiB;

Or for bidirectional connections:

midiA = Serial1, midiB = Serial2, midiC = Serial3;
BidirectionalMIDI_PipeFactory<2> pipes; // Factory that can produce 2 pipes
midiA | pipes | midiB;
midiA | pipes | midiC;

Typedef Documentation

◆ BidirectionalMIDI_Pipe

A bidirectional pipe consists of two unidirectional pipes.

Definition at line 504 of file MIDI_Pipes.hpp.

◆ BidirectionalMIDI_PipeFactory

Definition at line 571 of file MIDI_Pipes.hpp.

Function Documentation

◆ operator>>() [1/4]

MIDI_Pipe& operator>> ( TrueMIDI_Source source,
MIDI_Pipe pipe 
)
inline

Connect a source to a pipe (source >> pipe).

Definition at line 507 of file MIDI_Pipes.hpp.

◆ operator>>() [2/4]

TrueMIDI_Sink& operator>> ( MIDI_Pipe pipe,
TrueMIDI_Sink sink 
)
inline

Connect a pipe to a sink (pipe >> sink).

Definition at line 513 of file MIDI_Pipes.hpp.

◆ operator<<() [1/4]

MIDI_Pipe& operator<< ( TrueMIDI_Sink sink,
MIDI_Pipe pipe 
)
inline

Connect a sink to a pipe (sink << pipe).

Definition at line 519 of file MIDI_Pipes.hpp.

◆ operator<<() [2/4]

TrueMIDI_Source& operator<< ( MIDI_Pipe pipe,
TrueMIDI_Source source 
)
inline

Connect a pipe to a source (pipe << source).

Definition at line 525 of file MIDI_Pipes.hpp.

◆ operator|() [1/4]

TrueMIDI_SinkSource& operator| ( BidirectionalMIDI_Pipe pipe,
TrueMIDI_SinkSource sinksource 
)
inline

Connect a pipe to a sink+source (pipe | source+sink).

Definition at line 531 of file MIDI_Pipes.hpp.

◆ operator|() [2/4]

BidirectionalMIDI_Pipe& operator| ( TrueMIDI_SinkSource sinksource,
BidirectionalMIDI_Pipe pipe 
)
inline

Connect a sink+source to a pipe (source+sink | pipe).

Definition at line 539 of file MIDI_Pipes.hpp.

◆ operator>>() [3/4]

MIDI_Pipe& operator>> ( TrueMIDI_Source source,
MIDI_PipeFactory< N, Pipe > &  pipe_fact 
)
inline

Definition at line 575 of file MIDI_Pipes.hpp.

◆ operator>>() [4/4]

TrueMIDI_Sink& operator>> ( MIDI_PipeFactory< N, Pipe > &  pipe_fact,
TrueMIDI_Sink sink 
)
inline

Definition at line 581 of file MIDI_Pipes.hpp.

◆ operator<<() [3/4]

MIDI_Pipe& operator<< ( TrueMIDI_Sink sink,
MIDI_PipeFactory< N, Pipe > &  pipe_fact 
)
inline

Definition at line 587 of file MIDI_Pipes.hpp.

◆ operator<<() [4/4]

TrueMIDI_Source& operator<< ( MIDI_PipeFactory< N, Pipe > &  pipe_fact,
TrueMIDI_Source source 
)
inline

Definition at line 593 of file MIDI_Pipes.hpp.

◆ operator|() [3/4]

TrueMIDI_SinkSource& operator| ( BidirectionalMIDI_PipeFactory< N > &  pipe_fact,
TrueMIDI_SinkSource sinksource 
)
inline

Definition at line 600 of file MIDI_Pipes.hpp.

◆ operator|() [4/4]

BidirectionalMIDI_Pipe& operator| ( TrueMIDI_SinkSource sinksource,
BidirectionalMIDI_PipeFactory< N > &  pipe_fact 
)
inline

Definition at line 607 of file MIDI_Pipes.hpp.

MIDI_PipeFactory
Class that produces multiple MIDI_Pipes.
Definition: MIDI_Pipes.hpp:557
HardwareSerialMIDI_Interface
A class for MIDI interfaces sending and receiving MIDI messages over a Hardware Serial port.
Definition: SerialMIDI_Interface.hpp:138