Arduino MIDI Library  Version 4.3
midi_Defs.h File Reference

MIDI Library for the Arduino - Definitions. More...

#include "midi_Namespace.h"
#include <inttypes.h>

Go to the source code of this file.

Classes

struct  Thru
 
struct  RPN
 

Macros

#define MIDI_LIBRARY_VERSION   0x040300
 
#define MIDI_LIBRARY_VERSION_MAJOR   4
 
#define MIDI_LIBRARY_VERSION_MINOR   3
 
#define MIDI_LIBRARY_VERSION_PATCH   0
 
#define MIDI_CHANNEL_OMNI   0
 
#define MIDI_CHANNEL_OFF   17
 
#define MIDI_PITCHBEND_MIN   -8192
 
#define MIDI_PITCHBEND_MAX   8191
 
#define MIDI_CREATE_INSTANCE(Type, SerialPort, Name)    midi::MidiInterface<Type> Name((Type&)SerialPort);
 Create an instance of the library attached to a serial port. You can use HardwareSerial or SoftwareSerial for the serial port. Example: MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, midi2); Then call midi2.begin(), midi2.read() etc.. More...
 
#define MIDI_CREATE_DEFAULT_INSTANCE()    MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI);
 Create an instance of the library with default name, serial port and settings, for compatibility with sketches written with pre-v4.2 MIDI Lib, or if you don't bother using custom names, serial port or settings. More...
 
#define MIDI_CREATE_CUSTOM_INSTANCE(Type, SerialPort, Name, Settings)    midi::MidiInterface<Type, Settings> Name((Type&)SerialPort);
 Create an instance of the library attached to a serial port with custom settings. More...
 

Typedefs

typedef uint8_t byte
 
typedef byte StatusByte
 
typedef byte DataByte
 
typedef byte Channel
 
typedef byte FilterMode
 

Enumerations

enum  MidiType {
  InvalidType = 0x00, NoteOff = 0x80, NoteOn = 0x90, AfterTouchPoly = 0xA0,
  ControlChange = 0xB0, ProgramChange = 0xC0, AfterTouchChannel = 0xD0, PitchBend = 0xE0,
  SystemExclusive = 0xF0, TimeCodeQuarterFrame = 0xF1, SongPosition = 0xF2, SongSelect = 0xF3,
  TuneRequest = 0xF6, Clock = 0xF8, Start = 0xFA, Continue = 0xFB,
  Stop = 0xFC, ActiveSensing = 0xFE, SystemReset = 0xFF
}
 
enum  MidiControlChangeNumber {
  BankSelect = 0, ModulationWheel = 1, BreathController = 2, FootController = 4,
  PortamentoTime = 5, DataEntryMSB = 6, ChannelVolume = 7, Balance = 8,
  Pan = 10, ExpressionController = 11, EffectControl1 = 12, EffectControl2 = 13,
  GeneralPurposeController1 = 16, GeneralPurposeController2 = 17, GeneralPurposeController3 = 18, GeneralPurposeController4 = 19,
  DataEntryLSB = 38, Sustain = 64, Portamento = 65, Sostenuto = 66,
  SoftPedal = 67, Legato = 68, Hold = 69, SoundController1 = 70,
  SoundController2 = 71, SoundController3 = 72, SoundController4 = 73, SoundController5 = 74,
  SoundController6 = 75, SoundController7 = 76, SoundController8 = 77, SoundController9 = 78,
  SoundController10 = 79, GeneralPurposeController5 = 80, GeneralPurposeController6 = 81, GeneralPurposeController7 = 82,
  GeneralPurposeController8 = 83, PortamentoControl = 84, Effects1 = 91, Effects2 = 92,
  Effects3 = 93, Effects4 = 94, Effects5 = 95, DataIncrement = 96,
  DataDecrement = 97, NRPNLSB = 98, NRPNMSB = 99, RPNLSB = 100,
  RPNMSB = 101, AllSoundOff = 120, ResetAllControllers = 121, LocalControl = 122,
  AllNotesOff = 123, OmniModeOff = 124, OmniModeOn = 125, MonoModeOn = 126,
  PolyModeOn = 127
}
 Enumeration of Control Change command numbers. See the detailed controllers numbers & description here: http://www.somascape.org/midi/tech/spec.html#ctrlnums. More...
 

Functions

enum __attribute__ ((deprecated)) MidiFilterMode
 

Detailed Description

MIDI Library for the Arduino - Definitions.

Project Arduino MIDI Library

Version
4.3
Author
Francois Best
Date
24/02/11 MIT - Copyright (c) 2015 Francois Best

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file midi_Defs.h.

Macro Definition Documentation

#define MIDI_CHANNEL_OFF   17

Definition at line 50 of file midi_Defs.h.

#define MIDI_CHANNEL_OMNI   0

Definition at line 49 of file midi_Defs.h.

#define MIDI_CREATE_CUSTOM_INSTANCE (   Type,
  SerialPort,
  Name,
  Settings 
)    midi::MidiInterface<Type, Settings> Name((Type&)SerialPort);

Create an instance of the library attached to a serial port with custom settings.

See also
DefaultSettings
MIDI_CREATE_INSTANCE

Definition at line 236 of file midi_Defs.h.

#define MIDI_CREATE_DEFAULT_INSTANCE ( )    MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI);

Create an instance of the library with default name, serial port and settings, for compatibility with sketches written with pre-v4.2 MIDI Lib, or if you don't bother using custom names, serial port or settings.

Definition at line 227 of file midi_Defs.h.

#define MIDI_CREATE_INSTANCE (   Type,
  SerialPort,
  Name 
)    midi::MidiInterface<Type> Name((Type&)SerialPort);

Create an instance of the library attached to a serial port. You can use HardwareSerial or SoftwareSerial for the serial port. Example: MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, midi2); Then call midi2.begin(), midi2.read() etc..

Definition at line 215 of file midi_Defs.h.

#define MIDI_LIBRARY_VERSION   0x040300

Definition at line 42 of file midi_Defs.h.

#define MIDI_LIBRARY_VERSION_MAJOR   4

Definition at line 43 of file midi_Defs.h.

#define MIDI_LIBRARY_VERSION_MINOR   3

Definition at line 44 of file midi_Defs.h.

#define MIDI_LIBRARY_VERSION_PATCH   0

Definition at line 45 of file midi_Defs.h.

#define MIDI_PITCHBEND_MAX   8191

Definition at line 53 of file midi_Defs.h.

#define MIDI_PITCHBEND_MIN   -8192

Definition at line 52 of file midi_Defs.h.

Typedef Documentation

typedef uint8_t byte

Definition at line 37 of file midi_Defs.h.

typedef byte Channel

Definition at line 60 of file midi_Defs.h.

typedef byte DataByte

Definition at line 59 of file midi_Defs.h.

typedef byte FilterMode

Definition at line 61 of file midi_Defs.h.

typedef byte StatusByte

Definition at line 58 of file midi_Defs.h.

Enumeration Type Documentation

Enumeration of Control Change command numbers. See the detailed controllers numbers & description here: http://www.somascape.org/midi/tech/spec.html#ctrlnums.

Enumerator
BankSelect 
ModulationWheel 
BreathController 
FootController 
PortamentoTime 
DataEntryMSB 
ChannelVolume 
Balance 
Pan 
ExpressionController 
EffectControl1 
EffectControl2 
GeneralPurposeController1 
GeneralPurposeController2 
GeneralPurposeController3 
GeneralPurposeController4 
DataEntryLSB 
Sustain 
Portamento 
Sostenuto 
SoftPedal 
Legato 
Hold 
SoundController1 

Synth: Sound Variation FX: Exciter On/Off.

SoundController2 

Synth: Harmonic Content FX: Compressor On/Off.

SoundController3 

Synth: Release Time FX: Distortion On/Off.

SoundController4 

Synth: Attack Time FX: EQ On/Off.

SoundController5 

Synth: Brightness FX: Expander On/Off.

SoundController6 

Synth: Decay Time FX: Reverb On/Off.

SoundController7 

Synth: Vibrato Rate FX: Delay On/Off.

SoundController8 

Synth: Vibrato Depth FX: Pitch Transpose On/Off.

SoundController9 

