Arduino MIDI Library  Version 4.3.1
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

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

§ MIDI_CHANNEL_OFF

#define MIDI_CHANNEL_OFF   17

Definition at line 49 of file midi_Defs.h.

§ MIDI_CHANNEL_OMNI

#define MIDI_CHANNEL_OMNI   0

Definition at line 48 of file midi_Defs.h.

§ MIDI_CREATE_CUSTOM_INSTANCE

#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 235 of file midi_Defs.h.

§ MIDI_CREATE_DEFAULT_INSTANCE

#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 226 of file midi_Defs.h.

§ MIDI_CREATE_INSTANCE

#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 214 of file midi_Defs.h.

§ MIDI_LIBRARY_VERSION

#define MIDI_LIBRARY_VERSION   0x040300

Definition at line 41 of file midi_Defs.h.

§ MIDI_LIBRARY_VERSION_MAJOR

#define MIDI_LIBRARY_VERSION_MAJOR   4

Definition at line 42 of file midi_Defs.h.

§ MIDI_LIBRARY_VERSION_MINOR

#define MIDI_LIBRARY_VERSION_MINOR   3

Definition at line 43 of file midi_Defs.h.

§ MIDI_LIBRARY_VERSION_PATCH

#define MIDI_LIBRARY_VERSION_PATCH   0

Definition at line 44 of file midi_Defs.h.

§ MIDI_PITCHBEND_MAX

#define MIDI_PITCHBEND_MAX   8191

Definition at line 52 of file midi_Defs.h.

§ MIDI_PITCHBEND_MIN

#define MIDI_PITCHBEND_MIN   -8192

Definition at line 51 of file midi_Defs.h.

Typedef Documentation

§ byte

typedef uint8_t byte

Definition at line 36 of file midi_Defs.h.

§ Channel

typedef byte Channel

Definition at line 59 of file midi_Defs.h.

§ DataByte

typedef byte DataByte

Definition at line 58 of file midi_Defs.h.

§ FilterMode

typedef byte FilterMode

Definition at line 60 of file midi_Defs.h.

§ StatusByte

typedef byte StatusByte

Definition at line 57 of file midi_Defs.h.

Enumeration Type Documentation

§ MidiControlChangeNumber

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 119 of file midi_Defs.h.

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

§ MidiType

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 65 of file midi_Defs.h.

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

Function Documentation

§ __attribute__()

enum __attribute__ ( (deprecated)  )

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

Definition at line 105 of file midi_Defs.h.

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