-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
219 lines (211 loc) · 7.89 KB
/
index.js
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
let drums = {
27: "High Q (GM2)",
28: "Slap (GM2)",
29: "Scratch Push (GM2)",
30: "Scratch Pull (GM2)",
31: "Sticks (GM2)",
32: "Square Click (GM2)",
33: "Metronome Click (GM2)",
34: "Metronome Bell (GM2)",
35: "Bass Drum 2",
36: "Bass Drum 1",
37: "Side Stick",
38: "Snare Drum 1",
39: "Hand Clap",
40: "Snare Drum 2",
41: "Low Tom 2",
42: "Closed Hi-hat",
43: "Low Tom 1",
44: "Pedal Hi-hat",
45: "Mid Tom 2",
46: "Open Hi-hat",
47: "Mid Tom 1",
48: "High Tom 2",
49: "Crash Cymbal 1",
50: "High Tom 1",
51: "Ride Cymbal 1",
52: "Chinese Cymbal",
53: "Ride Bell",
54: "Tambourine",
55: "Splash Cymbal",
56: "Cowbell",
57: "Crash Cymbal 2",
58: "Vibra Slap",
59: "Ride Cymbal 2",
60: "High Bongo",
61: "Low Bongo",
62: "Mute High Conga",
63: "Open High Conga",
64: "Low Conga",
65: "High Timbale",
66: "Low Timbale",
67: "High Agogo",
68: "Low Agogo",
69: "Cabasa",
70: "Maracas",
71: "Short Whistle",
72: "Long Whistle",
73: "Short Guiro",
74: "Long Guiro",
75: "Claves",
76: "High Wood Block",
77: "Low Wood Block",
78: "Mute Cuica",
79: "Open Cuica",
80: "Mute Triangle",
81: "Open Triangle",
82: "Shaker (GM2)",
83: "Jingle Bell (GM2)",
84: "Belltree (GM2)",
85: "Castanets (GM2)",
86: "Mute Surdo (GM2)",
87: "Open Surdo (GM2)",
};
let midi = {
0:{"name":"Acoustic Grand Piano","group":"Piano"},
1:{"name":"Bright Acoustic Piano","group":"Piano"},
2:{"name":"Electric Grand Piano","group":"Piano"},
3:{"name":"Honky-tonk Piano","group":"Piano"},
4:{"name":"Electric Piano 1","group":"Piano"},
5:{"name":"Electric Piano 2","group":"Piano"},
6:{"name":"Harpsichord","group":"Piano"},
7:{"name":"Clavinet","group":"Piano"},
8:{"name":"Celesta","group":"Chromatic Percussion"},
9:{"name":"Glockenspiel","group":"Chromatic Percussion"},
10:{"name":"Music Box","group":"Chromatic Percussion"},
11:{"name":"Vibraphone","group":"Chromatic Percussion"},
12:{"name":"Marimba","group":"Chromatic Percussion"},
13:{"name":"Xylophone","group":"Chromatic Percussion"},
14:{"name":"Tubular Bells","group":"Chromatic Percussion"},
15:{"name":"Dulcimer","group":"Chromatic Percussion"},
16:{"name":"Drawbar Organ","group":"Organ"},
17:{"name":"Percussive Organ","group":"Organ"},
18:{"name":"Rock Organ","group":"Organ"},
19:{"name":"Church Organ","group":"Organ"},
20:{"name":"Reed Organ","group":"Organ"},
21:{"name":"Accordion","group":"Organ"},
22:{"name":"Harmonica","group":"Organ"},
23:{"name":"Tango Accordion","group":"Organ"},
24:{"name":"Acoustic Guitar (nylon)","group":"Guitar"},
25:{"name":"Acoustic Guitar (steel)","group":"Guitar"},
26:{"name":"Electric Guitar (jazz)","group":"Guitar"},
27:{"name":"Electric Guitar (clean)","group":"Guitar"},
28:{"name":"Electric Guitar (muted)","group":"Guitar"},
29:{"name":"Overdriven Guitar","group":"Guitar"},
30:{"name":"Distortion Guitar","group":"Guitar"},
31:{"name":"Guitar Harmonics","group":"Guitar"},
32:{"name":"Acoustic Bass","group":"Bass"},
33:{"name":"Electric Bass (finger)","group":"Bass"},
34:{"name":"Electric Bass (pick)","group":"Bass"},
35:{"name":"Fretless Bass","group":"Bass"},
36:{"name":"Slap Bass 1","group":"Bass"},
37:{"name":"Slap Bass 2","group":"Bass"},
38:{"name":"Synth Bass 1","group":"Bass"},
39:{"name":"Synth Bass 2","group":"Bass"},
40:{"name":"Violin","group":"Strings"},
41:{"name":"Viola","group":"Strings"},
42:{"name":"Cello","group":"Strings"},
43:{"name":"Contrabass","group":"Strings"},
44:{"name":"Tremolo Strings","group":"Strings"},
45:{"name":"Pizzicato Strings","group":"Strings"},
46:{"name":"Orchestral Harp","group":"Strings"},
47:{"name":"Timpani","group":"Strings"},
48:{"name":"String Ensemble 1","group":"Ensemble"},
49:{"name":"String Ensemble 2","group":"Ensemble"},
50:{"name":"Synth Strings 1","group":"Ensemble"},
51:{"name":"Synth Strings 2","group":"Ensemble"},
52:{"name":"Choir Aahs","group":"Ensemble"},
53:{"name":"Voice Oohs","group":"Ensemble"},
54:{"name":"Synth Choir","group":"Ensemble"},
55:{"name":"Orchestra Hit","group":"Ensemble"},
56:{"name":"Trumpet","group":"Brass"},
57:{"name":"Trombone","group":"Brass"},
58:{"name":"Tuba","group":"Brass"},
59:{"name":"Muted Trumpet","group":"Brass"},
60:{"name":"French Horn","group":"Brass"},
61:{"name":"Brass Section","group":"Brass"},
62:{"name":"Synth Brass 1","group":"Brass"},
63:{"name":"Synth Brass 2","group":"Brass"},
64:{"name":"Soprano Sax","group":"Reed"},
65:{"name":"Alto Sax","group":"Reed"},
66:{"name":"Tenor Sax","group":"Reed"},
67:{"name":"Baritone Sax","group":"Reed"},
68:{"name":"Oboe","group":"Reed"},
69:{"name":"English Horn","group":"Reed"},
70:{"name":"Bassoon","group":"Reed"},
71:{"name":"Clarinet","group":"Reed"},
72:{"name":"Piccolo","group":"Pipe"},
73:{"name":"Flute","group":"Pipe"},
74:{"name":"Recorder","group":"Pipe"},
75:{"name":"Pan Flute","group":"Pipe"},
76:{"name":"Blown bottle","group":"Pipe"},
77:{"name":"Shakuhachi","group":"Pipe"},
78:{"name":"Whistle","group":"Pipe"},
79:{"name":"Ocarina","group":"Pipe"},
80:{"name":"Lead 1 (square)","group":"Synth Lead"},
81:{"name":"Lead 2 (sawtooth)","group":"Synth Lead"},
82:{"name":"Lead 3 (calliope)","group":"Synth Lead"},
83:{"name":"Lead 4 (chiff)","group":"Synth Lead"},
84:{"name":"Lead 5 (charang)","group":"Synth Lead"},
85:{"name":"Lead 6 (voice)","group":"Synth Lead"},
86:{"name":"Lead 7 (fifths)","group":"Synth Lead"},
87:{"name":"Lead 8 (bass + lead)","group":"Synth Lead"},
88:{"name":"Pad 1 (new age)","group":"Synth Pad"},
89:{"name":"Pad 2 (warm)","group":"Synth Pad"},
90:{"name":"Pad 3 (polysynth)","group":"Synth Pad"},
91:{"name":"Pad 4 (choir)","group":"Synth Pad"},
92:{"name":"Pad 5 (bowed)","group":"Synth Pad"},
93:{"name":"Pad 6 (metallic)","group":"Synth Pad"},
94:{"name":"Pad 7 (halo)","group":"Synth Pad"},
95:{"name":"Pad 8 (sweep)","group":"Synth Pad"},
96:{"name":"FX 1 (rain)","group":"Synth Effects"},
97:{"name":"FX 2 (soundtrack)","group":"Synth Effects"},
98:{"name":"FX 3 (crystal)","group":"Synth Effects"},
99:{"name":"FX 4 (atmosphere)","group":"Synth Effects"},
100:{"name":"FX 5 (brightness)","group":"Synth Effects"},
101:{"name":"FX 6 (goblins)","group":"Synth Effects"},
102:{"name":"FX 7 (echoes)","group":"Synth Effects"},
103:{"name":"FX 8 (sci-fi)","group":"Synth Effects"},
104:{"name":"Sitar","group":"Ethnic"},
105:{"name":"Banjo","group":"Ethnic"},
106:{"name":"Shamisen","group":"Ethnic"},
107:{"name":"Koto","group":"Ethnic"},
108:{"name":"Kalimba","group":"Ethnic"},
109:{"name":"Bagpipe","group":"Ethnic"},
110:{"name":"Fiddle","group":"Ethnic"},
111:{"name":"Shanai","group":"Ethnic"},
112:{"name":"Tinkle Bell","group":"Percussive"},
113:{"name":"Agogo","group":"Percussive"},
114:{"name":"Steel Drums","group":"Percussive"},
115:{"name":"Woodblock","group":"Percussive"},
116:{"name":"Taiko Drum","group":"Percussive"},
117:{"name":"Melodic Tom","group":"Percussive"},
118:{"name":"Synth Drum","group":"Percussive"},
119:{"name":"Reverse Cymbal","group":"Percussive"},
120:{"name":"Guitar Fret Noise","group":"Sound effects"},
121:{"name":"Breath Noise","group":"Sound effects"},
122:{"name":"Seashore","group":"Sound effects"},
123:{"name":"Bird Tweet","group":"Sound effects"},
124:{"name":"Telephone Ring","group":"Sound effects"},
125:{"name":"Helicopter","group":"Sound effects"},
126:{"name":"Applause","group":"Sound effects"},
127:{"name":"Gunshot","group":"Sound effects"}
};
module.exports = {
instrument: function(note) {
let data = midi[note];
if(data) {
return data;
} else {
return new Error('Bad fucking midi instrument id supplied');
}
},
drum: function(note) {
let data = drums[note];
if(data) {
return data;
} else {
return new Error('Fucking invalid drum note number supplied');
}
}
}