Synth: Vibrato Delay FX: Flange/Chorus On/Off.

SoundController10 

Synth: Undefined FX: Special Effects On/Off.

GeneralPurposeController5 
GeneralPurposeController6 
GeneralPurposeController7 
GeneralPurposeController8 
PortamentoControl 
Effects1 

Reverb send level.

Effects2 

Tremolo depth.

Effects3 

Chorus send level.

Effects4 

Celeste depth.

Effects5 

Phaser depth.

DataIncrement 
DataDecrement 
NRPNLSB 

Non-Registered Parameter Number (LSB)

NRPNMSB 

Non-Registered Parameter Number (MSB)

RPNLSB 

Registered Parameter Number (LSB)

RPNMSB 

Registered Parameter Number (MSB)

AllSoundOff 
ResetAllControllers 
LocalControl 
AllNotesOff 
OmniModeOff 
OmniModeOn 
MonoModeOn 
PolyModeOn 

Definition at line 120 of file midi_Defs.h.

121 {
122  // High resolution Continuous Controllers MSB (+32 for LSB) ----------------
123  BankSelect = 0,
124  ModulationWheel = 1,
125  BreathController = 2,
126  // CC3 undefined
127  FootController = 4,
128  PortamentoTime = 5,
129  DataEntryMSB = 6,
130  ChannelVolume = 7,
131  Balance = 8,
132  // CC9 undefined
133  Pan = 10,
135  EffectControl1 = 12,
136  EffectControl2 = 13,
137  // CC14 undefined
138  // CC15 undefined
143 
144  DataEntryLSB = 38,
145 
146  // Switches ----------------------------------------------------------------
147  Sustain = 64,
148  Portamento = 65,
149  Sostenuto = 66,
150  SoftPedal = 67,
151  Legato = 68,
152  Hold = 69,
153 
154  // Low resolution continuous controllers -----------------------------------
155  SoundController1 = 70,
156  SoundController2 = 71,
157  SoundController3 = 72,
158  SoundController4 = 73,
159  SoundController5 = 74,
160  SoundController6 = 75,
161  SoundController7 = 76,
162  SoundController8 = 77,
163  SoundController9 = 78,
164  SoundController10 = 79,
169  PortamentoControl = 84,
170  // CC85 to CC90 undefined
171  Effects1 = 91,
172  Effects2 = 92,
173  Effects3 = 93,
174  Effects4 = 94,
175  Effects5 = 95,
176  DataIncrement = 96,
177  DataDecrement = 97,
178  NRPNLSB = 98,
179  NRPNMSB = 99,
180  RPNLSB = 100,
181  RPNMSB = 101,
182 
183  // Channel Mode messages ---------------------------------------------------
184  AllSoundOff = 120,
185  ResetAllControllers = 121,
186  LocalControl = 122,
187  AllNotesOff = 123,
188  OmniModeOff = 124,
189  OmniModeOn = 125,
190  MonoModeOn = 126,
191  PolyModeOn = 127
192 };
Synth: Brightness FX: Expander On/Off.
Definition: midi_Defs.h:159
Synth: Attack Time FX: EQ On/Off.
Definition: midi_Defs.h:158
Synth: Undefined FX: Special Effects On/Off.
Definition: midi_Defs.h:164
Synth: Sound Variation FX: Exciter On/Off.
Definition: midi_Defs.h:155
Synth: Release Time FX: Distortion On/Off.
Definition: midi_Defs.h:157
Synth: Vibrato Delay FX: Flange/Chorus On/Off.
Definition: midi_Defs.h:163
Celeste depth.
Definition: midi_Defs.h:174
Phaser depth.
Definition: midi_Defs.h:175
Tremolo depth.
Definition: midi_Defs.h:172
Synth: Vibrato Rate FX: Delay On/Off.
Definition: midi_Defs.h:161
Synth: Decay Time FX: Reverb On/Off.
Definition: midi_Defs.h:160
Registered Parameter Number (MSB)
Definition: midi_Defs.h:181
Registered Parameter Number (LSB)
Definition: midi_Defs.h:180
Non-Registered Parameter Number (MSB)
Definition: midi_Defs.h:179
Reverb send level.
Definition: midi_Defs.h:171
Definition: midi_Defs.h:133
Synth: Vibrato Depth FX: Pitch Transpose On/Off.
Definition: midi_Defs.h:162
Synth: Harmonic Content FX: Compressor On/Off.
Definition: midi_Defs.h:156
Non-Registered Parameter Number (LSB)
Definition: midi_Defs.h:178
Chorus send level.
Definition: midi_Defs.h:173
enum MidiType

