arduino-midi
All Classes Functions Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
midi::MidiStreamIn Class Reference

Input of Midi Messages from the Aruduino HardwareSerial port. You need to give the default MidiParser or your own subclassed implementation in the constructor to process the midi records. More...

#include <MidiStreamIn.h>

Inheritance diagram for midi::MidiStreamIn:
midi::MidiCommon

Public Member Functions

 MidiStreamIn (Stream &stream, MidiAction &action)
 Default Constructor.
 
 MidiStreamIn (Stream &stream, MidiParser &handler)
 Constructor to implement you custom MidiParser.
 
 ~MidiStreamIn ()
 Destructor.
 
virtual void allNotesOff (int8_t channel=-1)
 Sends a allNotesOff MIDI command to the output.
 
virtual void channelPressure (uint8_t value, int8_t channel=-1)
 Sends a channelPressure MIDI command to the output.
 
virtual void controlChange (uint8_t msg, uint8_t value, int8_t channel=-1)
 Sends a control change MIDI command to the output.
 
virtual ConnectionStatus getConnectionStatus ()
 Determines the connection status.
 
virtual void localControl (bool active, int8_t channel=-1)
 Sends a localControl MIDI command to the output.
 
bool loop ()
 
virtual void noteOff (uint8_t note, uint8_t velocity, int8_t channel=-1)
 Sends a noteOff MIDI command to the output.
 
virtual void noteOn (uint8_t note, uint8_t velocity, int8_t channel=-1)
 Sends a noteOn MIDI command to the output.
 
virtual void pitchBend (uint16_t value, int8_t channel=-1)
 Sends a pitchBend MIDI command to the output.
 
virtual void polyPressure (uint8_t valuePar, int8_t channel=-1)
 Sends a polyPressure MIDI command to the output.
 
virtual void programChange (uint8_t program, int8_t channel=-1)
 Sends a programChange MIDI command to the output.
 
virtual void resetAllControllers (int8_t channel=-1)
 Sends a resetAllControllers MIDI command to the output.
 
virtual void setDefaultSendingChannel (int8_t channel)
 Sets the default channel for the sending commands.
 
virtual void setFilterReceivingChannel (int channel)
 Activates a filter on receiving messages to the indicated channel.
 
virtual void setMidiAction (MidiAction &MidiAction)
 Defines the voice which is used in inbound processing.
 
void write (MidiMessage *msg, int len)
 write multiple MidiMessage objects to final output
 

Static Public Member Functions

static uint8_t frequencyToNote (float freq)
 Converts a Frequency (in Hz) to a MIDI note.
 
static float noteToFrequency (uint8_t note)
 Converts a MIDI note to a frequency in Hz.
 

Protected Member Functions

int getLastStatusPos (uint8_t *buffer, int endPos)
 
void setConnectionStatus (ConnectionStatus status)
 
void setup (Stream *stream, MidiParser *handler, bool releaseHandler)
 
void updateTimestamp (MidiMessage *pMsg)
 
virtual void writeData (MidiMessage *msg, int len)
 

Protected Attributes

uint8_t buffer [BUFFER_LEN]
 
ConnectionStatus connectionStatus
 
char * name
 
MidiMessage outMessage
 
bool ownsHandler = false
 
MidiParserpHandler = nullptr
 
MidiActionpMidiAction
 
Stream * pStream = nullptr
 
int receivingChannel = -1
 
uint8_t sendingChannel = 0
 
int startPos = 0
 
uint8_t timestampHigh
 
uint8_t timestampLow
 

Friends

class MidiIpServer
 
class MidiServer
 
class MidiUdpServer
 

Detailed Description

Input of Midi Messages from the Aruduino HardwareSerial port. You need to give the default MidiParser or your own subclassed implementation in the constructor to process the midi records.

You also need to call the loop method in the loop of your Arduino sketch.

by Phil Schatzmann


The documentation for this class was generated from the following files: