-
Notifications
You must be signed in to change notification settings - Fork 66
MACRO for creation an AppleMIDI instance
lathoub edited this page Feb 13, 2021
·
20 revisions
The mechanism to create the MIDI and AppleMIDI instance uses c++ templates.
This library, and the underlying MIDI library, do not allocate (and free) memory at runtime risking memory fragmentation and reboots.
APPLEMIDI_CREATE_INSTANCE(EthernetUDP, MIDI, "AppleMIDI-Arduino", DEFAULT_CONTROL_PORT);
Type Name SessionName Port
| | | |
| | | +-> Default UDP port is 5004
| | +---------------> AppleMIDI session name
| +-----------------------------> Variable name used in the sketch
| also create an instance AppleMIDI
+---------------------------------------> UDP class from the Ethernet lib.
To make it easier to read, the MACRO has been multi-lined and \ removed
#define APPLEMIDI_CREATE_INSTANCE(Type, Name, SessionName, Port)
1. APPLEMIDI_NAMESPACE::AppleMIDISession<Type> Apple##Name(SessionName, Port);
2. MIDI_NAMESPACE::MidiInterface<
3. APPLEMIDI_NAMESPACE::AppleMIDISession<Type>,
4. APPLEMIDI_NAMESPACE::AppleMIDISettings>
5. Name((APPLEMIDI_NAMESPACE::AppleMIDISession<Type>&)Apple##Name);
- Create an AppleMIDI instance, with a given sessionName and (default) port.
- The FortySevenEffects MidiInterface template
- Provide the UDP class as Type
- Specific AppleMIDI Settings
- The MIDI instance