Enumeration of MIDI types

Enumerator
InvalidType 

For notifying errors.

NoteOff 

Note Off.

NoteOn 

Note On.

AfterTouchPoly 

Polyphonic AfterTouch.

ControlChange 

Control Change / Channel Mode.

ProgramChange 

Program Change.

AfterTouchChannel 

Channel (monophonic) AfterTouch.

PitchBend 

Pitch Bend.

SystemExclusive 

System Exclusive.

TimeCodeQuarterFrame 

System Common - MIDI Time Code Quarter Frame.

SongPosition 

System Common - Song Position Pointer.

SongSelect 

System Common - Song Select.

TuneRequest 

System Common - Tune Request.

Clock 

System Real Time - Timing Clock.

Start 

System Real Time - Start.

Continue 

System Real Time - Continue.

Stop 

System Real Time - Stop.

ActiveSensing 

System Real Time - Active Sensing.

SystemReset 

System Real Time - System Reset.

Definition at line 66 of file midi_Defs.h.

67 {
68  InvalidType = 0x00,
69  NoteOff = 0x80,
70  NoteOn = 0x90,
71  AfterTouchPoly = 0xA0,
72  ControlChange = 0xB0,
73  ProgramChange = 0xC0,
74  AfterTouchChannel = 0xD0,
75  PitchBend = 0xE0,
76  SystemExclusive = 0xF0,
77  TimeCodeQuarterFrame = 0xF1,
78  SongPosition = 0xF2,
79  SongSelect = 0xF3,
80  TuneRequest = 0xF6,
81  Clock = 0xF8,
82  Start = 0xFA,
83  Continue = 0xFB,
84  Stop = 0xFC,
85  ActiveSensing = 0xFE,
86  SystemReset = 0xFF,
87 };
System Real Time - System Reset.
Definition: midi_Defs.h:86
Pitch Bend.
Definition: midi_Defs.h:75
Polyphonic AfterTouch.
Definition: midi_Defs.h:71
Note Off.
Definition: midi_Defs.h:69
System Real Time - Timing Clock.
Definition: midi_Defs.h:81
Control Change / Channel Mode.
Definition: midi_Defs.h:72
System Common - MIDI Time Code Quarter Frame.
Definition: midi_Defs.h:77
System Real Time - Active Sensing.
Definition: midi_Defs.h:85
Channel (monophonic) AfterTouch.
Definition: midi_Defs.h:74
System Exclusive.
Definition: midi_Defs.h:76
For notifying errors.
Definition: midi_Defs.h:68
System Common - Song Position Pointer.
Definition: midi_Defs.h:78
System Real Time - Stop.
Definition: midi_Defs.h:84
System Real Time - Continue.
Definition: midi_Defs.h:83
Note On.
Definition: midi_Defs.h:70
System Real Time - Start.
Definition: midi_Defs.h:82
System Common - Song Select.
Definition: midi_Defs.h:79
System Common - Tune Request.
Definition: midi_Defs.h:80
Program Change.
Definition: midi_Defs.h:73

Function Documentation

enum __attribute__ ( (deprecated)  )

Deprecated: use Thru::Mode instead. Will be removed in v5.0.

Definition at line 106 of file midi_Defs.h.

107 {
108  Off = Thru::Off,
109  Full = Thru::Full,
110  SameChannel = Thru::SameChannel,
111  DifferentChannel = Thru::DifferentChannel,
112 };
Thru disabled (nothing passes through).
Definition: midi_Defs.h:96
Only the messages on the Input Channel will be sent back.
Definition: midi_Defs.h:98
All the messages but the ones on the Input Channel will be sent back.
Definition: midi_Defs.h:99
Fully enabled Thru (every incoming message is sent back).
Definition: midi_Defs.h:97