30
30
static void addController(MPEventList* l, int tick, int port, int channel, int a, int b)
32
if (a < 0x1000) { // 7 Bit Controller
33
//if (a < 0x1000) { // 7 Bit Controller
34
if (a < CTRL_14_OFFSET) { // 7 Bit Controller
33
35
l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, a, b));
35
else if (a < 0x20000) { // 14 Bit Controller
37
//else if (a < 0x20000) { // 14 Bit Controller
38
else if (a < CTRL_RPN_OFFSET) { // 14 Bit Controller
36
39
int ctrlH = (a >> 8) & 0x7f;
37
40
int ctrlL = a & 0x7f;
38
41
int dataH = (b >> 7) & 0x7f;
40
43
l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, ctrlH, dataH));
41
44
l->add(MidiPlayEvent(tick+1, port, channel, ME_CONTROLLER, ctrlL, dataL));
43
else if (a < 0x30000) { // RPN 7-Bit Controller
46
//else if (a < 0x30000) { // RPN 7-Bit Controller
47
else if (a < CTRL_NRPN_OFFSET) { // RPN 7-Bit Controller
44
48
int ctrlH = (a >> 8) & 0x7f;
45
49
int ctrlL = a & 0x7f;
46
50
l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, CTRL_HRPN, ctrlH));
47
51
l->add(MidiPlayEvent(tick+1, port, channel, ME_CONTROLLER, CTRL_LRPN, ctrlL));
48
52
l->add(MidiPlayEvent(tick+2, port, channel, ME_CONTROLLER, CTRL_HDATA, b));
50
else if (a < 0x40000) { // NRPN 7-Bit Controller
54
//else if (a < 0x40000) { // NRPN 7-Bit Controller
55
else if (a < CTRL_INTERNAL_OFFSET) { // NRPN 7-Bit Controller
51
56
int ctrlH = (a >> 8) & 0x7f;
52
57
int ctrlL = a & 0x7f;
53
58
l->add(MidiPlayEvent(tick, port, channel, ME_CONTROLLER, CTRL_HNRPN, ctrlH));
83
88
l->add(MidiPlayEvent(tick+tickoffset, port, channel, ME_PROGRAM, pr, 0));
85
else if (a < 0x60000) { // RPN14 Controller
90
//else if (a < 0x60000) { // RPN14 Controller
91
else if (a < CTRL_NRPN14_OFFSET) { // RPN14 Controller
86
92
int ctrlH = (a >> 8) & 0x7f;
87
93
int ctrlL = a & 0x7f;
88
94
int dataH = (b >> 7) & 0x7f;
92
98
l->add(MidiPlayEvent(tick+2, port, channel, ME_CONTROLLER, CTRL_HDATA, dataH));
93
99
l->add(MidiPlayEvent(tick+3, port, channel, ME_CONTROLLER, CTRL_LDATA, dataL));
95
else if (a < 0x70000) { // NRPN14 Controller
101
//else if (a < 0x70000) { // NRPN14 Controller
102
else if (a < CTRL_NONE_OFFSET) { // NRPN14 Controller
96
103
int ctrlH = (a >> 8) & 0x7f;
97
104
int ctrlL = a & 0x7f;
98
105
int dataH = (b >> 7) & 0x7f;
113
120
MFile file(QString("midis"), QString(".mid"));
115
FILE* fp = file.open("w", midi_file_pattern, this, false, true,
122
//FILE* fp = file.open("w", midi_file_pattern, this, false, true,
123
FILE* fp = file.open("w", midi_file_save_pattern, this, false, true,
116
124
tr("MusE: Export Midi"));