2 Epichord - a midi sequencer
3 Copyright (C) 2008 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
29 char controller_names
[128][64] = {
41 "Expresion Controller",
46 "General Purpose Controller 1",
47 "General Purpose Controller 2",
48 "General Purpose Controller 3",
49 "General Purpose Controller 4",
63 "Modulation Wheel LSB",
64 "Breath Contoller LSB",
65 "Undefined Controller 3 LSB",
66 "Foot Controller LSB",
67 "Portamento Time LSB",
71 "Undefined Controller 9 LSB",
73 "Expresion Controller LSB",
74 "Effect Control 1 LSB",
75 "Effect Control 2 LSB",
76 "Undefined Controller 14 LSB",
77 "Undefined Controller 15 LSB",
78 "General Purpose Controller 1 LSB",
79 "General Purpose Controller 2 LSB",
80 "General Purpose Controller 3 LSB",
81 "General Purpose Controller 4 LSB",
82 "Undefined Controller 20 LSB",
83 "Undefined Controller 21 LSB",
84 "Undefined Controller 22 LSB",
85 "Undefined Controller 23 LSB",
86 "Undefined Controller 24 LSB",
87 "Undefined Controller 25 LSB",
88 "Undefined Controller 26 LSB",
89 "Undefined Controller 27 LSB",
90 "Undefined Controller 28 LSB",
91 "Undefined Controller 29 LSB",
92 "Undefined Controller 30 LSB",
93 "Undefined Controller 31 LSB",
94 "Damper Pedal (Sustain)",
100 "Sound Controller 1 (default: Sound Variation)",
101 "Sound Controller 2 (default: Timbre/Harmonic Content)",
102 "Sound Controller 3 (default: Release Time)",
103 "Sound Controller 4 (default: Attack Time)",
104 "Sound Controller 5 (default: Brightness)",
105 "Sound Controller 6",
106 "Sound Controller 7",
107 "Sound Controller 8",
108 "Sound Controller 9",
109 "Sound Controller 10",
110 "General Purpose Controller 5",
111 "General Purpose Controller 6",
112 "General Purpose Controller 7",
113 "General Purpose Controller 8",
114 "Portamento Control",
122 "Effects 2 Depth (previously Tremolo Depth)",
123 "Effects 3 Depth (previously Chorus Depth)",
124 "Effects 4 Depth (previously Detune Depth)",
125 "Effects 5 Depth (previously Phaser Depth)",
128 "Non-Registered Parameter Number LSB",
129 "Non-Registered Parameter Number LSB",
130 "Registered Parameter Number LSB",
131 "Registered Parameter Number MSB",
151 "Reset All Controllers",
160 char controller_names_short
[128][64] = {
291 char gm_names
[128][64] = {
292 "Acoustic Grand Piano",
293 "Bright Acoustic Piano",
294 "Electric Grand Piano",
316 "Acoustic Guitar (nylon)",
317 "Acoustic Guitar (steel)",
318 "Electric Guitar (jazz)",
319 "Electric Guitar (clean)",
320 "Electric Guitar (muted)",
325 "Electric Bass (finger)",
326 "Electric Bass (pick)",
374 "Lead 3 (calliope lead)",
375 "Lead 4 (chiff lead)",
379 "Lead 8 (bass + lead)",
424 //encodes data in e as a midi event placed in buf
425 int midi_encode(mevent
* e
, int chan
, unsigned char* buf
, size_t* n
){
427 buf
[0] = e
->type
| chan
;
430 //printf("%u %u %u\n",e->type,chan,e->type | chan);
448 //decodes midi data and creates a new mevent
449 int midi_decode(char* buf
, mevent
* e
){
450 e
->type
= buf
[0] & 0xf0;
453 switch(e
->type
){//messages with no third byte