-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconverter.cpp
More file actions
175 lines (169 loc) · 6.46 KB
/
converter.cpp
File metadata and controls
175 lines (169 loc) · 6.46 KB
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
#include "converter.h"
#include <QStringList>
Converter::Converter() {
}
QString Converter::EventTypeToString(EventType et) {
switch (et) {
case sequence_no:
return "Sequence number";
break;
case text:
return "Text";
break;
case copy_not:
return "Copyright notice";
break;
case inst_name:
return "Instrument name";
break;
case text_lyric:
return "Lyric";
break;
case text_mark:
return "Text mark";
break;
case cue_point:
return "Cue point";
break;
case chan_prefix:
return "Channel prefix";
break;
case eot:
return "End of track";
break;
case set_tempo:
return "Set tempo";
break;
case smpte_offset:
return "SMPTE offset";
break;
case time_sig:
return "Time signature";
break;
case key_sig:
return "Key signature";
break;
case seq_spec:
return "Sequencer specific";
break;
case seq_name:
return "Sequencer name";
break;
case note_off:
return "Note off";
break;
case note_on:
return "Note on";
break;
case poly_key:
return "Polyphonic key pressure";
break;
case cnt_change:
return "Control change";
break;
case pgm_change:
return "Program change";
break;
case chan_press:
return "Channel pressure";
break;
case pw_change:
return "Pitch wheel change";
break;
case sys_ex:
return "System exclusive";
break;
case song_ptr:
return "Song pointer";
break;
case song_sel:
return "Song select";
break;
case tune_req:
return "Tune request";
break;
case eoe:
return "End of exclusive";
break;
case tim_clk:
return "Time click";
break;
case start:
return "Start";
break;
case cont:
return "Continue";
break;
case stop:
return "Stop";
break;
case act_sens:
return "Active sense";
break;
case rst:
return "Reset";
break;
case port_sel:
return "Port select";
break;
default:
break;
}
return "";
}
QString Converter::NoteToString(uchar note) {
QStringList noteVals = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
return noteVals[note];
}
QString Converter::ControllerToString(uchar id) {
QStringList ControllerVals1 = { "Bank Select", "Modulation Wheel", "Breath controller", "Undefined", "Foot Pedal",
"Portamento Time", "Data Entry", "Volume", "Balance", "Undefined", "Pan position",
"Expression", "Effect Control 1", "Effect Control 2", "Undefined", "Undefined",
"Ribbon Controller or General Purpose Slider 1", "Knob 1 or General Purpose Slider 2",
"General Purpose Slider 3", "Knob 2 General Purpose Slider 4", "Knob 3 or Undefined",
"Knob 4 or Undefined", "Undefined", "Undefined", "Undefined", "Undefined", "Undefined",
"Undefined", "Undefined", "Undefined", "Undefined", "Undefined" };
QStringList ControllerVals2 = { "Hold Pedal (on/off)", "Portamento (on/off)", "Sustenuto Pedal (on/off)", "Soft Pedal (on/off)",
"Legato Pedal (on/off)", "Hold 2 Pedal (on/off)", "Sound Variation", "Resonance (aka Timbre)",
"Sound Release Time", "Sound Attack Time", "Frequency Cutoff", "Sound Control 6", "Sound Control 7",
"Sound Control 8", "Sound Control 9", "Sound Control 10", "Decay or General Purpose Button 1",
"Hi Pass Filter Frequency or General Purpose Button 2", "General Purpose Button 3",
"General Purpose Button 4", "Portamento", "Undefined", "Undefined", "Undefined", "Undefined",
"Undefined", "Undefined", "Reverb Level", "Tremolo Level", "Chorus Level",
"Celeste Level or Detune", "Phaser Level", "Data Button increment", "Data Button decrement",
"Non-registered Parameter (LSB)", "Non-registered Parameter (MSB)", "Registered Parameter (LSB)",
"Registered Parameter (MSB)", "Undefined", "Undefined", "Undefined", "Undefined",
"Undefined", "Undefined", "Undefined", "Undefined", "Undefined", "Undefined",
"Undefined", "Undefined", "Undefined", "Undefined", "Undefined", "Undefined",
"Undefined", "Undefined", "All Sound Off", "All Controllers Off", "Local Keyboard (on/off)",
"All Notes Off", "Omni Mode Off", "Omni Mode On", "Mono Operation", "Poly Operation",
"Poly mode on"};
if(id < 32) return ControllerVals1[id] + " (MSB)";
if(id < 64) return ControllerVals1[id - 32] + " (LSB)";
return ControllerVals2[id - 64];
}
QString Converter::ProgramChangeToString(uchar id) {
QStringList ProgramVals = { "Acoustic Grand", "Bright Acoustic", "Electric Grand", "Honky-Tonk", "Electric Piano 1", "Electric Piano 2",
"Harpsichord", "Clavinet", "elesta", "Glockenspiel", "Music Box", "Vibraphone",
"Marimba", "Xylophone", "Tubular Bells", "Dulcimer", "Drawbar Organ", "Percussive Organ",
"Rock Organ", "Church Organ", "Reed Organ", "Accordion", "Harmonica", "Tango Accordian",
"Acoustic Guitar(nylon)", "Acoustic Guitar(steel)", "Electric Guitar(jazz)", "Electric Guitar(clean)", "Electric Guitar(muted)", "Overdriven Guitar",
"Distortion Guitar", "Guitar Harmonics", "Acoustic Bass", "Electric Bass (finger)", "Electric Bass (pick)", "Fretless Bass",
"Slap Bass 1", "Slap Bass 2", "Synth Bass 1", "Synth Bass 2", "Violin", "Viola",
"Cello", "Contrabass", "Tremolo Strings", "Pizzicato Strings", "Orchestral Strings", "Timpani",
"String Ensemble 1", "String Ensemble 2", "SynthStrings 1", "SynthStrings 2", "Choir Aahs", "Voice Oohs",
"Synth Voice", "Orchestra Hit", "Trumpet", "Trombone", "Tuba", "Muted Trumpet",
"French Horn", "Brass Section", "SynthBrass 1", "SynthBrass 2", "Soprano Sax", "Alto Sax",
"Tenor Sax", "Baritone Sax", "Oboe", "English Horn", "Bassoon", "Clarinet",
"Piccolo", "Flute", "Recorder", "Pan Flute", "Blown Bottle", "Skakuhachi",
"Whistle", "Ocarina", "Lead 1 (square)", "Lead 2 (sawtooth)", "Lead 3 (calliope)", "Lead 4 (chiff)",
"Lead 5 (charang)", "Lead 6 (voice)", "Lead 7 (fifths)", "Lead 8 (bass+lead)", "Pad 1 (new age)", "Pad 2 (warm)",
"Pad 3 (polysynth)", "Pad 4 (choir)", "Pad 5 (bowed)", "Pad 6 (metallic)", "Pad 7 (halo)", "Pad 8 (sweep)",
"FX 1 (rain)", "FX 2 (soundtrack)", "FX 3 (crystal)", "FX 4 (atmosphere)", "FX 5 (brightness)", "FX 6 (goblins)",
"FX 7 (echoes)", "FX 8 (sci-fi)", "Sitar", "Banjo", "Shamisen", "Koto",
"Kalimba", "Bagpipe", "Fiddle", "Shanai", "Tinkle Bell", "Agogo",
"Steel Drums", "Woodblock", "Taiko Drum", "Melodic Tom", "Synth Drum", "Reverse Cymbal",
"Guitar Fret Noise", "Breath Noise", "Seashore", "Bird Tweet", "Telephone Ring", "Helicopter",
"Applause", "Gunshot" };
return ProgramVals[id];
}