-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMidi.h
139 lines (126 loc) · 3.66 KB
/
Midi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* Midi.h - constants, structs etc. concerning MIDI
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef _MIDI_H
#define _MIDI_H
#include "lmms_basics.h"
enum MidiEventTypes
{
// messages
MidiNoteOff = 0x80,
MidiNoteOn = 0x90,
MidiKeyPressure = 0xA0,
MidiControlChange = 0xB0,
MidiProgramChange = 0xC0,
MidiChannelPressure = 0xD0,
MidiPitchBend = 0xE0,
// system exclusive
MidiSysEx= 0xF0,
// system common - never in midi files
MidiTimeCode= 0xF1,
MidiSongPosition = 0xF2,
MidiSongSelect = 0xF3,
MidiTuneRequest = 0xF6,
MidiEOX= 0xF7,
// system real-time - never in midi files
MidiSync = 0xF8,
MidiTick = 0xF9,
MidiStart = 0xFA,
MidiContinue = 0xFB,
MidiStop = 0xFC,
MidiActiveSensing = 0xFE,
MidiSystemReset = 0xFF,
// meta event - for midi files only
MidiMetaEvent = 0xFF
} ;
enum MidiMetaEventTypes
{
MidiMetaInvalid = 0x00,
MidiCopyright = 0x02,
MidiTrackName = 0x03,
MidiInstName = 0x04,
MidiLyric = 0x05,
MidiMarker = 0x06,
MidiCuePoint = 0x07,
MidiPortNumber = 0x21,
MidiEOT = 0x2f,
MidiSetTempo = 0x51,
MidiSMPTEOffset = 0x54,
MidiTimeSignature = 0x58,
MidiKeySignature = 0x59,
MidiSequencerEvent = 0x7f,
MidiMetaCustom = 0x80,
MidiNotePanning
} ;
typedef MidiMetaEventTypes MidiMetaEventType;
enum MidiStandardControllers
{
MidiControllerBankSelect = 0,
MidiControllerModulationWheel = 1,
MidiControllerBreathController = 2,
MidiControllerFootController = 4,
MidiControllerPortamentoTime = 5,
MidiControllerDataEntry = 6,
MidiControllerMainVolume = 7,
MidiControllerBalance = 8,
MidiControllerPan = 10,
MidiControllerEffectControl1 = 12,
MidiControllerEffectControl2 = 13,
MidiControllerSustain = 64,
MidiControllerPortamento = 65,
MidiControllerSostenuto = 66,
MidiControllerSoftPedal = 67,
MidiControllerLegatoFootswitch = 68,
MidiControllerRegisteredParameterNumberLSB = 100,
MidiControllerRegisteredParameterNumberMSB = 101,
// Channel Mode Messages are controllers too...
MidiControllerAllSoundOff = 120,
MidiControllerResetAllControllers = 121,
MidiControllerLocalControl = 122,
MidiControllerAllNotesOff = 123,
MidiControllerOmniOn = 124,
MidiControllerOmniOff = 125,
MidiControllerMonoOn = 126,
MidiControllerPolyOn = 127,
};
enum MidiControllerRegisteredParameterNumbers
{
MidiPitchBendSensitivityRPN = 0x0000,
MidiChannelFineTuningRPN = 0x0001,
MidiChannelCoarseTuningRPN = 0x0002,
MidiTuningProgramChangeRPN = 0x0003,
MidiTuningBankSelectRPN = 0x0004,
MidiModulationDepthRangeRPN = 0x0005,
MidiNullFunctionNumberRPN = 0x7F7F
};
const int MidiChannelCount = 16;
const int MidiControllerCount = 128;
const int MidiProgramCount = 128;
const int MidiMaxVelocity = 127;
const int MidiMaxControllerValue = 127;
const int MidiMaxNote = 127;
const int MidiMaxPanning = 127;
const int MidiMinPanning = -128;
const int MidiMinPitchBend = 0;
const int MidiMaxPitchBend = 16383;
#endif