arduino-midi
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
midi::AppleMidiServer Class Reference

A Sender and Receiver which supports Apple Midi using the implementation from midibox. Apple midi uses UDP on a control and a data port. https://github.com/midibox/esp32-idf-applemidi. More...

#include <AppleMidiServer.h>

Inheritance diagram for midi::AppleMidiServer:
midi::MidiCommon

Public Member Functions

 AppleMidiServer (MidiAction *action, int midiPort=-1)
 
virtual void allNotesOff (int8_t channel=-1)
 Sends a allNotesOff MIDI command to the output.
 
bool begin (int control_port=APPLEMIDI_DEFAULT_PORT)
 Starts the listening.
 
bool begin (IPAddress adress, int control_port=APPLEMIDI_DEFAULT_PORT, int data_port_opt=-1)
 Starts a session with the indicated address.
 
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.
 
void end ()
 Closes the connections.
 
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 ()
 Processing logic to be executed in 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 setName (const char *name)
 Defines the dns name.
 
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

void setConnectionStatus (ConnectionStatus status)
 
void setupLogger ()
 Activate apple midi debug messages.
 
virtual void setupMDns (int port)
 Setup MDNS apple-midi service.
 
virtual bool tick (uint32_t timestamp)
 process input from the control and the data port
 
const char * toStr (IPAddress &adress)
 provides the network address as string
 
void updateTimestamp (MidiMessage *pMsg)
 
virtual void writeData (MidiMessage *msg, int len)
 MidiCommon implementation.
 

Static Protected Member Functions

static void applemidi_callback_midi_message_received (uint8_t port, uint32_t timestamp, uint8_t midi_status, uint8_t *remaining_message, size_t len, size_t continued_sysex_pos)
 Callback method to parse midi message.
 
static int32_t applemidi_if_send_udp_datagram (uint8_t *ip_addr, uint16_t port, uint8_t *tx_data, size_t tx_len)
 Callback method to send UDP message with the help of the Arduino API.
 

Protected Attributes

MidiParser apple_event_handler
 
ConnectionStatus connectionStatus
 
const char * dns_name = "AppleMidi"
 
bool is_setup = false
 
char * name
 
MidiMessage outMessage
 
MidiActionpMidiAction
 
int receivingChannel = -1
 
int remote_port
 
uint8_t rx_buffer [MIDI_BUFFER_SIZE]
 
uint8_t sendingChannel = 0
 
uint8_t timestampHigh
 
uint8_t timestampLow
 
WiFiUDP udpControl
 
WiFiUDP udpData
 

Detailed Description

A Sender and Receiver which supports Apple Midi using the implementation from midibox. Apple midi uses UDP on a control and a data port. https://github.com/midibox/esp32-idf-applemidi.

by Phil Schatzmann


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