MIDIInstrumentPAD

Dependencies:   mbed DISCO_F746NG_USBDevice

Committer:
60010649
Date:
Tue May 14 15:59:23 2019 +0000
Revision:
0:33a7ad2adf6c
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
60010649 0:33a7ad2adf6c 1 #include "mbed.h"
60010649 0:33a7ad2adf6c 2 #include "TS_DISCO_F746NG.h"
60010649 0:33a7ad2adf6c 3 #include "LCD_DISCO_F746NG.h"
60010649 0:33a7ad2adf6c 4 #include "USBMIDI.h"
60010649 0:33a7ad2adf6c 5
60010649 0:33a7ad2adf6c 6 #define FastSpeedInterface 0
60010649 0:33a7ad2adf6c 7 #define HighSpeedInterface 1
60010649 0:33a7ad2adf6c 8 AnalogIn v(A0);
60010649 0:33a7ad2adf6c 9 LCD_DISCO_F746NG lcd;
60010649 0:33a7ad2adf6c 10 TS_DISCO_F746NG ts;
60010649 0:33a7ad2adf6c 11 Serial pc(USBTX, USBRX);
60010649 0:33a7ad2adf6c 12 USBMIDI midi(FastSpeedInterface);
60010649 0:33a7ad2adf6c 13 int a0=0;
60010649 0:33a7ad2adf6c 14
60010649 0:33a7ad2adf6c 15
60010649 0:33a7ad2adf6c 16 int Y1=60;
60010649 0:33a7ad2adf6c 17 int Yline1=131.66;
60010649 0:33a7ad2adf6c 18 int Yline2=201.33;
60010649 0:33a7ad2adf6c 19 int Ysize=70.66;
60010649 0:33a7ad2adf6c 20 int o=0;
60010649 0:33a7ad2adf6c 21 int k=12;
60010649 0:33a7ad2adf6c 22
60010649 0:33a7ad2adf6c 23
60010649 0:33a7ad2adf6c 24
60010649 0:33a7ad2adf6c 25
60010649 0:33a7ad2adf6c 26
60010649 0:33a7ad2adf6c 27 int main()
60010649 0:33a7ad2adf6c 28 {
60010649 0:33a7ad2adf6c 29
60010649 0:33a7ad2adf6c 30 top:
60010649 0:33a7ad2adf6c 31 int a,b,c=0;
60010649 0:33a7ad2adf6c 32 TS_StateTypeDef TS_State;
60010649 0:33a7ad2adf6c 33 lcd.SetFont(&Font24);
60010649 0:33a7ad2adf6c 34 lcd.Clear(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 35 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 36 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 37 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"SELECT",CENTER_MODE);
60010649 0:33a7ad2adf6c 38
60010649 0:33a7ad2adf6c 39
60010649 0:33a7ad2adf6c 40
60010649 0:33a7ad2adf6c 41 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block1
60010649 0:33a7ad2adf6c 42 lcd.FillRect(0,Y1,159,212);
60010649 0:33a7ad2adf6c 43 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 44 lcd.SetBackColor(LCD_COLOR_TRANSPARENT);
60010649 0:33a7ad2adf6c 45 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" DRUM",LEFT_MODE);
60010649 0:33a7ad2adf6c 46
60010649 0:33a7ad2adf6c 47 lcd.SetTextColor(LCD_COLOR_WHITE); //////Block2
60010649 0:33a7ad2adf6c 48 lcd.FillRect(160,Y1,159,212);
60010649 0:33a7ad2adf6c 49 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 50 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 51 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"GUITAR",CENTER_MODE);
60010649 0:33a7ad2adf6c 52
60010649 0:33a7ad2adf6c 53
60010649 0:33a7ad2adf6c 54 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block3
60010649 0:33a7ad2adf6c 55 lcd.FillRect(320,Y1,159,212);
60010649 0:33a7ad2adf6c 56 lcd.SetBackColor(LCD_COLOR_TRANSPARENT);
60010649 0:33a7ad2adf6c 57 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 58 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"PIANO ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 59
60010649 0:33a7ad2adf6c 60 wait(1);
60010649 0:33a7ad2adf6c 61
60010649 0:33a7ad2adf6c 62 while(1) {
60010649 0:33a7ad2adf6c 63 ts.GetState(&TS_State);
60010649 0:33a7ad2adf6c 64
60010649 0:33a7ad2adf6c 65 if((TS_State.touchDetected))
60010649 0:33a7ad2adf6c 66 {
60010649 0:33a7ad2adf6c 67 if(TS_State.touchX[0] >= 0&&TS_State.touchX[0]<160&&a==0&&b==0&&c==0)
60010649 0:33a7ad2adf6c 68 {
60010649 0:33a7ad2adf6c 69
60010649 0:33a7ad2adf6c 70
60010649 0:33a7ad2adf6c 71 lcd.Clear(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 72 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 73
60010649 0:33a7ad2adf6c 74
60010649 0:33a7ad2adf6c 75
60010649 0:33a7ad2adf6c 76 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 77 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 78 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"DRUM",CENTER_MODE);
60010649 0:33a7ad2adf6c 79
60010649 0:33a7ad2adf6c 80
60010649 0:33a7ad2adf6c 81
60010649 0:33a7ad2adf6c 82 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block1
60010649 0:33a7ad2adf6c 83 lcd.FillRect(0,60,140,Ysize);
60010649 0:33a7ad2adf6c 84
60010649 0:33a7ad2adf6c 85 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 86 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 87 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)" Crash",LEFT_MODE);
60010649 0:33a7ad2adf6c 88
60010649 0:33a7ad2adf6c 89 lcd.SetTextColor(LCD_COLOR_BLACK); //////Block2
60010649 0:33a7ad2adf6c 90 lcd.FillRect(140,60,140,Ysize);
60010649 0:33a7ad2adf6c 91
60010649 0:33a7ad2adf6c 92 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 93 lcd.SetBackColor(LCD_COLOR_TRANSPARENT);
60010649 0:33a7ad2adf6c 94 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"Tom1 ",CENTER_MODE);
60010649 0:33a7ad2adf6c 95
60010649 0:33a7ad2adf6c 96
60010649 0:33a7ad2adf6c 97 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block3
60010649 0:33a7ad2adf6c 98 lcd.FillRect(280,60,140,Ysize);
60010649 0:33a7ad2adf6c 99
60010649 0:33a7ad2adf6c 100 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 101 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 102 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"Tom2 ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 103
60010649 0:33a7ad2adf6c 104 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block4
60010649 0:33a7ad2adf6c 105 lcd.FillRect(0,Yline1,140,Ysize);
60010649 0:33a7ad2adf6c 106
60010649 0:33a7ad2adf6c 107 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 108 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 109 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" HHOpen",LEFT_MODE);
60010649 0:33a7ad2adf6c 110
60010649 0:33a7ad2adf6c 111 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block5
60010649 0:33a7ad2adf6c 112 lcd.FillRect(140,Yline1,140,Ysize);
60010649 0:33a7ad2adf6c 113
60010649 0:33a7ad2adf6c 114
60010649 0:33a7ad2adf6c 115 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 116 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 117 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"Snare ",CENTER_MODE);
60010649 0:33a7ad2adf6c 118
60010649 0:33a7ad2adf6c 119
60010649 0:33a7ad2adf6c 120 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block6
60010649 0:33a7ad2adf6c 121 lcd.FillRect(280,Yline1,140,Ysize);
60010649 0:33a7ad2adf6c 122
60010649 0:33a7ad2adf6c 123
60010649 0:33a7ad2adf6c 124
60010649 0:33a7ad2adf6c 125
60010649 0:33a7ad2adf6c 126 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 127 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 128 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"Tom3 ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 129
60010649 0:33a7ad2adf6c 130 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block7
60010649 0:33a7ad2adf6c 131 lcd.FillRect(0,Yline2,140,Ysize);
60010649 0:33a7ad2adf6c 132
60010649 0:33a7ad2adf6c 133
60010649 0:33a7ad2adf6c 134 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 135 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 136 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)" HHClose",LEFT_MODE);
60010649 0:33a7ad2adf6c 137
60010649 0:33a7ad2adf6c 138 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block8
60010649 0:33a7ad2adf6c 139 lcd.FillRect(140,Yline2,140,Ysize);
60010649 0:33a7ad2adf6c 140
60010649 0:33a7ad2adf6c 141
60010649 0:33a7ad2adf6c 142 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 143 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 144 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"Kick ",CENTER_MODE);
60010649 0:33a7ad2adf6c 145
60010649 0:33a7ad2adf6c 146 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block9
60010649 0:33a7ad2adf6c 147 lcd.FillRect(280,Yline2,140,Ysize);
60010649 0:33a7ad2adf6c 148
60010649 0:33a7ad2adf6c 149
60010649 0:33a7ad2adf6c 150 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 151 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 152 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"Clap ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 153
60010649 0:33a7ad2adf6c 154
60010649 0:33a7ad2adf6c 155 lcd.SetTextColor(LCD_COLOR_BROWN); ///BlockLeftBackToMain
60010649 0:33a7ad2adf6c 156 lcd.FillRect(420,Y1,60,212);
60010649 0:33a7ad2adf6c 157 lcd.SetBackColor(LCD_COLOR_BROWN);
60010649 0:33a7ad2adf6c 158 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 159 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"B ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 160 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"A ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 161 lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"C ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 162 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"K ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 163
60010649 0:33a7ad2adf6c 164
60010649 0:33a7ad2adf6c 165
60010649 0:33a7ad2adf6c 166 a=1;
60010649 0:33a7ad2adf6c 167 }
60010649 0:33a7ad2adf6c 168 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<140&&TS_State.touchY[0] >= 60&&TS_State.touchY[0]<Yline1)
60010649 0:33a7ad2adf6c 169 {
60010649 0:33a7ad2adf6c 170 pc.printf("a");
60010649 0:33a7ad2adf6c 171 midi.write(MIDIMessage::NoteOn(48));
60010649 0:33a7ad2adf6c 172 wait_ms(50);
60010649 0:33a7ad2adf6c 173 midi.write(MIDIMessage::NoteOff(48));
60010649 0:33a7ad2adf6c 174
60010649 0:33a7ad2adf6c 175
60010649 0:33a7ad2adf6c 176 }
60010649 0:33a7ad2adf6c 177 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 140&&TS_State.touchX[0]<280&&TS_State.touchY[0] >= Y1&&TS_State.touchY[0]<Yline1)
60010649 0:33a7ad2adf6c 178 {
60010649 0:33a7ad2adf6c 179 pc.printf("b");
60010649 0:33a7ad2adf6c 180 midi.write(MIDIMessage::NoteOn(49));
60010649 0:33a7ad2adf6c 181 wait_ms(50);
60010649 0:33a7ad2adf6c 182 midi.write(MIDIMessage::NoteOff(49));
60010649 0:33a7ad2adf6c 183
60010649 0:33a7ad2adf6c 184 }
60010649 0:33a7ad2adf6c 185 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 280&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= Y1&&TS_State.touchY[0]<Yline1)
60010649 0:33a7ad2adf6c 186 {
60010649 0:33a7ad2adf6c 187 pc.printf("c");
60010649 0:33a7ad2adf6c 188 midi.write(MIDIMessage::NoteOn(50));
60010649 0:33a7ad2adf6c 189 wait_ms(50);
60010649 0:33a7ad2adf6c 190 midi.write(MIDIMessage::NoteOff(50));
60010649 0:33a7ad2adf6c 191 }
60010649 0:33a7ad2adf6c 192
60010649 0:33a7ad2adf6c 193 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<140&&TS_State.touchY[0] >= Yline1&&TS_State.touchY[0]<Yline2)
60010649 0:33a7ad2adf6c 194 {
60010649 0:33a7ad2adf6c 195 pc.printf("d");
60010649 0:33a7ad2adf6c 196 midi.write(MIDIMessage::NoteOn(51));
60010649 0:33a7ad2adf6c 197 wait_ms(50);
60010649 0:33a7ad2adf6c 198 midi.write(MIDIMessage::NoteOff(51));
60010649 0:33a7ad2adf6c 199 }
60010649 0:33a7ad2adf6c 200 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 140&&TS_State.touchX[0]<280&&TS_State.touchY[0] >= Yline1&&TS_State.touchY[0]<Yline2)
60010649 0:33a7ad2adf6c 201 {
60010649 0:33a7ad2adf6c 202 pc.printf("e");
60010649 0:33a7ad2adf6c 203 midi.write(MIDIMessage::NoteOn(52));
60010649 0:33a7ad2adf6c 204 wait_ms(50);
60010649 0:33a7ad2adf6c 205 midi.write(MIDIMessage::NoteOff(52));
60010649 0:33a7ad2adf6c 206 }
60010649 0:33a7ad2adf6c 207 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 280&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= Yline1&&TS_State.touchY[0]<Yline2)
60010649 0:33a7ad2adf6c 208 {
60010649 0:33a7ad2adf6c 209 pc.printf("f");
60010649 0:33a7ad2adf6c 210 midi.write(MIDIMessage::NoteOn(53));
60010649 0:33a7ad2adf6c 211 wait_ms(50);
60010649 0:33a7ad2adf6c 212 midi.write(MIDIMessage::NoteOff(53));
60010649 0:33a7ad2adf6c 213 }
60010649 0:33a7ad2adf6c 214
60010649 0:33a7ad2adf6c 215 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<140&&TS_State.touchY[0] >= Yline2)
60010649 0:33a7ad2adf6c 216 {
60010649 0:33a7ad2adf6c 217 midi.write(MIDIMessage::NoteOn(54));
60010649 0:33a7ad2adf6c 218 wait_ms(50);
60010649 0:33a7ad2adf6c 219 midi.write(MIDIMessage::NoteOff(54));
60010649 0:33a7ad2adf6c 220
60010649 0:33a7ad2adf6c 221 }
60010649 0:33a7ad2adf6c 222 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 140&&TS_State.touchX[0]<280&&TS_State.touchY[0] >= Yline2)
60010649 0:33a7ad2adf6c 223 {
60010649 0:33a7ad2adf6c 224 pc.printf("h");
60010649 0:33a7ad2adf6c 225 midi.write(MIDIMessage::NoteOn(57));
60010649 0:33a7ad2adf6c 226 wait_ms(50);
60010649 0:33a7ad2adf6c 227 midi.write(MIDIMessage::NoteOff(57));
60010649 0:33a7ad2adf6c 228
60010649 0:33a7ad2adf6c 229
60010649 0:33a7ad2adf6c 230 }
60010649 0:33a7ad2adf6c 231 else if(a==1&&b==0&&c==0&&TS_State.touchX[0] >= 280&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= Yline2)
60010649 0:33a7ad2adf6c 232 {
60010649 0:33a7ad2adf6c 233 pc.printf("i");
60010649 0:33a7ad2adf6c 234 midi.write(MIDIMessage::NoteOn(56));
60010649 0:33a7ad2adf6c 235 wait_ms(50);
60010649 0:33a7ad2adf6c 236 midi.write(MIDIMessage::NoteOff(56));
60010649 0:33a7ad2adf6c 237 }
60010649 0:33a7ad2adf6c 238 else if(TS_State.touchX[0] >= 420&&TS_State.touchY[0] >60&&a==1&&b==0&&c==0)
60010649 0:33a7ad2adf6c 239 {
60010649 0:33a7ad2adf6c 240 a = 0;
60010649 0:33a7ad2adf6c 241 pc.printf("bye");
60010649 0:33a7ad2adf6c 242 goto top;
60010649 0:33a7ad2adf6c 243 }
60010649 0:33a7ad2adf6c 244
60010649 0:33a7ad2adf6c 245 else if(TS_State.touchX[0] >= 160&&TS_State.touchX[0]<320&&a==0&&b==0&&c==0)
60010649 0:33a7ad2adf6c 246 {
60010649 0:33a7ad2adf6c 247 lcd.Clear(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 248 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 249
60010649 0:33a7ad2adf6c 250 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 251 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 252
60010649 0:33a7ad2adf6c 253 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"Oc ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 254
60010649 0:33a7ad2adf6c 255 lcd.SetTextColor(LCD_COLOR_BLUE); //////-
60010649 0:33a7ad2adf6c 256 lcd.FillRect(320,0,40,60);
60010649 0:33a7ad2adf6c 257
60010649 0:33a7ad2adf6c 258 lcd.SetTextColor(LCD_COLOR_WHITE); //////-
60010649 0:33a7ad2adf6c 259 lcd.FillRect(320,20,40,10);
60010649 0:33a7ad2adf6c 260
60010649 0:33a7ad2adf6c 261 lcd.SetTextColor(LCD_COLOR_BLUE); //////+
60010649 0:33a7ad2adf6c 262 lcd.FillRect(440,0,40,60);
60010649 0:33a7ad2adf6c 263
60010649 0:33a7ad2adf6c 264 lcd.SetTextColor(LCD_COLOR_WHITE); //////-
60010649 0:33a7ad2adf6c 265 lcd.FillRect(440,20,40,20);
60010649 0:33a7ad2adf6c 266 lcd.FillRect(455,0,10,60);
60010649 0:33a7ad2adf6c 267
60010649 0:33a7ad2adf6c 268
60010649 0:33a7ad2adf6c 269 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 270 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 271 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"GUITAR",CENTER_MODE);
60010649 0:33a7ad2adf6c 272
60010649 0:33a7ad2adf6c 273 lcd.SetTextColor(LCD_COLOR_BLACK); //////Block2
60010649 0:33a7ad2adf6c 274 lcd.FillRect(105,60,105,70.667);
60010649 0:33a7ad2adf6c 275 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 276 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 277 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"C# ",CENTER_MODE);
60010649 0:33a7ad2adf6c 278
60010649 0:33a7ad2adf6c 279 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block6
60010649 0:33a7ad2adf6c 280 lcd.FillRect(105,130.66,105,70.667);
60010649 0:33a7ad2adf6c 281 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 282 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 283 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"F ",CENTER_MODE);
60010649 0:33a7ad2adf6c 284
60010649 0:33a7ad2adf6c 285 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block10
60010649 0:33a7ad2adf6c 286 lcd.FillRect(105,201.32,105,70.667);
60010649 0:33a7ad2adf6c 287 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 288 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 289 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"A ",CENTER_MODE);
60010649 0:33a7ad2adf6c 290
60010649 0:33a7ad2adf6c 291 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block3
60010649 0:33a7ad2adf6c 292 lcd.FillRect(210,60,105,70.667);
60010649 0:33a7ad2adf6c 293 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 294 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 295 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)" D",CENTER_MODE);
60010649 0:33a7ad2adf6c 296
60010649 0:33a7ad2adf6c 297 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block7
60010649 0:33a7ad2adf6c 298 lcd.FillRect(210,130.66,105,70.667);
60010649 0:33a7ad2adf6c 299 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 300 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 301 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" F#",CENTER_MODE);
60010649 0:33a7ad2adf6c 302
60010649 0:33a7ad2adf6c 303 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block11
60010649 0:33a7ad2adf6c 304 lcd.FillRect(210,201.32,105,70.667);
60010649 0:33a7ad2adf6c 305 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 306 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 307 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)" Bb",CENTER_MODE);
60010649 0:33a7ad2adf6c 308
60010649 0:33a7ad2adf6c 309 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block4
60010649 0:33a7ad2adf6c 310 lcd.FillRect(315,60,105,70.667);
60010649 0:33a7ad2adf6c 311 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 312 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 313 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"D# ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 314
60010649 0:33a7ad2adf6c 315 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block8
60010649 0:33a7ad2adf6c 316 lcd.FillRect(315,130.66,105,70.667);
60010649 0:33a7ad2adf6c 317 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 318 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 319 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"G ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 320
60010649 0:33a7ad2adf6c 321 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block12
60010649 0:33a7ad2adf6c 322 lcd.FillRect(315,201.32,105,70.66);
60010649 0:33a7ad2adf6c 323 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 324 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 325 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"B ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 326
60010649 0:33a7ad2adf6c 327 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block1
60010649 0:33a7ad2adf6c 328 lcd.FillRect(0,60,105,70.667);
60010649 0:33a7ad2adf6c 329 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 330 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 331 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)" C",LEFT_MODE);
60010649 0:33a7ad2adf6c 332
60010649 0:33a7ad2adf6c 333 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block5
60010649 0:33a7ad2adf6c 334 lcd.FillRect(0,130.66,105,70.667);
60010649 0:33a7ad2adf6c 335 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 336 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 337 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" E",LEFT_MODE);
60010649 0:33a7ad2adf6c 338
60010649 0:33a7ad2adf6c 339 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block9
60010649 0:33a7ad2adf6c 340 lcd.FillRect(0,201.32,105,70.667);
60010649 0:33a7ad2adf6c 341 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 342 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 343 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)" G#",LEFT_MODE);
60010649 0:33a7ad2adf6c 344
60010649 0:33a7ad2adf6c 345
60010649 0:33a7ad2adf6c 346 lcd.SetTextColor(LCD_COLOR_BROWN); ///BlockLeftBackToMain
60010649 0:33a7ad2adf6c 347 lcd.FillRect(420,Y1,60,212);
60010649 0:33a7ad2adf6c 348 lcd.SetBackColor(LCD_COLOR_BROWN);
60010649 0:33a7ad2adf6c 349 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 350 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"B ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 351 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"A ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 352 lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"C ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 353 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"K ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 354
60010649 0:33a7ad2adf6c 355 b=1;
60010649 0:33a7ad2adf6c 356
60010649 0:33a7ad2adf6c 357 midi.write(MIDIMessage::NoteOn(100));
60010649 0:33a7ad2adf6c 358 wait_ms(50);
60010649 0:33a7ad2adf6c 359 midi.write(MIDIMessage::NoteOff(100));
60010649 0:33a7ad2adf6c 360
60010649 0:33a7ad2adf6c 361 }
60010649 0:33a7ad2adf6c 362 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 440&&TS_State.touchX[0]<480&&TS_State.touchY[0] >= 0&&TS_State.touchY[0] < 60)
60010649 0:33a7ad2adf6c 363 {
60010649 0:33a7ad2adf6c 364 o=o+1;
60010649 0:33a7ad2adf6c 365 }
60010649 0:33a7ad2adf6c 366 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 320&&TS_State.touchX[0]<360&&TS_State.touchY[0] >= 0&&TS_State.touchY[0] < 60)
60010649 0:33a7ad2adf6c 367 {
60010649 0:33a7ad2adf6c 368 o=o-1;
60010649 0:33a7ad2adf6c 369 }
60010649 0:33a7ad2adf6c 370 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 371 {
60010649 0:33a7ad2adf6c 372 pc.printf("1");
60010649 0:33a7ad2adf6c 373 midi.write(MIDIMessage::NoteOn(60+(k*o)));
60010649 0:33a7ad2adf6c 374 wait_ms(150);
60010649 0:33a7ad2adf6c 375 midi.write(MIDIMessage::NoteOff(60+(k*o)));
60010649 0:33a7ad2adf6c 376 }
60010649 0:33a7ad2adf6c 377 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 378 {
60010649 0:33a7ad2adf6c 379 pc.printf("2");
60010649 0:33a7ad2adf6c 380 midi.write(MIDIMessage::NoteOn(61+(k*o)));
60010649 0:33a7ad2adf6c 381 wait_ms(150);
60010649 0:33a7ad2adf6c 382 midi.write(MIDIMessage::NoteOff(61+(k*o)));
60010649 0:33a7ad2adf6c 383 }
60010649 0:33a7ad2adf6c 384 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 385 {
60010649 0:33a7ad2adf6c 386 pc.printf("3");
60010649 0:33a7ad2adf6c 387 midi.write(MIDIMessage::NoteOn(62+(k*o)));
60010649 0:33a7ad2adf6c 388 wait_ms(150);
60010649 0:33a7ad2adf6c 389 midi.write(MIDIMessage::NoteOff(62+(k*o)));
60010649 0:33a7ad2adf6c 390 }
60010649 0:33a7ad2adf6c 391 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 392 {
60010649 0:33a7ad2adf6c 393 pc.printf("4");
60010649 0:33a7ad2adf6c 394 midi.write(MIDIMessage::NoteOn(63+(k*o)));
60010649 0:33a7ad2adf6c 395 wait_ms(150);
60010649 0:33a7ad2adf6c 396 midi.write(MIDIMessage::NoteOff(63+(k*o)));
60010649 0:33a7ad2adf6c 397 }
60010649 0:33a7ad2adf6c 398 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.33)
60010649 0:33a7ad2adf6c 399 {
60010649 0:33a7ad2adf6c 400 pc.printf("5");
60010649 0:33a7ad2adf6c 401 midi.write(MIDIMessage::NoteOn(64+(k*o)));
60010649 0:33a7ad2adf6c 402 wait_ms(150);
60010649 0:33a7ad2adf6c 403 midi.write(MIDIMessage::NoteOff(64+(k*o)));
60010649 0:33a7ad2adf6c 404 }
60010649 0:33a7ad2adf6c 405 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >= 130.66 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 406 {
60010649 0:33a7ad2adf6c 407 pc.printf("6");
60010649 0:33a7ad2adf6c 408 midi.write(MIDIMessage::NoteOn(65+(k*o)));
60010649 0:33a7ad2adf6c 409 wait_ms(150);
60010649 0:33a7ad2adf6c 410 midi.write(MIDIMessage::NoteOff(65+(k*o)));
60010649 0:33a7ad2adf6c 411 }
60010649 0:33a7ad2adf6c 412 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 413 {
60010649 0:33a7ad2adf6c 414 pc.printf("7");
60010649 0:33a7ad2adf6c 415 midi.write(MIDIMessage::NoteOn(66+(k*o)));
60010649 0:33a7ad2adf6c 416 wait_ms(150);
60010649 0:33a7ad2adf6c 417 midi.write(MIDIMessage::NoteOff(66+(k*o)));
60010649 0:33a7ad2adf6c 418 }
60010649 0:33a7ad2adf6c 419 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 420 {
60010649 0:33a7ad2adf6c 421 pc.printf("8");
60010649 0:33a7ad2adf6c 422 midi.write(MIDIMessage::NoteOn(67+(k*o)));
60010649 0:33a7ad2adf6c 423 wait_ms(150);
60010649 0:33a7ad2adf6c 424 midi.write(MIDIMessage::NoteOff(67+(k*o)));
60010649 0:33a7ad2adf6c 425 }
60010649 0:33a7ad2adf6c 426 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 427 {
60010649 0:33a7ad2adf6c 428 pc.printf("9");
60010649 0:33a7ad2adf6c 429 midi.write(MIDIMessage::NoteOn(68+(k*o)));
60010649 0:33a7ad2adf6c 430 wait_ms(150);
60010649 0:33a7ad2adf6c 431 midi.write(MIDIMessage::NoteOff(68+(k*o)));
60010649 0:33a7ad2adf6c 432 }
60010649 0:33a7ad2adf6c 433 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 434 {
60010649 0:33a7ad2adf6c 435 pc.printf("10");
60010649 0:33a7ad2adf6c 436 midi.write(MIDIMessage::NoteOn(69+(k*o)));
60010649 0:33a7ad2adf6c 437 wait_ms(150);
60010649 0:33a7ad2adf6c 438 midi.write(MIDIMessage::NoteOff(69+(k*o)));
60010649 0:33a7ad2adf6c 439 }
60010649 0:33a7ad2adf6c 440 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 441 {
60010649 0:33a7ad2adf6c 442 pc.printf("11");
60010649 0:33a7ad2adf6c 443 midi.write(MIDIMessage::NoteOn(70+(k*o)));
60010649 0:33a7ad2adf6c 444 wait_ms(150);
60010649 0:33a7ad2adf6c 445 midi.write(MIDIMessage::NoteOff(70+(k*o)));
60010649 0:33a7ad2adf6c 446 }
60010649 0:33a7ad2adf6c 447 else if(a==0&&b==1&&c==0&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 448 {
60010649 0:33a7ad2adf6c 449 pc.printf("12");
60010649 0:33a7ad2adf6c 450 midi.write(MIDIMessage::NoteOn(71+(k*o)));
60010649 0:33a7ad2adf6c 451 wait_ms(150);
60010649 0:33a7ad2adf6c 452 midi.write(MIDIMessage::NoteOff(71+(k*o)));
60010649 0:33a7ad2adf6c 453 }
60010649 0:33a7ad2adf6c 454
60010649 0:33a7ad2adf6c 455
60010649 0:33a7ad2adf6c 456 else if(TS_State.touchX[0] >= 420&&TS_State.touchY[0] >=60&&a==0&&b==1&&c==0)
60010649 0:33a7ad2adf6c 457 {
60010649 0:33a7ad2adf6c 458 b = 0;
60010649 0:33a7ad2adf6c 459 pc.printf("bye2");
60010649 0:33a7ad2adf6c 460 midi.write(MIDIMessage::NoteOn(101));
60010649 0:33a7ad2adf6c 461 wait_ms(50);
60010649 0:33a7ad2adf6c 462 midi.write(MIDIMessage::NoteOff(101));
60010649 0:33a7ad2adf6c 463 goto top;
60010649 0:33a7ad2adf6c 464
60010649 0:33a7ad2adf6c 465 }
60010649 0:33a7ad2adf6c 466 else if(TS_State.touchX[0] >= 320&&a==0&&b==0&&c==0)
60010649 0:33a7ad2adf6c 467 {
60010649 0:33a7ad2adf6c 468 lcd.Clear(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 469 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 470
60010649 0:33a7ad2adf6c 471 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 472 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 473
60010649 0:33a7ad2adf6c 474 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"Oc ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 475 lcd.SetTextColor(LCD_COLOR_BLUE); //////-
60010649 0:33a7ad2adf6c 476 lcd.FillRect(320,0,40,60);
60010649 0:33a7ad2adf6c 477
60010649 0:33a7ad2adf6c 478 lcd.SetTextColor(LCD_COLOR_WHITE); //////-
60010649 0:33a7ad2adf6c 479 lcd.FillRect(320,20,40,10);
60010649 0:33a7ad2adf6c 480
60010649 0:33a7ad2adf6c 481 lcd.SetTextColor(LCD_COLOR_BLUE); //////+
60010649 0:33a7ad2adf6c 482 lcd.FillRect(440,0,40,60);
60010649 0:33a7ad2adf6c 483
60010649 0:33a7ad2adf6c 484 lcd.SetTextColor(LCD_COLOR_WHITE); //////-
60010649 0:33a7ad2adf6c 485 lcd.FillRect(440,20,40,20);
60010649 0:33a7ad2adf6c 486 lcd.FillRect(455,0,10,60);
60010649 0:33a7ad2adf6c 487
60010649 0:33a7ad2adf6c 488 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
60010649 0:33a7ad2adf6c 489 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 490 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"PIANO",CENTER_MODE);
60010649 0:33a7ad2adf6c 491
60010649 0:33a7ad2adf6c 492 lcd.SetTextColor(LCD_COLOR_BLACK); //////Block2
60010649 0:33a7ad2adf6c 493 lcd.FillRect(105,60,105,70.667);
60010649 0:33a7ad2adf6c 494 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 495 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 496 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"C# ",CENTER_MODE);
60010649 0:33a7ad2adf6c 497
60010649 0:33a7ad2adf6c 498 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block6
60010649 0:33a7ad2adf6c 499 lcd.FillRect(105,130.66,105,70.667);
60010649 0:33a7ad2adf6c 500 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 501 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 502 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"F ",CENTER_MODE);
60010649 0:33a7ad2adf6c 503
60010649 0:33a7ad2adf6c 504 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block10
60010649 0:33a7ad2adf6c 505 lcd.FillRect(105,201.32,105,70.667);
60010649 0:33a7ad2adf6c 506 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 507 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 508 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"A ",CENTER_MODE);
60010649 0:33a7ad2adf6c 509
60010649 0:33a7ad2adf6c 510 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block3
60010649 0:33a7ad2adf6c 511 lcd.FillRect(210,60,105,70.667);
60010649 0:33a7ad2adf6c 512 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 513 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 514 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)" D",CENTER_MODE);
60010649 0:33a7ad2adf6c 515
60010649 0:33a7ad2adf6c 516 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block7
60010649 0:33a7ad2adf6c 517 lcd.FillRect(210,130.66,105,70.667);
60010649 0:33a7ad2adf6c 518 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 519 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 520 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" F#",CENTER_MODE);
60010649 0:33a7ad2adf6c 521
60010649 0:33a7ad2adf6c 522 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block11
60010649 0:33a7ad2adf6c 523 lcd.FillRect(210,201.32,105,70.667);
60010649 0:33a7ad2adf6c 524 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 525 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 526 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)" Bb",CENTER_MODE);
60010649 0:33a7ad2adf6c 527
60010649 0:33a7ad2adf6c 528 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block4
60010649 0:33a7ad2adf6c 529 lcd.FillRect(315,60,105,70.667);
60010649 0:33a7ad2adf6c 530 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 531 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 532 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"D# ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 533
60010649 0:33a7ad2adf6c 534 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block8
60010649 0:33a7ad2adf6c 535 lcd.FillRect(315,130.66,105,70.667);
60010649 0:33a7ad2adf6c 536 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 537 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 538 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"G ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 539
60010649 0:33a7ad2adf6c 540 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block12
60010649 0:33a7ad2adf6c 541 lcd.FillRect(315,201.32,105,70.66);
60010649 0:33a7ad2adf6c 542 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 543 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 544 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"B ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 545
60010649 0:33a7ad2adf6c 546 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block1
60010649 0:33a7ad2adf6c 547 lcd.FillRect(0,60,105,70.667);
60010649 0:33a7ad2adf6c 548 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 549 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 550 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)" C",LEFT_MODE);
60010649 0:33a7ad2adf6c 551
60010649 0:33a7ad2adf6c 552 lcd.SetTextColor(LCD_COLOR_BLACK); ///Block5
60010649 0:33a7ad2adf6c 553 lcd.FillRect(0,130.66,105,70.667);
60010649 0:33a7ad2adf6c 554 lcd.SetBackColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 555 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 556 lcd.DisplayStringAt(0, LINE(6), (uint8_t *)" E",LEFT_MODE);
60010649 0:33a7ad2adf6c 557
60010649 0:33a7ad2adf6c 558 lcd.SetTextColor(LCD_COLOR_WHITE); ///Block9
60010649 0:33a7ad2adf6c 559 lcd.FillRect(0,201.32,105,70.667);
60010649 0:33a7ad2adf6c 560 lcd.SetBackColor(LCD_COLOR_WHITE);
60010649 0:33a7ad2adf6c 561 lcd.SetTextColor(LCD_COLOR_BLACK);
60010649 0:33a7ad2adf6c 562 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)" G#",LEFT_MODE);
60010649 0:33a7ad2adf6c 563
60010649 0:33a7ad2adf6c 564 lcd.SetTextColor(LCD_COLOR_BROWN); ///BlockLeftBackToMain
60010649 0:33a7ad2adf6c 565 lcd.FillRect(420,Y1,60,212);
60010649 0:33a7ad2adf6c 566 lcd.SetBackColor(LCD_COLOR_BROWN);
60010649 0:33a7ad2adf6c 567 lcd.SetTextColor(LCD_COLOR_LIGHTYELLOW);
60010649 0:33a7ad2adf6c 568 lcd.DisplayStringAt(0, LINE(3), (uint8_t *)"B ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 569 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"A ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 570 lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"C ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 571 lcd.DisplayStringAt(0, LINE(9), (uint8_t *)"K ",RIGHT_MODE);
60010649 0:33a7ad2adf6c 572
60010649 0:33a7ad2adf6c 573
60010649 0:33a7ad2adf6c 574 c=1;
60010649 0:33a7ad2adf6c 575 midi.write(MIDIMessage::NoteOn(102));
60010649 0:33a7ad2adf6c 576 wait_ms(50);
60010649 0:33a7ad2adf6c 577 midi.write(MIDIMessage::NoteOff(102));
60010649 0:33a7ad2adf6c 578
60010649 0:33a7ad2adf6c 579 }
60010649 0:33a7ad2adf6c 580 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 440&&TS_State.touchX[0]<480&&TS_State.touchY[0] >= 0&&TS_State.touchY[0] < 60)
60010649 0:33a7ad2adf6c 581 {
60010649 0:33a7ad2adf6c 582 o=o+1;
60010649 0:33a7ad2adf6c 583 }
60010649 0:33a7ad2adf6c 584 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 320&&TS_State.touchX[0]<360&&TS_State.touchY[0] >= 0&&TS_State.touchY[0] < 60)
60010649 0:33a7ad2adf6c 585 {
60010649 0:33a7ad2adf6c 586 o=o-1;
60010649 0:33a7ad2adf6c 587 }
60010649 0:33a7ad2adf6c 588 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 589 {
60010649 0:33a7ad2adf6c 590 pc.printf("0");
60010649 0:33a7ad2adf6c 591 midi.write(MIDIMessage::NoteOn(60+(k*o)));
60010649 0:33a7ad2adf6c 592 wait_ms(150);
60010649 0:33a7ad2adf6c 593 midi.write(MIDIMessage::NoteOff(60+(k*o)));
60010649 0:33a7ad2adf6c 594 }
60010649 0:33a7ad2adf6c 595 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 596 {
60010649 0:33a7ad2adf6c 597 pc.printf("k");
60010649 0:33a7ad2adf6c 598 midi.write(MIDIMessage::NoteOn(61+(k*o)));
60010649 0:33a7ad2adf6c 599 wait_ms(150);
60010649 0:33a7ad2adf6c 600 midi.write(MIDIMessage::NoteOff(61+(k*o)));
60010649 0:33a7ad2adf6c 601 }
60010649 0:33a7ad2adf6c 602 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 603 {
60010649 0:33a7ad2adf6c 604 pc.printf("d");
60010649 0:33a7ad2adf6c 605 midi.write(MIDIMessage::NoteOn(62+(k*o)));
60010649 0:33a7ad2adf6c 606 wait_ms(150);
60010649 0:33a7ad2adf6c 607 midi.write(MIDIMessage::NoteOff(62+(k*o)));
60010649 0:33a7ad2adf6c 608 }
60010649 0:33a7ad2adf6c 609 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= 60&&TS_State.touchY[0] < 130.667)
60010649 0:33a7ad2adf6c 610 {
60010649 0:33a7ad2adf6c 611 pc.printf("n");
60010649 0:33a7ad2adf6c 612 midi.write(MIDIMessage::NoteOn(63+(k*o)));
60010649 0:33a7ad2adf6c 613 wait_ms(150);
60010649 0:33a7ad2adf6c 614 midi.write(MIDIMessage::NoteOff(63+(k*o)));
60010649 0:33a7ad2adf6c 615 }
60010649 0:33a7ad2adf6c 616 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 617 {
60010649 0:33a7ad2adf6c 618 pc.printf("z");
60010649 0:33a7ad2adf6c 619 midi.write(MIDIMessage::NoteOn(64+(k*o)));
60010649 0:33a7ad2adf6c 620 wait_ms(150);
60010649 0:33a7ad2adf6c 621 midi.write(MIDIMessage::NoteOff(64+(k*o)));
60010649 0:33a7ad2adf6c 622 }
60010649 0:33a7ad2adf6c 623 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 624 {
60010649 0:33a7ad2adf6c 625 pc.printf("x");
60010649 0:33a7ad2adf6c 626 midi.write(MIDIMessage::NoteOn(65+(k*o)));
60010649 0:33a7ad2adf6c 627 wait_ms(150);
60010649 0:33a7ad2adf6c 628 midi.write(MIDIMessage::NoteOff(65+(k*o)));
60010649 0:33a7ad2adf6c 629 }
60010649 0:33a7ad2adf6c 630 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 631 {
60010649 0:33a7ad2adf6c 632 pc.printf("y");
60010649 0:33a7ad2adf6c 633 midi.write(MIDIMessage::NoteOn(66+(k*o)));
60010649 0:33a7ad2adf6c 634 wait_ms(150);
60010649 0:33a7ad2adf6c 635 midi.write(MIDIMessage::NoteOff(66+(k*o)));
60010649 0:33a7ad2adf6c 636 }
60010649 0:33a7ad2adf6c 637 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >= 130.667 &&TS_State.touchY[0]<201.34)
60010649 0:33a7ad2adf6c 638 {
60010649 0:33a7ad2adf6c 639 pc.printf("s");
60010649 0:33a7ad2adf6c 640 midi.write(MIDIMessage::NoteOn(67+(k*o)));
60010649 0:33a7ad2adf6c 641 wait_ms(150);
60010649 0:33a7ad2adf6c 642 midi.write(MIDIMessage::NoteOff(67+(k*o)));
60010649 0:33a7ad2adf6c 643 }
60010649 0:33a7ad2adf6c 644 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 0&&TS_State.touchX[0]<105&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 645 {
60010649 0:33a7ad2adf6c 646 pc.printf("U");
60010649 0:33a7ad2adf6c 647 midi.write(MIDIMessage::NoteOn(68+(k*o)));
60010649 0:33a7ad2adf6c 648 wait_ms(150);
60010649 0:33a7ad2adf6c 649 midi.write(MIDIMessage::NoteOff(68+(k*o)));
60010649 0:33a7ad2adf6c 650 }
60010649 0:33a7ad2adf6c 651 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 105&&TS_State.touchX[0]<210&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 652 {
60010649 0:33a7ad2adf6c 653 pc.printf("N0");
60010649 0:33a7ad2adf6c 654 midi.write(MIDIMessage::NoteOn(69+(k*o)));
60010649 0:33a7ad2adf6c 655 wait_ms(150);
60010649 0:33a7ad2adf6c 656 midi.write(MIDIMessage::NoteOff(69+(k*o)));
60010649 0:33a7ad2adf6c 657 }
60010649 0:33a7ad2adf6c 658 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 210&&TS_State.touchX[0]<315&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 659 {
60010649 0:33a7ad2adf6c 660 pc.printf("N1");
60010649 0:33a7ad2adf6c 661 midi.write(MIDIMessage::NoteOn(70+(k*o)));
60010649 0:33a7ad2adf6c 662 wait_ms(150);
60010649 0:33a7ad2adf6c 663 midi.write(MIDIMessage::NoteOff(70+(k*o)));
60010649 0:33a7ad2adf6c 664 }
60010649 0:33a7ad2adf6c 665 else if(a==0&&b==0&&c==1&&TS_State.touchX[0] >= 315&&TS_State.touchX[0]<420&&TS_State.touchY[0] >=201.34)
60010649 0:33a7ad2adf6c 666 {
60010649 0:33a7ad2adf6c 667 pc.printf("N2");
60010649 0:33a7ad2adf6c 668 midi.write(MIDIMessage::NoteOn(71+(k*o)));
60010649 0:33a7ad2adf6c 669 wait_ms(150);
60010649 0:33a7ad2adf6c 670 midi.write(MIDIMessage::NoteOff(71+(k*o)));
60010649 0:33a7ad2adf6c 671 }
60010649 0:33a7ad2adf6c 672
60010649 0:33a7ad2adf6c 673
60010649 0:33a7ad2adf6c 674 else if(TS_State.touchX[0] >= 420&&TS_State.touchY[0] >=60&&a==0&&b==0&&c==1)
60010649 0:33a7ad2adf6c 675 {
60010649 0:33a7ad2adf6c 676 c = 0;
60010649 0:33a7ad2adf6c 677 pc.printf("bye3");
60010649 0:33a7ad2adf6c 678
60010649 0:33a7ad2adf6c 679 midi.write(MIDIMessage::NoteOn(101));
60010649 0:33a7ad2adf6c 680 wait_ms(50);
60010649 0:33a7ad2adf6c 681 midi.write(MIDIMessage::NoteOff(101));
60010649 0:33a7ad2adf6c 682
60010649 0:33a7ad2adf6c 683 goto top;
60010649 0:33a7ad2adf6c 684 }
60010649 0:33a7ad2adf6c 685
60010649 0:33a7ad2adf6c 686 }
60010649 0:33a7ad2adf6c 687 a0=v.read()*127;
60010649 0:33a7ad2adf6c 688 midi.write(MIDIMessage::ControlChange(1,a0));
60010649 0:33a7ad2adf6c 689
60010649 0:33a7ad2adf6c 690
60010649 0:33a7ad2adf6c 691
60010649 0:33a7ad2adf6c 692
60010649 0:33a7ad2adf6c 693 wait_ms(50);
60010649 0:33a7ad2adf6c 694
60010649 0:33a7ad2adf6c 695 }
60010649 0:33a7ad2adf6c 696 }