Components and supplies
Male Header 40 Position 1 Row (0.1")
Resistor 220 ohm
USB-A to B Cable
AWM Cable
Male/Male Jumper Wires
DIN Midi Plug
IDC Socket
Potentiometer, Slide
Arduino Mega 2560
Tools and machines
Solder Wire, Lead Free
Wire Stripper, Serrated Plier Nose
Plier, Side Cutting
Soldering iron (generic)
Solder Flux, Soldering
Plier, Flat Nose
Apps and platforms
Arduino IDE
Project description
Code
Bussed Keyboard Code
arduino
Code to upload to the Arduino if you are following the Bussed Keyboard Schematic.
1// Name: Arduino Mega Midi Controller 61x4 plus 3 potentiometers. 2// Version 1.0 3// Created: April 12, 2021 4// Author: Larason2 5// Acknowledgements: Bald Engineer, Amanda Ghassaei, jeffb42, GrumpyMike 6 7//Note Data 8 9byte keysA[11][6]; 10byte keysB[11][6]; 11byte keysC[11][6]; 12byte keysD[11][6]; 13 14//Last Key State 15 16byte lastA[11][6]; 17byte lastB[11][6]; 18byte lastC[11][6]; 19byte lastD[11][6]; 20 21//Midi Messages Sent 22 23int noteOn1 = 144; 24int noteOff1 = 128; 25int noteOn2 = 145; 26int noteOff2 = 129; 27int noteOn3 = 146; 28int noteOff3 = 130; 29int noteOn4 = 147; 30int noteOff4 = 131; 31int velocity = 100; 32int chan6 = 181; 33int chan7 = 182; 34int chan8 = 183; 35int Exp = 11; 36 37//Last Potentiometer State 38 39int LastPot6 = 1; 40int LastPot7 = 1; 41int LastPot8 = 1; 42 43void setup() { 44 // Start Serial at Midi rate 45 Serial.begin(31250); 46 47 //Initialize Pins 1-10 48 pinMode(2, INPUT); 49 pinMode(3, INPUT); 50 pinMode(4, INPUT); 51 pinMode(5, INPUT); 52 pinMode(6, INPUT); 53 pinMode(7, INPUT); 54 pinMode(8, INPUT); 55 pinMode(9, INPUT); 56 pinMode(10, INPUT); 57 pinMode(11, INPUT); 58 59 //Pins 11-20 60 61 pinMode(12, INPUT); 62 pinMode(13, INPUT); 63 pinMode(14, INPUT); 64 pinMode(15, INPUT); 65 pinMode(16, INPUT); 66 pinMode(17, INPUT); 67 pinMode(18, INPUT); 68 pinMode(19, INPUT); 69 pinMode(20, INPUT); 70 pinMode(21, INPUT); 71 72 //Pins 21-30 73 74 pinMode(22, INPUT); 75 pinMode(23, INPUT); 76 pinMode(24, INPUT); 77 pinMode(25, INPUT); 78 pinMode(26, INPUT); 79 pinMode(27, INPUT); 80 pinMode(28, INPUT); 81 pinMode(29, INPUT); 82 pinMode(30, INPUT); 83 pinMode(31, INPUT); 84 85 //Pins 31-40 86 87 pinMode(32, INPUT); 88 pinMode(33, INPUT); 89 pinMode(34, INPUT); 90 pinMode(35, INPUT); 91 pinMode(36, INPUT); 92 pinMode(37, INPUT); 93 pinMode(38, INPUT); 94 pinMode(39, INPUT); 95 pinMode(40, INPUT); 96 pinMode(41, INPUT); 97 98 //Pins 41-50 99 100 pinMode(42, INPUT); 101 pinMode(43, INPUT); 102 pinMode(44, INPUT); 103 pinMode(45, INPUT); 104 pinMode(46, INPUT); 105 pinMode(47, INPUT); 106 pinMode(48, INPUT); 107 pinMode(49, INPUT); 108 pinMode(50, INPUT); 109 pinMode(51, INPUT); 110 111 //Pins 51-61 112 113 pinMode(52, INPUT); 114 pinMode(53, INPUT); 115 pinMode(A0, INPUT); 116 pinMode(A1, INPUT); 117 pinMode(A2, INPUT); 118 pinMode(A3, INPUT); 119 pinMode(A4, INPUT); 120 pinMode(A5, INPUT); 121 pinMode(A6, INPUT); 122 pinMode(A7, INPUT); 123 pinMode(A8, INPUT); 124 125 //Column Pins 126 127 pinMode(A9, INPUT); 128 pinMode(A10, INPUT); 129 pinMode(A11, INPUT); 130 pinMode(A12, INPUT); 131 132 //Pot Pins 133 134 pinMode(A13, INPUT); 135 pinMode(A14, INPUT); 136 pinMode(A15, INPUT); 137} 138 139void loop() { 140 141 // Setup pins for keyboards 142 143 //Pins 1-10 144 pinMode(2, INPUT_PULLUP); 145 pinMode(3, INPUT_PULLUP); 146 pinMode(4, INPUT_PULLUP); 147 pinMode(5, INPUT_PULLUP); 148 pinMode(6, INPUT_PULLUP); 149 pinMode(7, INPUT_PULLUP); 150 pinMode(8, INPUT_PULLUP); 151 pinMode(9, INPUT_PULLUP); 152 pinMode(10, INPUT_PULLUP); 153 pinMode(11, INPUT_PULLUP); 154 155 //Pins 11-20 156 157 pinMode(12, INPUT_PULLUP); 158 pinMode(13, INPUT_PULLUP); 159 pinMode(14, INPUT_PULLUP); 160 pinMode(15, INPUT_PULLUP); 161 pinMode(16, INPUT_PULLUP); 162 pinMode(17, INPUT_PULLUP); 163 pinMode(18, INPUT_PULLUP); 164 pinMode(19, INPUT_PULLUP); 165 pinMode(20, INPUT_PULLUP); 166 pinMode(21, INPUT_PULLUP); 167 168 //Pins 21-30 169 170 pinMode(22, INPUT_PULLUP); 171 pinMode(23, INPUT_PULLUP); 172 pinMode(24, INPUT_PULLUP); 173 pinMode(25, INPUT_PULLUP); 174 pinMode(26, INPUT_PULLUP); 175 pinMode(27, INPUT_PULLUP); 176 pinMode(28, INPUT_PULLUP); 177 pinMode(29, INPUT_PULLUP); 178 pinMode(30, INPUT_PULLUP); 179 pinMode(31, INPUT_PULLUP); 180 181 //Pins 31-40 182 183 pinMode(32, INPUT_PULLUP); 184 pinMode(33, INPUT_PULLUP); 185 pinMode(34, INPUT_PULLUP); 186 pinMode(35, INPUT_PULLUP); 187 pinMode(36, INPUT_PULLUP); 188 pinMode(37, INPUT_PULLUP); 189 pinMode(38, INPUT_PULLUP); 190 pinMode(39, INPUT_PULLUP); 191 pinMode(40, INPUT_PULLUP); 192 pinMode(41, INPUT_PULLUP); 193 194 //Pins 41-50 195 196 pinMode(42, INPUT_PULLUP); 197 pinMode(43, INPUT_PULLUP); 198 pinMode(44, INPUT_PULLUP); 199 pinMode(45, INPUT_PULLUP); 200 pinMode(46, INPUT_PULLUP); 201 pinMode(47, INPUT_PULLUP); 202 pinMode(48, INPUT_PULLUP); 203 pinMode(49, INPUT_PULLUP); 204 pinMode(50, INPUT_PULLUP); 205 pinMode(51, INPUT_PULLUP); 206 207 //Pins 51-61 208 209 pinMode(52, INPUT_PULLUP); 210 pinMode(53, INPUT_PULLUP); 211 pinMode(A0, INPUT_PULLUP); 212 pinMode(A1, INPUT_PULLUP); 213 pinMode(A2, INPUT_PULLUP); 214 pinMode(A3, INPUT_PULLUP); 215 pinMode(A4, INPUT_PULLUP); 216 pinMode(A5, INPUT_PULLUP); 217 pinMode(A6, INPUT_PULLUP); 218 pinMode(A7, INPUT_PULLUP); 219 pinMode(A8, INPUT_PULLUP); 220 221 //Read Keyboard A 222 223 pinMode(A9, OUTPUT); 224 digitalWrite(A9, LOW); 225 226 //Keys 1-10 227 228 keysA[0][0] = digitalRead(2); 229 keysA[1][0] = digitalRead(3); 230 keysA[1][1] = digitalRead(4); 231 keysA[1][2] = digitalRead(5); 232 keysA[1][3] = digitalRead(6); 233 keysA[1][4] = digitalRead(7); 234 keysA[1][5] = digitalRead(8); 235 keysA[2][0] = digitalRead(9); 236 keysA[2][1] = digitalRead(10); 237 keysA[2][2] = digitalRead(11); 238 239 //Keys 11-20 240 241 keysA[2][3] = digitalRead(12); 242 keysA[2][4] = digitalRead(13); 243 keysA[2][5] = digitalRead(14); 244 keysA[3][0] = digitalRead(15); 245 keysA[3][1] = digitalRead(16); 246 keysA[3][2] = digitalRead(17); 247 keysA[3][3] = digitalRead(18); 248 keysA[3][4] = digitalRead(19); 249 keysA[3][5] = digitalRead(20); 250 keysA[4][0] = digitalRead(21); 251 252 253 //Keys 21-30 254 255 keysA[4][1] = digitalRead(22); 256 keysA[4][2] = digitalRead(23); 257 keysA[4][3] = digitalRead(24); 258 keysA[4][4] = digitalRead(25); 259 keysA[4][5] = digitalRead(26); 260 keysA[5][0] = digitalRead(27); 261 keysA[5][1] = digitalRead(28); 262 keysA[5][2] = digitalRead(29); 263 keysA[5][3] = digitalRead(30); 264 keysA[5][4] = digitalRead(31); 265 266 //Keys 31-40 267 268 keysA[5][5] = digitalRead(32); 269 keysA[6][0] = digitalRead(33); 270 keysA[6][1] = digitalRead(34); 271 keysA[6][2] = digitalRead(35); 272 keysA[6][3] = digitalRead(36); 273 keysA[6][4] = digitalRead(37); 274 keysA[6][5] = digitalRead(38); 275 keysA[7][0] = digitalRead(39); 276 keysA[7][1] = digitalRead(40); 277 keysA[7][2] = digitalRead(41); 278 279 //Keys 41-50 280 281 keysA[7][3] = digitalRead(42); 282 keysA[7][4] = digitalRead(43); 283 keysA[7][5] = digitalRead(44); 284 keysA[8][0] = digitalRead(45); 285 keysA[8][1] = digitalRead(46); 286 keysA[8][2] = digitalRead(47); 287 keysA[8][3] = digitalRead(48); 288 keysA[8][4] = digitalRead(49); 289 keysA[8][5] = digitalRead(50); 290 keysA[9][0] = digitalRead(51); 291 292 //Keys 51-61 293 294 keysA[9][1] = digitalRead(52); 295 keysA[9][2] = digitalRead(53); 296 keysA[9][3] = digitalRead(A0); 297 keysA[9][4] = digitalRead(A1); 298 keysA[9][5] = digitalRead(A2); 299 keysA[10][0] = digitalRead(A3); 300 keysA[10][1] = digitalRead(A4); 301 keysA[10][2] = digitalRead(A5); 302 keysA[10][3] = digitalRead(A6); 303 keysA[10][4] = digitalRead(A7); 304 keysA[10][5] = digitalRead(A8); 305 306 pinMode(A9, INPUT); 307 308 // Read Keyboard B 309 310 pinMode(A10, OUTPUT); 311 digitalWrite(A10, LOW); 312 313 //Keys 1-10 314 315 keysB[0][0] = digitalRead(2); 316 keysB[1][0] = digitalRead(3); 317 keysB[1][1] = digitalRead(4); 318 keysB[1][2] = digitalRead(5); 319 keysB[1][3] = digitalRead(6); 320 keysB[1][4] = digitalRead(7); 321 keysB[1][5] = digitalRead(8); 322 keysB[2][0] = digitalRead(9); 323 keysB[2][1] = digitalRead(10); 324 keysB[2][2] = digitalRead(11); 325 326 //Keys 11-20 327 328 keysB[2][3] = digitalRead(12); 329 keysB[2][4] = digitalRead(13); 330 keysB[2][5] = digitalRead(14); 331 keysB[3][0] = digitalRead(15); 332 keysB[3][1] = digitalRead(16); 333 keysB[3][2] = digitalRead(17); 334 keysB[3][3] = digitalRead(18); 335 keysB[3][4] = digitalRead(19); 336 keysB[3][5] = digitalRead(20); 337 keysB[4][0] = digitalRead(21); 338 339 340 //Keys 21-30 341 342 keysB[4][1] = digitalRead(22); 343 keysB[4][2] = digitalRead(23); 344 keysB[4][3] = digitalRead(24); 345 keysB[4][4] = digitalRead(25); 346 keysB[4][5] = digitalRead(26); 347 keysB[5][0] = digitalRead(27); 348 keysB[5][1] = digitalRead(28); 349 keysB[5][2] = digitalRead(29); 350 keysB[5][3] = digitalRead(30); 351 keysB[5][4] = digitalRead(31); 352 353 //Keys 31-40 354 355 keysB[5][5] = digitalRead(32); 356 keysB[6][0] = digitalRead(33); 357 keysB[6][1] = digitalRead(34); 358 keysB[6][2] = digitalRead(35); 359 keysB[6][3] = digitalRead(36); 360 keysB[6][4] = digitalRead(37); 361 keysB[6][5] = digitalRead(38); 362 keysB[7][0] = digitalRead(39); 363 keysB[7][1] = digitalRead(40); 364 keysB[7][2] = digitalRead(41); 365 366 //Keys 41-50 367 368 keysB[7][3] = digitalRead(42); 369 keysB[7][4] = digitalRead(43); 370 keysB[7][5] = digitalRead(44); 371 keysB[8][0] = digitalRead(45); 372 keysB[8][1] = digitalRead(46); 373 keysB[8][2] = digitalRead(47); 374 keysB[8][3] = digitalRead(48); 375 keysB[8][4] = digitalRead(49); 376 keysB[8][5] = digitalRead(50); 377 keysB[9][0] = digitalRead(51); 378 379 //Keys 51-61 380 381 keysB[9][1] = digitalRead(52); 382 keysB[9][2] = digitalRead(53); 383 keysB[9][3] = digitalRead(A0); 384 keysB[9][4] = digitalRead(A1); 385 keysB[9][5] = digitalRead(A2); 386 keysB[10][0] = digitalRead(A3); 387 keysB[10][1] = digitalRead(A4); 388 keysB[10][2] = digitalRead(A5); 389 keysB[10][3] = digitalRead(A6); 390 keysB[10][4] = digitalRead(A7); 391 keysB[10][5] = digitalRead(A8); 392 393 pinMode(A10, INPUT); 394 395 // Read Keyboard C 396 397 pinMode(A11, OUTPUT); 398 digitalWrite(A11, LOW); 399 400 //Keys 1-10 401 402 keysC[0][0] = digitalRead(2); 403 keysC[1][0] = digitalRead(3); 404 keysC[1][1] = digitalRead(4); 405 keysC[1][2] = digitalRead(5); 406 keysC[1][3] = digitalRead(6); 407 keysC[1][4] = digitalRead(7); 408 keysC[1][5] = digitalRead(8); 409 keysC[2][0] = digitalRead(9); 410 keysC[2][1] = digitalRead(10); 411 keysC[2][2] = digitalRead(11); 412 413 //Keys 11-20 414 415 keysC[2][3] = digitalRead(12); 416 keysC[2][4] = digitalRead(13); 417 keysC[2][5] = digitalRead(14); 418 keysC[3][0] = digitalRead(15); 419 keysC[3][1] = digitalRead(16); 420 keysC[3][2] = digitalRead(17); 421 keysC[3][3] = digitalRead(18); 422 keysC[3][4] = digitalRead(19); 423 keysC[3][5] = digitalRead(20); 424 keysC[4][0] = digitalRead(21); 425 426 //Keys 21-30 427 428 keysC[4][1] = digitalRead(22); 429 keysC[4][2] = digitalRead(23); 430 keysC[4][3] = digitalRead(24); 431 keysC[4][4] = digitalRead(25); 432 keysC[4][5] = digitalRead(26); 433 keysC[5][0] = digitalRead(27); 434 keysC[5][1] = digitalRead(28); 435 keysC[5][2] = digitalRead(29); 436 keysC[5][3] = digitalRead(30); 437 keysC[5][4] = digitalRead(31); 438 439 //Keys 31-40 440 441 keysC[5][5] = digitalRead(32); 442 keysC[6][0] = digitalRead(33); 443 keysC[6][1] = digitalRead(34); 444 keysC[6][2] = digitalRead(35); 445 keysC[6][3] = digitalRead(36); 446 keysC[6][4] = digitalRead(37); 447 keysC[6][5] = digitalRead(38); 448 keysC[7][0] = digitalRead(39); 449 keysC[7][1] = digitalRead(40); 450 keysC[7][2] = digitalRead(41); 451 452 //Keys 41-50 453 454 keysC[7][3] = digitalRead(42); 455 keysC[7][4] = digitalRead(43); 456 keysC[7][5] = digitalRead(44); 457 keysC[8][0] = digitalRead(45); 458 keysC[8][1] = digitalRead(46); 459 keysC[8][2] = digitalRead(47); 460 keysC[8][3] = digitalRead(48); 461 keysC[8][4] = digitalRead(49); 462 keysC[8][5] = digitalRead(50); 463 keysC[9][0] = digitalRead(51); 464 465 //Keys 51-61 466 467 keysC[9][1] = digitalRead(52); 468 keysC[9][2] = digitalRead(53); 469 keysC[9][3] = digitalRead(A0); 470 keysC[9][4] = digitalRead(A1); 471 keysC[9][5] = digitalRead(A2); 472 keysC[10][0] = digitalRead(A3); 473 keysC[10][1] = digitalRead(A4); 474 keysC[10][2] = digitalRead(A5); 475 keysC[10][3] = digitalRead(A6); 476 keysC[10][4] = digitalRead(A7); 477 keysC[10][5] = digitalRead(A8); 478 479 pinMode(A11, INPUT); 480 481 // Read Keyboard D 482 483 pinMode(A12, OUTPUT); 484 digitalWrite(A12, LOW); 485 486 //Keys 1-10 487 488 keysD[0][0] = digitalRead(2); 489 keysD[1][0] = digitalRead(3); 490 keysD[1][1] = digitalRead(4); 491 keysD[1][2] = digitalRead(5); 492 keysD[1][3] = digitalRead(6); 493 keysD[1][4] = digitalRead(7); 494 keysD[1][5] = digitalRead(8); 495 keysD[2][0] = digitalRead(9); 496 keysD[2][1] = digitalRead(10); 497 keysD[2][2] = digitalRead(11); 498 499 //Keys 11-20 500 501 keysD[2][3] = digitalRead(12); 502 keysD[2][4] = digitalRead(13); 503 keysD[2][5] = digitalRead(14); 504 keysD[3][0] = digitalRead(15); 505 keysD[3][1] = digitalRead(16); 506 keysD[3][2] = digitalRead(17); 507 keysD[3][3] = digitalRead(18); 508 keysD[3][4] = digitalRead(19); 509 keysD[3][5] = digitalRead(20); 510 keysD[4][0] = digitalRead(21); 511 512 513 //Keys 21-30 514 515 keysD[4][1] = digitalRead(22); 516 keysD[4][2] = digitalRead(23); 517 keysD[4][3] = digitalRead(24); 518 keysD[4][4] = digitalRead(25); 519 keysD[4][5] = digitalRead(26); 520 keysD[5][0] = digitalRead(27); 521 keysD[5][1] = digitalRead(28); 522 keysD[5][2] = digitalRead(29); 523 keysD[5][3] = digitalRead(30); 524 keysD[5][4] = digitalRead(31); 525 526 //Keys 31-40 527 528 keysD[5][5] = digitalRead(32); 529 keysD[6][0] = digitalRead(33); 530 keysD[6][1] = digitalRead(34); 531 keysD[6][2] = digitalRead(35); 532 keysD[6][3] = digitalRead(36); 533 keysD[6][4] = digitalRead(37); 534 keysD[6][5] = digitalRead(38); 535 keysD[7][0] = digitalRead(39); 536 keysD[7][1] = digitalRead(40); 537 keysD[7][2] = digitalRead(41); 538 539 //Keys 41-50 540 541 keysD[7][3] = digitalRead(42); 542 keysD[7][4] = digitalRead(43); 543 keysD[7][5] = digitalRead(44); 544 keysD[8][0] = digitalRead(45); 545 keysD[8][1] = digitalRead(46); 546 keysD[8][2] = digitalRead(47); 547 keysD[8][3] = digitalRead(48); 548 keysD[8][4] = digitalRead(49); 549 keysD[8][5] = digitalRead(50); 550 keysD[9][0] = digitalRead(51); 551 552 //Keys 51-61 553 554 keysD[9][1] = digitalRead(52); 555 keysD[9][2] = digitalRead(53); 556 keysD[9][3] = digitalRead(A0); 557 keysD[9][4] = digitalRead(A1); 558 keysD[9][5] = digitalRead(A2); 559 keysD[10][0] = digitalRead(A3); 560 keysD[10][1] = digitalRead(A4); 561 keysD[10][2] = digitalRead(A5); 562 keysD[10][3] = digitalRead(A6); 563 keysD[10][4] = digitalRead(A7); 564 keysD[10][5] = digitalRead(A8); 565 566 pinMode(A12, INPUT); 567 568 //Return pins to Initialized state 569 570 //Pins 1-10 571 572 pinMode(2, INPUT); 573 pinMode(3, INPUT); 574 pinMode(4, INPUT); 575 pinMode(5, INPUT); 576 pinMode(6, INPUT); 577 pinMode(7, INPUT); 578 pinMode(8, INPUT); 579 pinMode(9, INPUT); 580 pinMode(10, INPUT); 581 pinMode(11, INPUT); 582 583 //Pins 11-20 584 585 pinMode(12, INPUT); 586 pinMode(13, INPUT); 587 pinMode(14, INPUT); 588 pinMode(15, INPUT); 589 pinMode(16, INPUT); 590 pinMode(17, INPUT); 591 pinMode(18, INPUT); 592 pinMode(19, INPUT); 593 pinMode(20, INPUT); 594 pinMode(21, INPUT); 595 596 //Pins 21-30 597 598 pinMode(22, INPUT); 599 pinMode(23, INPUT); 600 pinMode(24, INPUT); 601 pinMode(25, INPUT); 602 pinMode(26, INPUT); 603 pinMode(27, INPUT); 604 pinMode(28, INPUT); 605 pinMode(29, INPUT); 606 pinMode(30, INPUT); 607 pinMode(31, INPUT); 608 609 //Pins 31-40 610 611 pinMode(32, INPUT); 612 pinMode(33, INPUT); 613 pinMode(34, INPUT); 614 pinMode(35, INPUT); 615 pinMode(36, INPUT); 616 pinMode(37, INPUT); 617 pinMode(38, INPUT); 618 pinMode(39, INPUT); 619 pinMode(40, INPUT); 620 pinMode(41, INPUT); 621 622 //Pins 41-50 623 624 pinMode(42, INPUT); 625 pinMode(43, INPUT); 626 pinMode(44, INPUT); 627 pinMode(45, INPUT); 628 pinMode(46, INPUT); 629 pinMode(47, INPUT); 630 pinMode(48, INPUT); 631 pinMode(49, INPUT); 632 pinMode(50, INPUT); 633 pinMode(51, INPUT); 634 635 //Pins 51-61 636 637 pinMode(52, INPUT); 638 pinMode(53, INPUT); 639 pinMode(A0, INPUT); 640 pinMode(A1, INPUT); 641 pinMode(A2, INPUT); 642 pinMode(A3, INPUT); 643 pinMode(A4, INPUT); 644 pinMode(A5, INPUT); 645 pinMode(A6, INPUT); 646 pinMode(A7, INPUT); 647 pinMode(A8, INPUT); 648 649 //Column Pins 650 651 pinMode(A9, INPUT); 652 pinMode(A10, INPUT); 653 pinMode(A11, INPUT); 654 pinMode(A12, INPUT); 655 656 //Pot Pins 657 658 pinMode(A13, INPUT); 659 pinMode(A14, INPUT); 660 pinMode(A15, INPUT); 661 662 /* 663 //Invert Keyboard data only if needed. 664 //Example only for 32 pedals of a pedalboard, first 32 keys of keyboard C. 665 666 //Column 1 667 668 if (keysC[0][0] == 0) { 669 keysC[0][0] = 1; 670 } 671 else 672 if (keysC[0][0] == 1) { 673 keysC[0][0] = 0; 674 } 675 676 //Column 2 677 678 if (keysC[1][0] == 0) { 679 keysC[1][0] = 1; 680 } 681 else 682 if (keysC[1][0] == 1) { 683 keysC[1][0] = 0; 684 } 685 if (keysC[1][1] == 0) { 686 keysC[1][1] = 1; 687 } 688 else 689 if (keysC[1][1] == 1) { 690 keysC[1][1] = 0; 691 } 692 if (keysC[1][2] == 0) { 693 keysC[1][2] = 1; 694 } 695 else 696 if (keysC[1][2] == 1) { 697 keysC[1][2] = 0; 698 } 699 if (keysC[1][3] == 0) { 700 keysC[1][3] = 1; 701 } 702 else 703 if (keysC[1][3] == 1) { 704 keysC[1][3] = 0; 705 } 706 if (keysC[1][4] == 0) { 707 keysC[1][4] = 1; 708 } 709 else 710 if (keysC[1][4] == 1) { 711 keysC[1][4] = 0; 712 } 713 if (keysC[1][5] == 0) { 714 keysC[1][5] = 1; 715 } 716 else 717 if (keysC[1][5] == 1) { 718 keysC[1][5] = 0; 719 } 720 721 //Column 3 722 723 if (keysC[2][0] == 0) { 724 keysC[2][0] = 1; 725 } 726 else 727 if (keysC[2][0] == 1) { 728 keysC[2][0] = 0; 729 } 730 if (keysC[2][1] == 0) { 731 keysC[2][1] = 1; 732 } 733 else 734 if (keysC[2][1] == 1) { 735 keysC[2][1] = 0; 736 } 737 if (keysC[2][2] == 0) { 738 keysC[2][2] = 1; 739 } 740 else 741 if (keysC[2][2] == 1) { 742 keysC[2][2] = 0; 743 } 744 if (keysC[2][3] == 0) { 745 keysC[2][3] = 1; 746 } 747 else 748 if (keysC[2][3] == 1) { 749 keysC[2][3] = 0; 750 } 751 if (keysC[2][4] == 0) { 752 keysC[2][4] = 1; 753 } 754 else 755 if (keysC[2][4] == 1) { 756 keysC[2][4] = 0; 757 } 758 if (keysC[2][5] == 0) { 759 keysC[2][5] = 1; 760 } 761 else 762 if (keysC[2][5] == 1) { 763 keysC[2][5] = 0; 764 } 765 766 //Column 4 767 768 if (keysC[3][0] == 0) { 769 keysC[3][0] = 1; 770 } 771 else 772 if (keysC[3][0] == 1) { 773 keysC[3][0] = 0; 774 } 775 if (keysC[3][1] == 0) { 776 keysC[3][1] = 1; 777 } 778 else 779 if (keysC[3][1] == 1) { 780 keysC[3][1] = 0; 781 } 782 if (keysC[3][2] == 0) { 783 keysC[3][2] = 1; 784 } 785 else 786 if (keysC[3][2] == 1) { 787 keysC[3][2] = 0; 788 } 789 if (keysC[3][3] == 0) { 790 keysC[3][3] = 1; 791 } 792 else 793 if (keysC[3][3] == 1) { 794 keysC[3][3] = 0; 795 } 796 if (keysC[3][4] == 0) { 797 keysC[3][4] = 1; 798 } 799 else 800 if (keysC[3][4] == 1) { 801 keysC[3][4] = 0; 802 } 803 if (keysC[3][5] == 0) { 804 keysC[3][5] = 1; 805 } 806 else 807 if (keysC[3][5] == 1) { 808 keysC[3][5] = 0; 809 } 810 811 //Column 5 812 813 if (keysC[4][0] == 0) { 814 keysC[4][0] = 1; 815 } 816 else 817 if (keysC[4][0] == 1) { 818 keysC[4][0] = 0; 819 } 820 if (keysC[4][1] == 0) { 821 keysC[4][1] = 1; 822 } 823 else 824 if (keysC[4][1] == 1) { 825 keysC[4][1] = 0; 826 } 827 if (keysC[4][2] == 0) { 828 keysC[4][2] = 1; 829 } 830 else 831 if (keysC[4][2] == 1) { 832 keysC[4][2] = 0; 833 } 834 if (keysC[4][3] == 0) { 835 keysC[4][3] = 1; 836 } 837 else 838 if (keysC[4][3] == 1) { 839 keysC[4][3] = 0; 840 } 841 if (keysC[4][4] == 0) { 842 keysC[4][4] = 1; 843 } 844 else 845 if (keysC[4][4] == 1) { 846 keysC[4][4] = 0; 847 } 848 if (keysC[4][5] == 0) { 849 keysC[4][5] = 1; 850 } 851 else 852 if (keysC[4][5] == 1) { 853 keysC[4][5] = 0; 854 } 855 856 //Column 6 857 858 if (keysC[5][0] == 0) { 859 keysC[5][0] = 1; 860 } 861 else 862 if (keysC[5][0] == 1) { 863 keysC[5][0] = 0; 864 } 865 if (keysC[5][1] == 0) { 866 keysC[5][1] = 1; 867 } 868 else 869 if (keysC[5][1] == 1) { 870 keysC[5][1] = 0; 871 } 872 if (keysC[5][2] == 0) { 873 keysC[5][2] = 1; 874 } 875 else 876 if (keysC[5][2] == 1) { 877 keysC[5][2] = 0; 878 } 879 if (keysC[5][3] == 0) { 880 keysC[5][3] = 1; 881 } 882 else 883 if (keysC[5][3] == 1) { 884 keysC[5][3] = 0; 885 } 886 if (keysC[5][4] == 0) { 887 keysC[5][4] = 1; 888 } 889 else 890 if (keysC[5][4] == 1) { 891 keysC[5][4] = 0; 892 } 893 if (keysC[5][5] == 0) { 894 keysC[5][5] = 1; 895 } 896 else 897 if (keysC[5][5] == 1) { 898 keysC[5][5] = 0; 899 } 900 901 //Column 7 902 903 if (keysC[6][0] == 0) { 904 keysC[6][0] = 1; 905 } 906 else 907 if (keysC[6][0] == 1) { 908 keysC[6][0] = 0; 909 } 910 */ 911 912 //Write Keyboard A 913 914 //A36 915 if ((keysA[0][0] == 0) and (lastA[0][0] == 0)) { 916 MidiSend(noteOn1, 36, velocity); 917 lastA[0][0] = 7; 918 } 919 if ((keysA[0][0] == 1) and (lastA[0][0] == 7)) { 920 MidiSend(noteOff1, 36, velocity); 921 lastA[0][0] = 0; 922 } 923 924 //A37 925 if ((keysA[1][0] == 0) and (lastA[1][0] == 0)) { 926 MidiSend(noteOn1, 37, velocity); 927 lastA[1][0] = 7; 928 } 929 if ((keysA[1][0] == 1) and (lastA[1][0] == 7)) { 930 MidiSend(noteOff1, 37, velocity); 931 lastA[1][0] = 0; 932 } 933 934 //A38 935 if ((keysA[1][1] == 0) and (lastA[1][1] == 0)) { 936 MidiSend(noteOn1, 38, velocity); 937 lastA[1][1] = 7; 938 } 939 //Write Midi Note Off 940 if ((keysA[1][1] == 1) and (lastA[1][1] == 7)) { 941 MidiSend(noteOff1, 38, velocity); 942 lastA[1][1] = 0; 943 } 944 945 //A39 946 if ((keysA[1][2] == 0) and (lastA[1][2] == 0)) { 947 MidiSend(noteOn1, 39, velocity); 948 lastA[1][2] = 7; 949 } 950 //Write Midi Note Off 951 if ((keysA[1][2] == 1) and (lastA[1][2] == 7)) { 952 MidiSend(noteOff1, 39, velocity); 953 lastA[1][2] = 0; 954 } 955 956 //A40 957 if ((keysA[1][3] == 0) and (lastA[1][3] == 0)) { 958 MidiSend(noteOn1, 40, velocity); 959 lastA[1][3] = 7; 960 } 961 //Write Midi Note Off 962 if ((keysA[1][3] == 1) and (lastA[1][3] == 7)) { 963 MidiSend(noteOff1, 40, velocity); 964 lastA[1][3] = 0; 965 } 966 967 //A41 968 if ((keysA[1][4] == 0) and (lastA[1][4] == 0)) { 969 MidiSend(noteOn1, 41, velocity); 970 lastA[1][4] = 7; 971 } 972 //Write Midi Note Off 973 if ((keysA[1][4] == 1) and (lastA[1][4] == 7)) { 974 MidiSend(noteOff1, 41, velocity); 975 lastA[1][4] = 0; 976 } 977 978 //A42 979 if ((keysA[1][5] == 0) and (lastA[1][5] == 0)) { 980 MidiSend(noteOn1, 42, velocity); 981 lastA[1][5] = 7; 982 } 983 //Write Midi Note Off 984 if ((keysA[1][5] == 1) and (lastA[1][5] == 7)) { 985 MidiSend(noteOff1, 42, velocity); 986 lastA[1][5] = 0; 987 } 988 989 //A43 990 if ((keysA[2][0] == 0) and (lastA[2][0] == 0)) { 991 MidiSend(noteOn1, 43, velocity); 992 lastA[2][0] = 7; 993 } 994 //Write Midi Note Off 995 if ((keysA[2][0] == 1) and (lastA[2][0] == 7)) { 996 MidiSend(noteOff1, 43, velocity); 997 lastA[2][0] = 0; 998 } 999 1000 //A44 1001 if ((keysA[2][1] == 0) and (lastA[2][1] == 0)) { 1002 MidiSend(noteOn1, 44, velocity); 1003 lastA[2][1] = 7; 1004 } 1005 //Write Midi Note Off 1006 if ((keysA[2][1] == 1) and (lastA[2][1] == 7)) { 1007 MidiSend(noteOff1, 44, velocity); 1008 lastA[2][1] = 0; 1009 } 1010 1011 //A45 1012 if ((keysA[2][2] == 0) and (lastA[2][2] == 0)) { 1013 MidiSend(noteOn1, 45, velocity); 1014 lastA[2][2] = 7; 1015 } 1016 //Write Midi Note Off 1017 if ((keysA[2][2] == 1) and (lastA[2][2] == 7)) { 1018 MidiSend(noteOff1, 45, velocity); 1019 lastA[2][2] = 0; 1020 } 1021 1022 //A46 1023 if ((keysA[2][3] == 0) and (lastA[2][3] == 0)) { 1024 MidiSend(noteOn1, 46, velocity); 1025 lastA[2][3] = 7; 1026 } 1027 //Write Midi Note Off 1028 if ((keysA[2][3] == 1) and (lastA[2][3] == 7)) { 1029 MidiSend(noteOff1, 46, velocity); 1030 lastA[2][3] = 0; 1031 } 1032 1033 //A47 1034 if ((keysA[2][4] == 0) and (lastA[2][4] == 0)) { 1035 MidiSend(noteOn1, 47, velocity); 1036 lastA[2][4] = 7; 1037 } 1038 //Write Midi Note Off 1039 if ((keysA[2][4] == 1) and (lastA[2][4] == 7)) { 1040 MidiSend(noteOff1, 47, velocity); 1041 lastA[2][4] = 0; 1042 } 1043 1044 //A48 1045 if ((keysA[2][5] == 0) and (lastA[2][5] == 0)) { 1046 MidiSend(noteOn1, 48, velocity); 1047 lastA[2][5] = 7; 1048 } 1049 //Write Midi Note Off 1050 if ((keysA[2][5] == 1) and (lastA[2][5] == 7)) { 1051 MidiSend(noteOff1, 48, velocity); 1052 lastA[2][5] = 0; 1053 } 1054 1055 //A49 1056 if ((keysA[3][0] == 0) and (lastA[3][0] == 0)) { 1057 MidiSend(noteOn1, 49, velocity); 1058 lastA[3][0] = 7; 1059 } 1060 //Write Midi Note Off 1061 if ((keysA[3][0] == 1) and (lastA[3][0] == 7)) { 1062 MidiSend(noteOff1, 49, velocity); 1063 lastA[3][0] = 0; 1064 } 1065 1066 //A50 1067 if ((keysA[3][1] == 0) and (lastA[3][1] == 0)) { 1068 MidiSend(noteOn1, 50, velocity); 1069 lastA[3][1] = 7; 1070 } 1071 //Write Midi Note Off 1072 if ((keysA[3][1] == 1) and (lastA[3][1] == 7)) { 1073 MidiSend(noteOff1, 50, velocity); 1074 lastA[3][1] = 0; 1075 } 1076 1077 //A51 1078 if ((keysA[3][2] == 0) and (lastA[3][2] == 0)) { 1079 MidiSend(noteOn1, 51, velocity); 1080 lastA[3][2] = 7; 1081 } 1082 //Write Midi Note Off 1083 if ((keysA[3][2] == 1) and (lastA[3][2] == 7)) { 1084 MidiSend(noteOff1, 51, velocity); 1085 lastA[3][2] = 0; 1086 } 1087 1088 //A52 1089 if ((keysA[3][3] == 0) and (lastA[3][3] == 0)) { 1090 MidiSend(noteOn1, 52, velocity); 1091 lastA[3][3] = 7; 1092 } 1093 //Write Midi Note Off 1094 if ((keysA[3][3] == 1) and (lastA[3][3] == 7)) { 1095 MidiSend(noteOff1, 52, velocity); 1096 lastA[3][3] = 0; 1097 } 1098 1099 //A53 1100 if ((keysA[3][4] == 0) and (lastA[3][4] == 0)) { 1101 MidiSend(noteOn1, 53, velocity); 1102 lastA[3][4] = 7; 1103 } 1104 //Write Midi Note Off 1105 if ((keysA[3][4] == 1) and (lastA[3][4] == 7)) { 1106 MidiSend(noteOff1, 53, velocity); 1107 lastA[3][4] = 0; 1108 } 1109 1110 //A54 1111 if ((keysA[3][5] == 0) and (lastA[3][5] == 0)) { 1112 MidiSend(noteOn1, 54, velocity); 1113 lastA[3][5] = 7; 1114 } 1115 //Write Midi Note Off 1116 if ((keysA[3][5] == 1) and (lastA[3][5] == 7)) { 1117 MidiSend(noteOff1, 54, velocity); 1118 lastA[3][5] = 0; 1119 } 1120 1121 //A55 1122 if ((keysA[4][0] == 0) and (lastA[4][0] == 0)) { 1123 MidiSend(noteOn1, 55, velocity); 1124 lastA[4][0] = 7; 1125 } 1126 //Write Midi Note Off 1127 if ((keysA[4][0] == 1) and (lastA[4][0] == 7)) { 1128 MidiSend(noteOff1, 55, velocity); 1129 lastA[4][0] = 0; 1130 } 1131 1132 //A56 1133 if ((keysA[4][1] == 0) and (lastA[4][1] == 0)) { 1134 MidiSend(noteOn1, 56, velocity); 1135 lastA[4][1] = 7; 1136 } 1137 //Write Midi Note Off 1138 if ((keysA[4][1] == 1) and (lastA[4][1] == 7)) { 1139 MidiSend(noteOff1, 56, velocity); 1140 lastA[4][1] = 0; 1141 } 1142 1143 //A57 1144 if ((keysA[4][2] == 0) and (lastA[4][2] == 0)) { 1145 MidiSend(noteOn1, 57, velocity); 1146 lastA[4][2] = 7; 1147 } 1148 //Write Midi Note Off 1149 if ((keysA[4][2] == 1) and (lastA[4][2] == 7)) { 1150 MidiSend(noteOff1, 57, velocity); 1151 lastA[4][2] = 0; 1152 } 1153 1154 //A58 1155 if ((keysA[4][3] == 0) and (lastA[4][3] == 0)) { 1156 MidiSend(noteOn1, 58, velocity); 1157 lastA[4][3] = 7; 1158 } 1159 //Write Midi Note Off 1160 if ((keysA[4][3] == 1) and (lastA[4][3] == 7)) { 1161 MidiSend(noteOff1, 58, velocity); 1162 lastA[4][3] = 0; 1163 } 1164 1165 //59 1166 if ((keysA[4][4] == 0) and (lastA[4][4] == 0)) { 1167 MidiSend(noteOn1, 59, velocity); 1168 lastA[4][4] = 7; 1169 } 1170 //Write Midi Note Off 1171 if ((keysA[4][4] == 1) and (lastA[4][4] == 7)) { 1172 MidiSend(noteOff1, 59, velocity); 1173 lastA[4][4] = 0; 1174 } 1175 1176 //A60 1177 if ((keysA[4][5] == 0) and (lastA[4][5] == 0)) { 1178 MidiSend(noteOn1, 60, velocity); 1179 lastA[4][5] = 7; 1180 } 1181 //Write Midi Note Off 1182 if ((keysA[4][5] == 1) and (lastA[4][5] == 7)) { 1183 MidiSend(noteOff1, 60, velocity); 1184 lastA[4][5] = 0; 1185 } 1186 1187 //A61 1188 if ((keysA[5][0] == 0) and (lastA[5][0] == 0)) { 1189 MidiSend(noteOn1, 61, velocity); 1190 lastA[5][0] = 7; 1191 } 1192 //Write Midi Note Off 1193 if ((keysA[5][0] == 1) and (lastA[5][0] == 7)) { 1194 MidiSend(noteOff1, 61, velocity); 1195 lastA[5][0] = 0; 1196 } 1197 1198 //A62 1199 if ((keysA[5][1] == 0) and (lastA[5][1] == 0)) { 1200 MidiSend(noteOn1, 62, velocity); 1201 lastA[5][1] = 7; 1202 } 1203 //Write Midi Note Off 1204 if ((keysA[5][1] == 1) and (lastA[5][1] == 7)) { 1205 MidiSend(noteOff1, 62, velocity); 1206 lastA[5][1] = 0; 1207 } 1208 1209 //A63 1210 if ((keysA[5][2] == 0) and (lastA[5][2] == 0)) { 1211 MidiSend(noteOn1, 63, velocity); 1212 lastA[5][2] = 7; 1213 } 1214 //Write Midi Note Off 1215 if ((keysA[5][2] == 1) and (lastA[5][2] == 7)) { 1216 MidiSend(noteOff1, 63, velocity); 1217 lastA[5][2] = 0; 1218 } 1219 1220 //A64 1221 if ((keysA[5][3] == 0) and (lastA[5][3] == 0)) { 1222 MidiSend(noteOn1, 64, velocity); 1223 lastA[5][3] = 7; 1224 } 1225 //Write Midi Note Off 1226 if ((keysA[5][3] == 1) and (lastA[5][3] == 7)) { 1227 MidiSend(noteOff1, 64, velocity); 1228 lastA[5][3] = 0; 1229 } 1230 1231 //A65 1232 if ((keysA[5][4] == 0) and (lastA[5][4] == 0)) { 1233 MidiSend(noteOn1, 65, velocity); 1234 lastA[5][4] = 7; 1235 } 1236 //Write Midi Note Off 1237 if ((keysA[5][4] == 1) and (lastA[5][4] == 7)) { 1238 MidiSend(noteOff1, 65, velocity); 1239 lastA[5][4] = 0; 1240 } 1241 1242 //A66 1243 if ((keysA[5][5] == 0) and (lastA[5][5] == 0)) { 1244 MidiSend(noteOn1, 66, velocity); 1245 lastA[5][5] = 7; 1246 } 1247 //Write Midi Note Off 1248 if ((keysA[5][5] == 1) and (lastA[5][5] == 7)) { 1249 MidiSend(noteOff1, 66, velocity); 1250 lastA[5][5] = 0; 1251 } 1252 1253 //A67 1254 if ((keysA[6][0] == 0) and (lastA[6][0] == 0)) { 1255 MidiSend(noteOn1, 67, velocity); 1256 lastA[6][0] = 7; 1257 } 1258 //Write Midi Note Off 1259 if ((keysA[6][0] == 1) and (lastA[6][0] == 7)) { 1260 MidiSend(noteOff1, 67, velocity); 1261 lastA[6][0] = 0; 1262 } 1263 1264 //A68 1265 if ((keysA[6][1] == 0) and (lastA[6][1] == 0)) { 1266 MidiSend(noteOn1, 68, velocity); 1267 lastA[6][1] = 7; 1268 } 1269 //Write Midi Note Off 1270 if ((keysA[6][1] == 1) and (lastA[6][1] == 7)) { 1271 MidiSend(noteOff1, 68, velocity); 1272 lastA[6][1] = 0; 1273 } 1274 1275 //A69 1276 if ((keysA[6][2] == 0) and (lastA[6][2] == 0)) { 1277 MidiSend(noteOn1, 69, velocity); 1278 lastA[6][2] = 7; 1279 } 1280 //Write Midi Note Off 1281 if ((keysA[6][2] == 1) and (lastA[6][2] == 7)) { 1282 MidiSend(noteOff1, 69, velocity); 1283 lastA[6][2] = 0; 1284 } 1285 1286 //A70 1287 if ((keysA[6][3] == 0) and (lastA[6][3] == 0)) { 1288 MidiSend(noteOn1, 70, velocity); 1289 lastA[6][3] = 7; 1290 } 1291 //Write Midi Note Off 1292 if ((keysA[6][3] == 1) and (lastA[6][3] == 7)) { 1293 MidiSend(noteOff1, 70, velocity); 1294 lastA[6][3] = 0; 1295 } 1296 1297 //A71 1298 if ((keysA[6][4] == 0) and (lastA[6][4] == 0)) { 1299 MidiSend(noteOn1, 71, velocity); 1300 lastA[6][4] = 7; 1301 } 1302 //Write Midi Note Off 1303 if ((keysA[6][4] == 1) and (lastA[6][4] == 7)) { 1304 MidiSend(noteOff1, 71, velocity); 1305 lastA[6][4] = 0; 1306 } 1307 1308 //A72 1309 if ((keysA[6][5] == 0) and (lastA[6][5] == 0)) { 1310 MidiSend(noteOn1, 72, velocity); 1311 lastA[6][5] = 7; 1312 } 1313 //Write Midi Note Off 1314 if ((keysA[6][5] == 1) and (lastA[6][5] == 7)) { 1315 MidiSend(noteOff1, 72, velocity); 1316 lastA[6][5] = 0; 1317 } 1318 1319 //A73 1320 if ((keysA[7][0] == 0) and (lastA[7][0] == 0)) { 1321 MidiSend(noteOn1, 73, velocity); 1322 lastA[7][0] = 7; 1323 } 1324 //Write Midi Note Off 1325 if ((keysA[7][0] == 1) and (lastA[7][0] == 7)) { 1326 MidiSend(noteOff1, 73, velocity); 1327 lastA[7][0] = 0; 1328 } 1329 1330 //A74 1331 if ((keysA[7][1] == 0) and (lastA[7][1] == 0)) { 1332 MidiSend(noteOn1, 74, velocity); 1333 lastA[7][1] = 7; 1334 } 1335 //Write Midi Note Off 1336 if ((keysA[7][1] == 1) and (lastA[7][1] == 7)) { 1337 MidiSend(noteOff1, 74, velocity); 1338 lastA[7][1] = 0; 1339 } 1340 1341 //A75 1342 if ((keysA[7][2] == 0) and (lastA[7][2] == 0)) { 1343 MidiSend(noteOn1, 75, velocity); 1344 lastA[7][2] = 7; 1345 } 1346 //Write Midi Note Off 1347 if ((keysA[7][2] == 1) and (lastA[7][2] == 7)) { 1348 MidiSend(noteOff1, 75, velocity); 1349 lastA[7][2] = 0; 1350 } 1351 1352 //A76 1353 if ((keysA[7][3] == 0) and (lastA[7][3] == 0)) { 1354 MidiSend(noteOn1, 76, velocity); 1355 lastA[7][3] = 7; 1356 } 1357 //Write Midi Note Off 1358 if ((keysA[7][3] == 1) and (lastA[7][3] == 7)) { 1359 MidiSend(noteOff1, 76, velocity); 1360 lastA[7][3] = 0; 1361 } 1362 1363 //A77 1364 if ((keysA[7][4] == 0) and (lastA[7][4] == 0)) { 1365 MidiSend(noteOn1, 77, velocity); 1366 lastA[7][4] = 7; 1367 } 1368 //Write Midi Note Off 1369 if ((keysA[7][4] == 1) and (lastA[7][4] == 7)) { 1370 MidiSend(noteOff1, 77, velocity); 1371 lastA[7][4] = 0; 1372 } 1373 1374 //A78 1375 if ((keysA[7][5] == 0) and (lastA[7][5] == 0)) { 1376 MidiSend(noteOn1, 78, velocity); 1377 lastA[7][5] = 7; 1378 } 1379 //Write Midi Note Off 1380 if ((keysA[7][5] == 1) and (lastA[7][5] == 7)) { 1381 MidiSend(noteOff1, 78, velocity); 1382 lastA[7][5] = 0; 1383 } 1384 1385 //A79 1386 if ((keysA[8][0] == 0) and (lastA[8][0] == 0)) { 1387 MidiSend(noteOn1, 79, velocity); 1388 lastA[8][0] = 7; 1389 } 1390 //Write Midi Note Off 1391 if ((keysA[8][0] == 1) and (lastA[8][0] == 7)) { 1392 MidiSend(noteOff1, 79, velocity); 1393 lastA[8][0] = 0; 1394 } 1395 1396 //A80 1397 if ((keysA[8][1] == 0) and (lastA[8][1] == 0)) { 1398 MidiSend(noteOn1, 80, velocity); 1399 lastA[8][1] = 7; 1400 } 1401 //Write Midi Note Off 1402 if ((keysA[8][1] == 1) and (lastA[8][1] == 7)) { 1403 MidiSend(noteOff1, 80, velocity); 1404 lastA[8][1] = 0; 1405 } 1406 1407 //A81 1408 if ((keysA[8][2] == 0) and (lastA[8][2] == 0)) { 1409 MidiSend(noteOn1, 81, velocity); 1410 lastA[8][2] = 7; 1411 } 1412 //Write Midi Note Off 1413 if ((keysA[8][2] == 1) and (lastA[8][2] == 7)) { 1414 MidiSend(noteOff1, 81, velocity); 1415 lastA[8][2] = 0; 1416 } 1417 1418 //A82 1419 if ((keysA[8][3] == 0) and (lastA[8][3] == 0)) { 1420 MidiSend(noteOn1, 82, velocity); 1421 lastA[8][3] = 7; 1422 } 1423 //Write Midi Note Off 1424 if ((keysA[8][3] == 1) and (lastA[8][3] == 7)) { 1425 MidiSend(noteOff1, 82, velocity); 1426 lastA[8][3] = 0; 1427 } 1428 1429 //A83 1430 if ((keysA[8][4] == 0) and (lastA[8][4] == 0)) { 1431 MidiSend(noteOn1, 83, velocity); 1432 lastA[8][4] = 7; 1433 } 1434 //Write Midi Note Off 1435 if ((keysA[8][4] == 1) and (lastA[8][4] == 7)) { 1436 MidiSend(noteOff1, 83, velocity); 1437 lastA[8][4] = 0; 1438 } 1439 1440 //A84 1441 if ((keysA[8][5] == 0) and (lastA[8][5] == 0)) { 1442 MidiSend(noteOn1, 84, velocity); 1443 lastA[8][5] = 7; 1444 } 1445 //Write Midi Note Off 1446 if ((keysA[8][5] == 1) and (lastA[8][5] == 7)) { 1447 MidiSend(noteOff1, 84, velocity); 1448 lastA[8][5] = 0; 1449 } 1450 1451 //A85 1452 if ((keysA[9][0] == 0) and (lastA[9][0] == 0)) { 1453 MidiSend(noteOn1, 85, velocity); 1454 lastA[9][0] = 7; 1455 } 1456 //Write Midi Note Off 1457 if ((keysA[9][0] == 1) and (lastA[9][0] == 7)) { 1458 MidiSend(noteOff1, 85, velocity); 1459 lastA[9][0] = 0; 1460 } 1461 1462 //A86 1463 if ((keysA[9][1] == 0) and (lastA[9][1] == 0)) { 1464 MidiSend(noteOn1, 86, velocity); 1465 lastA[9][1] = 7; 1466 } 1467 //Write Midi Note Off 1468 if ((keysA[9][1] == 1) and (lastA[9][1] == 7)) { 1469 MidiSend(noteOff1, 86, velocity); 1470 lastA[9][1] = 0; 1471 } 1472 1473 //A87 1474 if ((keysA[9][2] == 0) and (lastA[9][2] == 0)) { 1475 MidiSend(noteOn1, 87, velocity); 1476 lastA[9][2] = 7; 1477 } 1478 //Write Midi Note Off 1479 if ((keysA[9][2] == 1) and (lastA[9][2] == 7)) { 1480 MidiSend(noteOff1, 87, velocity); 1481 lastA[9][2] = 0; 1482 } 1483 1484 //A88 1485 if ((keysA[9][3] == 0) and (lastA[9][3] == 0)) { 1486 MidiSend(noteOn1, 88, velocity); 1487 lastA[9][3] = 7; 1488 } 1489 //Write Midi Note Off 1490 if ((keysA[9][3] == 1) and (lastA[9][3] == 7)) { 1491 MidiSend(noteOff1, 88, velocity); 1492 lastA[9][3] = 0; 1493 } 1494 1495 //A89 1496 if ((keysA[9][4] == 0) and (lastA[9][4] == 0)) { 1497 MidiSend(noteOn1, 89, velocity); 1498 lastA[9][4] = 7; 1499 } 1500 //Write Midi Note Off 1501 if ((keysA[9][4] == 1) and (lastA[9][4] == 7)) { 1502 MidiSend(noteOff1, 89, velocity); 1503 lastA[9][4] = 0; 1504 } 1505 1506 //A90 1507 if ((keysA[9][5] == 0) and (lastA[9][5] == 0)) { 1508 MidiSend(noteOn1, 90, velocity); 1509 lastA[9][5] = 7; 1510 } 1511 //Write Midi Note Off 1512 if ((keysA[9][5] == 1) and (lastA[9][5] == 7)) { 1513 MidiSend(noteOff1, 90, velocity); 1514 lastA[9][5] = 0; 1515 } 1516 1517 //A91 1518 if ((keysA[10][0] == 0) and (lastA[10][0] == 0)) { 1519 MidiSend(noteOn1, 91, velocity); 1520 lastA[10][0] = 7; 1521 } 1522 //Write Midi Note Off 1523 if ((keysA[10][0] == 1) and (lastA[10][0] == 7)) { 1524 MidiSend(noteOff1, 91, velocity); 1525 lastA[10][0] = 0; 1526 } 1527 1528 //A92 1529 if ((keysA[10][1] == 0) and (lastA[10][1] == 0)) { 1530 MidiSend(noteOn1, 92, velocity); 1531 lastA[10][1] = 7; 1532 } 1533 //Write Midi Note Off 1534 if ((keysA[10][1] == 1) and (lastA[10][1] == 7)) { 1535 MidiSend(noteOff1, 92, velocity); 1536 lastA[10][1] = 0; 1537 } 1538 1539 //A93 1540 if ((keysA[10][2] == 0) and (lastA[10][2] == 0)) { 1541 MidiSend(noteOn1, 93, velocity); 1542 lastA[10][2] = 7; 1543 } 1544 //Write Midi Note Off 1545 if ((keysA[10][2] == 1) and (lastA[10][2] == 7)) { 1546 MidiSend(noteOff1, 93, velocity); 1547 lastA[10][2] = 0; 1548 } 1549 1550 //A94 1551 if ((keysA[10][3] == 0) and (lastA[10][3] == 0)) { 1552 MidiSend(noteOn1, 94, velocity); 1553 lastA[10][3] = 7; 1554 } 1555 //Write Midi Note Off 1556 if ((keysA[10][3] == 1) and (lastA[10][3] == 7)) { 1557 MidiSend(noteOff1, 94, velocity); 1558 lastA[10][3] = 0; 1559 } 1560 1561 //A95 1562 if ((keysA[10][4] == 0) and (lastA[10][4] == 0)) { 1563 MidiSend(noteOn1, 95, velocity); 1564 lastA[10][4] = 7; 1565 } 1566 //Write Midi Note Off 1567 if ((keysA[10][4] == 1) and (lastA[10][4] == 7)) { 1568 MidiSend(noteOff1, 95, velocity); 1569 lastA[10][4] = 0; 1570 } 1571 1572 //A96 1573 if ((keysA[10][5] == 0) and (lastA[10][5] == 0)) { 1574 MidiSend(noteOn1, 96, velocity); 1575 lastA[10][5] = 7; 1576 } 1577 //Write Midi Note Off 1578 if ((keysA[10][5] == 1) and (lastA[10][5] == 7)) { 1579 MidiSend(noteOff1, 96, velocity); 1580 lastA[10][5] = 0; 1581 } 1582 1583 //Write Keyboard B 1584 1585 //B36 1586 if ((keysB[0][0] == 0) and (lastB[0][0] == 0)) { 1587 MidiSend(noteOn2, 36, velocity); 1588 lastB[0][0] = 7; 1589 } 1590 if ((keysB[0][0] == 1) and (lastB[0][0] == 7)) { 1591 MidiSend(noteOff2, 36, velocity); 1592 lastB[0][0] = 0; 1593 } 1594 1595 //B37 1596 if ((keysB[1][0] == 0) and (lastB[1][0] == 0)) { 1597 MidiSend(noteOn2, 37, velocity); 1598 lastB[1][0] = 7; 1599 } 1600 if ((keysB[1][0] == 1) and (lastB[1][0] == 7)) { 1601 MidiSend(noteOff2, 37, velocity); 1602 lastB[1][0] = 0; 1603 } 1604 1605 //B38 1606 if ((keysB[1][1] == 0) and (lastB[1][1] == 0)) { 1607 MidiSend(noteOn2, 38, velocity); 1608 lastB[1][1] = 7; 1609 } 1610 //Write Midi Note Off 1611 if ((keysB[1][1] == 1) and (lastB[1][1] == 7)) { 1612 MidiSend(noteOff2, 38, velocity); 1613 lastB[1][1] = 0; 1614 } 1615 1616 //B39 1617 if ((keysB[1][2] == 0) and (lastB[1][2] == 0)) { 1618 MidiSend(noteOn2, 39, velocity); 1619 lastB[1][2] = 7; 1620 } 1621 //Write Midi Note Off 1622 if ((keysB[1][2] == 1) and (lastB[1][2] == 7)) { 1623 MidiSend(noteOff2, 39, velocity); 1624 lastB[1][2] = 0; 1625 } 1626 1627 //B40 1628 if ((keysB[1][3] == 0) and (lastB[1][3] == 0)) { 1629 MidiSend(noteOn2, 40, velocity); 1630 lastB[1][3] = 7; 1631 } 1632 //Write Midi Note Off 1633 if ((keysB[1][3] == 1) and (lastB[1][3] == 7)) { 1634 MidiSend(noteOff2, 40, velocity); 1635 lastB[1][3] = 0; 1636 } 1637 1638 //B41 1639 if ((keysB[1][4] == 0) and (lastB[1][4] == 0)) { 1640 MidiSend(noteOn2, 41, velocity); 1641 lastB[1][4] = 7; 1642 } 1643 //Write Midi Note Off 1644 if ((keysB[1][4] == 1) and (lastB[1][4] == 7)) { 1645 MidiSend(noteOff2, 41, velocity); 1646 lastB[1][4] = 0; 1647 } 1648 1649 //B42 1650 if ((keysB[1][5] == 0) and (lastB[1][5] == 0)) { 1651 MidiSend(noteOn2, 42, velocity); 1652 lastB[1][5] = 7; 1653 } 1654 //Write Midi Note Off 1655 if ((keysB[1][5] == 1) and (lastB[1][5] == 7)) { 1656 MidiSend(noteOff2, 42, velocity); 1657 lastB[1][5] = 0; 1658 } 1659 1660 //B43 1661 if ((keysB[2][0] == 0) and (lastB[2][0] == 0)) { 1662 MidiSend(noteOn2, 43, velocity); 1663 lastB[2][0] = 7; 1664 } 1665 //Write Midi Note Off 1666 if ((keysB[2][0] == 1) and (lastB[2][0] == 7)) { 1667 MidiSend(noteOff2, 43, velocity); 1668 lastB[2][0] = 0; 1669 } 1670 1671 //B44 1672 if ((keysB[2][1] == 0) and (lastB[2][1] == 0)) { 1673 MidiSend(noteOn2, 44, velocity); 1674 lastB[2][1] = 7; 1675 } 1676 //Write Midi Note Off 1677 if ((keysB[2][1] == 1) and (lastB[2][1] == 7)) { 1678 MidiSend(noteOff2, 44, velocity); 1679 lastB[2][1] = 0; 1680 } 1681 1682 //B45 1683 if ((keysB[2][2] == 0) and (lastB[2][2] == 0)) { 1684 MidiSend(noteOn2, 45, velocity); 1685 lastB[2][2] = 7; 1686 } 1687 //Write Midi Note Off 1688 if ((keysB[2][2] == 1) and (lastB[2][2] == 7)) { 1689 MidiSend(noteOff2, 45, velocity); 1690 lastB[2][2] = 0; 1691 } 1692 1693 //B46 1694 if ((keysB[2][3] == 0) and (lastB[2][3] == 0)) { 1695 MidiSend(noteOn2, 46, velocity); 1696 lastB[2][3] = 7; 1697 } 1698 //Write Midi Note Off 1699 if ((keysB[2][3] == 1) and (lastB[2][3] == 7)) { 1700 MidiSend(noteOff2, 46, velocity); 1701 lastB[2][3] = 0; 1702 } 1703 1704 //B47 1705 if ((keysB[2][4] == 0) and (lastB[2][4] == 0)) { 1706 MidiSend(noteOn2, 47, velocity); 1707 lastB[2][4] = 7; 1708 } 1709 //Write Midi Note Off 1710 if ((keysB[2][4] == 1) and (lastB[2][4] == 7)) { 1711 MidiSend(noteOff2, 47, velocity); 1712 lastB[2][4] = 0; 1713 } 1714 1715 //B48 1716 if ((keysB[2][5] == 0) and (lastB[2][5] == 0)) { 1717 MidiSend(noteOn2, 48, velocity); 1718 lastB[2][5] = 7; 1719 } 1720 //Write Midi Note Off 1721 if ((keysB[2][5] == 1) and (lastB[2][5] == 7)) { 1722 MidiSend(noteOff2, 48, velocity); 1723 lastB[2][5] = 0; 1724 } 1725 1726 //B49 1727 if ((keysB[3][0] == 0) and (lastB[3][0] == 0)) { 1728 MidiSend(noteOn2, 49, velocity); 1729 lastB[3][0] = 7; 1730 } 1731 //Write Midi Note Off 1732 if ((keysB[3][0] == 1) and (lastB[3][0] == 7)) { 1733 MidiSend(noteOff2, 49, velocity); 1734 lastB[3][0] = 0; 1735 } 1736 1737 //B50 1738 if ((keysB[3][1] == 0) and (lastB[3][1] == 0)) { 1739 MidiSend(noteOn2, 50, velocity); 1740 lastB[3][1] = 7; 1741 } 1742 //Write Midi Note Off 1743 if ((keysB[3][1] == 1) and (lastB[3][1] == 7)) { 1744 MidiSend(noteOff2, 50, velocity); 1745 lastB[3][1] = 0; 1746 } 1747 1748 //B51 1749 if ((keysB[3][2] == 0) and (lastB[3][2] == 0)) { 1750 MidiSend(noteOn2, 51, velocity); 1751 lastB[3][2] = 7; 1752 } 1753 //Write Midi Note Off 1754 if ((keysB[3][2] == 1) and (lastB[3][2] == 7)) { 1755 MidiSend(noteOff2, 51, velocity); 1756 lastB[3][2] = 0; 1757 } 1758 1759 //B52 1760 if ((keysB[3][3] == 0) and (lastB[3][3] == 0)) { 1761 MidiSend(noteOn2, 52, velocity); 1762 lastB[3][3] = 7; 1763 } 1764 //Write Midi Note Off 1765 if ((keysB[3][3] == 1) and (lastB[3][3] == 7)) { 1766 MidiSend(noteOff2, 52, velocity); 1767 lastB[3][3] = 0; 1768 } 1769 1770 //B53 1771 if ((keysB[3][4] == 0) and (lastB[3][4] == 0)) { 1772 MidiSend(noteOn2, 53, velocity); 1773 lastB[3][4] = 7; 1774 } 1775 //Write Midi Note Off 1776 if ((keysB[3][4] == 1) and (lastB[3][4] == 7)) { 1777 MidiSend(noteOff2, 53, velocity); 1778 lastB[3][4] = 0; 1779 } 1780 1781 //B54 1782 if ((keysB[3][5] == 0) and (lastB[3][5] == 0)) { 1783 MidiSend(noteOn2, 54, velocity); 1784 lastB[3][5] = 7; 1785 } 1786 //Write Midi Note Off 1787 if ((keysB[3][5] == 1) and (lastB[3][5] == 7)) { 1788 MidiSend(noteOff2, 54, velocity); 1789 lastB[3][5] = 0; 1790 } 1791 1792 //B55 1793 if ((keysB[4][0] == 0) and (lastB[4][0] == 0)) { 1794 MidiSend(noteOn2, 55, velocity); 1795 lastB[4][0] = 7; 1796 } 1797 //Write Midi Note Off 1798 if ((keysB[4][0] == 1) and (lastB[4][0] == 7)) { 1799 MidiSend(noteOff2, 55, velocity); 1800 lastB[4][0] = 0; 1801 } 1802 1803 //B56 1804 if ((keysB[4][1] == 0) and (lastB[4][1] == 0)) { 1805 MidiSend(noteOn2, 56, velocity); 1806 lastB[4][1] = 7; 1807 } 1808 //Write Midi Note Off 1809 if ((keysB[4][1] == 1) and (lastB[4][1] == 7)) { 1810 MidiSend(noteOff2, 56, velocity); 1811 lastB[4][1] = 0; 1812 } 1813 1814 //B57 1815 if ((keysB[4][2] == 0) and (lastB[4][2] == 0)) { 1816 MidiSend(noteOn2, 57, velocity); 1817 lastB[4][2] = 7; 1818 } 1819 //Write Midi Note Off 1820 if ((keysB[4][2] == 1) and (lastB[4][2] == 7)) { 1821 MidiSend(noteOff2, 57, velocity); 1822 lastB[4][2] = 0; 1823 } 1824 1825 //B58 1826 if ((keysB[4][3] == 0) and (lastB[4][3] == 0)) { 1827 MidiSend(noteOn2, 58, velocity); 1828 lastB[4][3] = 7; 1829 } 1830 //Write Midi Note Off 1831 if ((keysB[4][3] == 1) and (lastB[4][3] == 7)) { 1832 MidiSend(noteOff2, 58, velocity); 1833 lastB[4][3] = 0; 1834 } 1835 1836 //B59 1837 if ((keysB[4][4] == 0) and (lastB[4][4] == 0)) { 1838 MidiSend(noteOn2, 59, velocity); 1839 lastB[4][4] = 7; 1840 } 1841 //Write Midi Note Off 1842 if ((keysB[4][4] == 1) and (lastB[4][4] == 7)) { 1843 MidiSend(noteOff2, 59, velocity); 1844 lastB[4][4] = 0; 1845 } 1846 1847 //B60 1848 if ((keysB[4][5] == 0) and (lastB[4][5] == 0)) { 1849 MidiSend(noteOn2, 60, velocity); 1850 lastB[4][5] = 7; 1851 } 1852 //Write Midi Note Off 1853 if ((keysB[4][5] == 1) and (lastB[4][5] == 7)) { 1854 MidiSend(noteOff2, 60, velocity); 1855 lastB[4][5] = 0; 1856 } 1857 1858 //B61 1859 if ((keysB[5][0] == 0) and (lastB[5][0] == 0)) { 1860 MidiSend(noteOn2, 61, velocity); 1861 lastB[5][0] = 7; 1862 } 1863 //Write Midi Note Off 1864 if ((keysB[5][0] == 1) and (lastB[5][0] == 7)) { 1865 MidiSend(noteOff2, 61, velocity); 1866 lastB[5][0] = 0; 1867 } 1868 1869 //B62 1870 if ((keysB[5][1] == 0) and (lastB[5][1] == 0)) { 1871 MidiSend(noteOn2, 62, velocity); 1872 lastB[5][1] = 7; 1873 } 1874 //Write Midi Note Off 1875 if ((keysB[5][1] == 1) and (lastB[5][1] == 7)) { 1876 MidiSend(noteOff2, 62, velocity); 1877 lastB[5][1] = 0; 1878 } 1879 1880 //B63 1881 if ((keysB[5][2] == 0) and (lastB[5][2] == 0)) { 1882 MidiSend(noteOn2, 63, velocity); 1883 lastB[5][2] = 7; 1884 } 1885 //Write Midi Note Off 1886 if ((keysB[5][2] == 1) and (lastB[5][2] == 7)) { 1887 MidiSend(noteOff2, 63, velocity); 1888 lastB[5][2] = 0; 1889 } 1890 1891 //B64 1892 if ((keysB[5][3] == 0) and (lastB[5][3] == 0)) { 1893 MidiSend(noteOn2, 64, velocity); 1894 lastB[5][3] = 7; 1895 } 1896 //Write Midi Note Off 1897 if ((keysB[5][3] == 1) and (lastB[5][3] == 7)) { 1898 MidiSend(noteOff2, 64, velocity); 1899 lastB[5][3] = 0; 1900 } 1901 1902 //B65 1903 if ((keysB[5][4] == 0) and (lastB[5][4] == 0)) { 1904 MidiSend(noteOn2, 65, velocity); 1905 lastB[5][4] = 7; 1906 } 1907 //Write Midi Note Off 1908 if ((keysB[5][4] == 1) and (lastB[5][4] == 7)) { 1909 MidiSend(noteOff2, 65, velocity); 1910 lastB[5][4] = 0; 1911 } 1912 1913 //B66 1914 if ((keysB[5][5] == 0) and (lastB[5][5] == 0)) { 1915 MidiSend(noteOn2, 66, velocity); 1916 lastB[5][5] = 7; 1917 } 1918 //Write Midi Note Off 1919 if ((keysB[5][5] == 1) and (lastB[5][5] == 7)) { 1920 MidiSend(noteOff2, 66, velocity); 1921 lastB[5][5] = 0; 1922 } 1923 1924 //B67 1925 if ((keysB[6][0] == 0) and (lastB[6][0] == 0)) { 1926 MidiSend(noteOn2, 67, velocity); 1927 lastB[6][0] = 7; 1928 } 1929 //Write Midi Note Off 1930 if ((keysB[6][0] == 1) and (lastB[6][0] == 7)) { 1931 MidiSend(noteOff2, 67, velocity); 1932 lastB[6][0] = 0; 1933 } 1934 1935 //B68 1936 if ((keysB[6][1] == 0) and (lastB[6][1] == 0)) { 1937 MidiSend(noteOn2, 68, velocity); 1938 lastB[6][1] = 7; 1939 } 1940 //Write Midi Note Off 1941 if ((keysB[6][1] == 1) and (lastB[6][1] == 7)) { 1942 MidiSend(noteOff2, 68, velocity); 1943 lastB[6][1] = 0; 1944 } 1945 1946 //B69 1947 if ((keysB[6][2] == 0) and (lastB[6][2] == 0)) { 1948 MidiSend(noteOn2, 69, velocity); 1949 lastB[6][2] = 7; 1950 } 1951 //Write Midi Note Off 1952 if ((keysB[6][2] == 1) and (lastB[6][2] == 7)) { 1953 MidiSend(noteOff2, 69, velocity); 1954 lastB[6][2] = 0; 1955 } 1956 1957 //B70 1958 if ((keysB[6][3] == 0) and (lastB[6][3] == 0)) { 1959 MidiSend(noteOn2, 70, velocity); 1960 lastB[6][3] = 7; 1961 } 1962 //Write Midi Note Off 1963 if ((keysB[6][3] == 1) and (lastB[6][3] == 7)) { 1964 MidiSend(noteOff2, 70, velocity); 1965 lastB[6][3] = 0; 1966 } 1967 1968 //B71 1969 if ((keysB[6][4] == 0) and (lastB[6][4] == 0)) { 1970 MidiSend(noteOn2, 71, velocity); 1971 lastB[6][4] = 7; 1972 } 1973 //Write Midi Note Off 1974 if ((keysB[6][4] == 1) and (lastB[6][4] == 7)) { 1975 MidiSend(noteOff2, 71, velocity); 1976 lastB[6][4] = 0; 1977 } 1978 1979 //B72 1980 if ((keysB[6][5] == 0) and (lastB[6][5] == 0)) { 1981 MidiSend(noteOn2, 72, velocity); 1982 lastB[6][5] = 7; 1983 } 1984 //Write Midi Note Off 1985 if ((keysB[6][5] == 1) and (lastB[6][5] == 7)) { 1986 MidiSend(noteOff2, 72, velocity); 1987 lastB[6][5] = 0; 1988 } 1989 1990 //B73 1991 if ((keysB[7][0] == 0) and (lastB[7][0] == 0)) { 1992 MidiSend(noteOn2, 73, velocity); 1993 lastB[7][0] = 7; 1994 } 1995 //Write Midi Note Off 1996 if ((keysB[7][0] == 1) and (lastB[7][0] == 7)) { 1997 MidiSend(noteOff2, 73, velocity); 1998 lastB[7][0] = 0; 1999 } 2000 2001 //B74 2002 if ((keysB[7][1] == 0) and (lastB[7][1] == 0)) { 2003 MidiSend(noteOn2, 74, velocity); 2004 lastB[7][1] = 7; 2005 } 2006 //Write Midi Note Off 2007 if ((keysB[7][1] == 1) and (lastB[7][1] == 7)) { 2008 MidiSend(noteOff2, 74, velocity); 2009 lastB[7][1] = 0; 2010 } 2011 2012 //B75 2013 if ((keysB[7][2] == 0) and (lastB[7][2] == 0)) { 2014 MidiSend(noteOn2, 75, velocity); 2015 lastB[7][2] = 7; 2016 } 2017 //Write Midi Note Off 2018 if ((keysB[7][2] == 1) and (lastB[7][2] == 7)) { 2019 MidiSend(noteOff2, 75, velocity); 2020 lastB[7][2] = 0; 2021 } 2022 2023 //B76 2024 if ((keysB[7][3] == 0) and (lastB[7][3] == 0)) { 2025 MidiSend(noteOn2, 76, velocity); 2026 lastB[7][3] = 7; 2027 } 2028 //Write Midi Note Off 2029 if ((keysB[7][3] == 1) and (lastB[7][3] == 7)) { 2030 MidiSend(noteOff2, 76, velocity); 2031 lastB[7][3] = 0; 2032 } 2033 2034 //B77 2035 if ((keysB[7][4] == 0) and (lastB[7][4] == 0)) { 2036 MidiSend(noteOn2, 77, velocity); 2037 lastB[7][4] = 7; 2038 } 2039 //Write Midi Note Off 2040 if ((keysB[7][4] == 1) and (lastB[7][4] == 7)) { 2041 MidiSend(noteOff2, 77, velocity); 2042 lastB[7][4] = 0; 2043 } 2044 2045 //B78 2046 if ((keysB[7][5] == 0) and (lastB[7][5] == 0)) { 2047 MidiSend(noteOn2, 78, velocity); 2048 lastB[7][5] = 7; 2049 } 2050 //Write Midi Note Off 2051 if ((keysB[7][5] == 1) and (lastB[7][5] == 7)) { 2052 MidiSend(noteOff2, 78, velocity); 2053 lastB[7][5] = 0; 2054 } 2055 2056 //B79 2057 if ((keysB[8][0] == 0) and (lastB[8][0] == 0)) { 2058 MidiSend(noteOn2, 79, velocity); 2059 lastB[8][0] = 7; 2060 } 2061 //Write Midi Note Off 2062 if ((keysB[8][0] == 1) and (lastB[8][0] == 7)) { 2063 MidiSend(noteOff2, 79, velocity); 2064 lastB[8][0] = 0; 2065 } 2066 2067 //B80 2068 if ((keysB[8][1] == 0) and (lastB[8][1] == 0)) { 2069 MidiSend(noteOn2, 80, velocity); 2070 lastB[8][1] = 7; 2071 } 2072 //Write Midi Note Off 2073 if ((keysB[8][1] == 1) and (lastB[8][1] == 7)) { 2074 MidiSend(noteOff2, 80, velocity); 2075 lastB[8][1] = 0; 2076 } 2077 2078 //B81 2079 if ((keysB[8][2] == 0) and (lastB[8][2] == 0)) { 2080 MidiSend(noteOn2, 81, velocity); 2081 lastB[8][2] = 7; 2082 } 2083 //Write Midi Note Off 2084 if ((keysB[8][2] == 1) and (lastB[8][2] == 7)) { 2085 MidiSend(noteOff2, 81, velocity); 2086 lastB[8][2] = 0; 2087 } 2088 2089 //B82 2090 if ((keysB[8][3] == 0) and (lastB[8][3] == 0)) { 2091 MidiSend(noteOn2, 82, velocity); 2092 lastB[8][3] = 7; 2093 } 2094 //Write Midi Note Off 2095 if ((keysB[8][3] == 1) and (lastB[8][3] == 7)) { 2096 MidiSend(noteOff2, 82, velocity); 2097 lastB[8][3] = 0; 2098 } 2099 2100 //B83 2101 if ((keysB[8][4] == 0) and (lastB[8][4] == 0)) { 2102 MidiSend(noteOn2, 83, velocity); 2103 lastB[8][4] = 7; 2104 } 2105 //Write Midi Note Off 2106 if ((keysB[8][4] == 1) and (lastB[8][4] == 7)) { 2107 MidiSend(noteOff2, 83, velocity); 2108 lastB[8][4] = 0; 2109 } 2110 2111 //B84 2112 if ((keysB[8][5] == 0) and (lastB[8][5] == 0)) { 2113 MidiSend(noteOn2, 84, velocity); 2114 lastB[8][5] = 7; 2115 } 2116 //Write Midi Note Off 2117 if ((keysB[8][5] == 1) and (lastB[8][5] == 7)) { 2118 MidiSend(noteOff2, 84, velocity); 2119 lastB[8][5] = 0; 2120 } 2121 2122 //B85 2123 if ((keysB[9][0] == 0) and (lastB[9][0] == 0)) { 2124 MidiSend(noteOn2, 85, velocity); 2125 lastB[9][0] = 7; 2126 } 2127 //Write Midi Note Off 2128 if ((keysB[9][0] == 1) and (lastB[9][0] == 7)) { 2129 MidiSend(noteOff2, 85, velocity); 2130 lastB[9][0] = 0; 2131 } 2132 2133 //B86 2134 if ((keysB[9][1] == 0) and (lastB[9][1] == 0)) { 2135 MidiSend(noteOn2, 86, velocity); 2136 lastB[9][1] = 7; 2137 } 2138 //Write Midi Note Off 2139 if ((keysB[9][1] == 1) and (lastB[9][1] == 7)) { 2140 MidiSend(noteOff2, 86, velocity); 2141 lastB[9][1] = 0; 2142 } 2143 2144 //B87 2145 if ((keysB[9][2] == 0) and (lastB[9][2] == 0)) { 2146 MidiSend(noteOn2, 87, velocity); 2147 lastB[9][2] = 7; 2148 } 2149 //Write Midi Note Off 2150 if ((keysB[9][2] == 1) and (lastB[9][2] == 7)) { 2151 MidiSend(noteOff2, 87, velocity); 2152 lastB[9][2] = 0; 2153 } 2154 2155 //B88 2156 if ((keysB[9][3] == 0) and (lastB[9][3] == 0)) { 2157 MidiSend(noteOn2, 88, velocity); 2158 lastB[9][3] = 7; 2159 } 2160 //Write Midi Note Off 2161 if ((keysB[9][3] == 1) and (lastB[9][3] == 7)) { 2162 MidiSend(noteOff2, 88, velocity); 2163 lastB[9][3] = 0; 2164 } 2165 2166 //B89 2167 if ((keysB[9][4] == 0) and (lastB[9][4] == 0)) { 2168 MidiSend(noteOn2, 89, velocity); 2169 lastB[9][4] = 7; 2170 } 2171 //Write Midi Note Off 2172 if ((keysB[9][4] == 1) and (lastB[9][4] == 7)) { 2173 MidiSend(noteOff2, 89, velocity); 2174 lastB[9][4] = 0; 2175 } 2176 2177 //B90 2178 if ((keysB[9][5] == 0) and (lastB[9][5] == 0)) { 2179 MidiSend(noteOn2, 90, velocity); 2180 lastB[9][5] = 7; 2181 } 2182 //Write Midi Note Off 2183 if ((keysB[9][5] == 1) and (lastB[9][5] == 7)) { 2184 MidiSend(noteOff2, 90, velocity); 2185 lastB[9][5] = 0; 2186 } 2187 2188 //B91 2189 if ((keysB[10][0] == 0) and (lastB[10][0] == 0)) { 2190 MidiSend(noteOn2, 91, velocity); 2191 lastB[10][0] = 7; 2192 } 2193 //Write Midi Note Off 2194 if ((keysB[10][0] == 1) and (lastB[10][0] == 7)) { 2195 MidiSend(noteOff2, 91, velocity); 2196 lastB[10][0] = 0; 2197 } 2198 2199 //B92 2200 if ((keysB[10][1] == 0) and (lastB[10][1] == 0)) { 2201 MidiSend(noteOn2, 92, velocity); 2202 lastB[10][1] = 7; 2203 } 2204 //Write Midi Note Off 2205 if ((keysB[10][1] == 1) and (lastB[10][1] == 7)) { 2206 MidiSend(noteOff2, 92, velocity); 2207 lastB[10][1] = 0; 2208 } 2209 2210 //B93 2211 if ((keysB[10][2] == 0) and (lastB[10][2] == 0)) { 2212 MidiSend(noteOn2, 93, velocity); 2213 lastB[10][2] = 7; 2214 } 2215 //Write Midi Note Off 2216 if ((keysB[10][2] == 1) and (lastB[10][2] == 7)) { 2217 MidiSend(noteOff2, 93, velocity); 2218 lastB[10][2] = 0; 2219 } 2220 2221 //B94 2222 if ((keysB[10][3] == 0) and (lastB[10][3] == 0)) { 2223 MidiSend(noteOn2, 94, velocity); 2224 lastB[10][3] = 7; 2225 } 2226 //Write Midi Note Off 2227 if ((keysB[10][3] == 1) and (lastB[10][3] == 7)) { 2228 MidiSend(noteOff2, 94, velocity); 2229 lastB[10][3] = 0; 2230 } 2231 2232 //B95 2233 if ((keysB[10][4] == 0) and (lastB[10][4] == 0)) { 2234 MidiSend(noteOn2, 95, velocity); 2235 lastB[10][4] = 7; 2236 } 2237 //Write Midi Note Off 2238 if ((keysB[10][4] == 1) and (lastB[10][4] == 7)) { 2239 MidiSend(noteOff2, 95, velocity); 2240 lastB[10][4] = 0; 2241 } 2242 2243 //B96 2244 if ((keysB[10][5] == 0) and (lastB[10][5] == 0)) { 2245 MidiSend(noteOn2, 96, velocity); 2246 lastB[10][5] = 7; 2247 } 2248 //Write Midi Note Off 2249 if ((keysB[10][5] == 1) and (lastB[10][5] == 7)) { 2250 MidiSend(noteOff2, 96, velocity); 2251 lastB[10][5] = 0; 2252 } 2253 2254 //Write Keyboard C 2255 2256 //C36 2257 if ((keysC[0][0] == 0) and (lastC[0][0] == 0)) { 2258 MidiSend(noteOn3, 36, velocity); 2259 lastC[0][0] = 7; 2260 } 2261 if ((keysC[0][0] == 1) and (lastC[0][0] == 7)) { 2262 MidiSend(noteOff3, 36, velocity); 2263 lastC[0][0] = 0; 2264 } 2265 2266 //C37 2267 if ((keysC[1][0] == 0) and (lastC[1][0] == 0)) { 2268 MidiSend(noteOn3, 37, velocity); 2269 lastC[1][0] = 7; 2270 } 2271 if ((keysC[1][0] == 1) and (lastC[1][0] == 7)) { 2272 MidiSend(noteOff3, 37, velocity); 2273 lastC[1][0] = 0; 2274 } 2275 2276 //C38 2277 if ((keysC[1][1] == 0) and (lastC[1][1] == 0)) { 2278 MidiSend(noteOn3, 38, velocity); 2279 lastC[1][1] = 7; 2280 } 2281 //Write Midi Note Off 2282 if ((keysC[1][1] == 1) and (lastC[1][1] == 7)) { 2283 MidiSend(noteOff3, 38, velocity); 2284 lastC[1][1] = 0; 2285 } 2286 2287 //C39 2288 if ((keysC[1][2] == 0) and (lastC[1][2] == 0)) { 2289 MidiSend(noteOn3, 39, velocity); 2290 lastC[1][2] = 7; 2291 } 2292 //Write Midi Note Off 2293 if ((keysC[1][2] == 1) and (lastC[1][2] == 7)) { 2294 MidiSend(noteOff3, 39, velocity); 2295 lastC[1][2] = 0; 2296 } 2297 2298 //C40 2299 if ((keysC[1][3] == 0) and (lastC[1][3] == 0)) { 2300 MidiSend(noteOn3, 40, velocity); 2301 lastC[1][3] = 7; 2302 } 2303 //Write Midi Note Off 2304 if ((keysC[1][3] == 1) and (lastC[1][3] == 7)) { 2305 MidiSend(noteOff3, 40, velocity); 2306 lastC[1][3] = 0; 2307 } 2308 2309 //C41 2310 if ((keysC[1][4] == 0) and (lastC[1][4] == 0)) { 2311 MidiSend(noteOn3, 41, velocity); 2312 lastC[1][4] = 7; 2313 } 2314 //Write Midi Note Off 2315 if ((keysC[1][4] == 1) and (lastC[1][4] == 7)) { 2316 MidiSend(noteOff3, 41, velocity); 2317 lastC[1][4] = 0; 2318 } 2319 2320 //C42 2321 if ((keysC[1][5] == 0) and (lastC[1][5] == 0)) { 2322 MidiSend(noteOn3, 42, velocity); 2323 lastC[1][5] = 7; 2324 } 2325 //Write Midi Note Off 2326 if ((keysC[1][5] == 1) and (lastC[1][5] == 7)) { 2327 MidiSend(noteOff3, 42, velocity); 2328 lastC[1][5] = 0; 2329 } 2330 2331 //C43 2332 if ((keysC[2][0] == 0) and (lastC[2][0] == 0)) { 2333 MidiSend(noteOn3, 43, velocity); 2334 lastC[2][0] = 7; 2335 } 2336 //Write Midi Note Off 2337 if ((keysC[2][0] == 1) and (lastC[2][0] == 7)) { 2338 MidiSend(noteOff3, 43, velocity); 2339 lastC[2][0] = 0; 2340 } 2341 2342 //C44 2343 if ((keysC[2][1] == 0) and (lastC[2][1] == 0)) { 2344 MidiSend(noteOn3, 44, velocity); 2345 lastC[2][1] = 7; 2346 } 2347 //Write Midi Note Off 2348 if ((keysC[2][1] == 1) and (lastC[2][1] == 7)) { 2349 MidiSend(noteOff3, 44, velocity); 2350 lastC[2][1] = 0; 2351 } 2352 2353 //B45 2354 if ((keysC[2][2] == 0) and (lastC[2][2] == 0)) { 2355 MidiSend(noteOn3, 45, velocity); 2356 lastC[2][2] = 7; 2357 } 2358 //Write Midi Note Off 2359 if ((keysC[2][2] == 1) and (lastC[2][2] == 7)) { 2360 MidiSend(noteOff3, 45, velocity); 2361 lastC[2][2] = 0; 2362 } 2363 2364 //C46 2365 if ((keysC[2][3] == 0) and (lastC[2][3] == 0)) { 2366 MidiSend(noteOn3, 46, velocity); 2367 lastC[2][3] = 7; 2368 } 2369 //Write Midi Note Off 2370 if ((keysC[2][3] == 1) and (lastC[2][3] == 7)) { 2371 MidiSend(noteOff3, 46, velocity); 2372 lastC[2][3] = 0; 2373 } 2374 2375 //C47 2376 if ((keysC[2][4] == 0) and (lastC[2][4] == 0)) { 2377 MidiSend(noteOn3, 47, velocity); 2378 lastC[2][4] = 7; 2379 } 2380 //Write Midi Note Off 2381 if ((keysC[2][4] == 1) and (lastC[2][4] == 7)) { 2382 MidiSend(noteOff3, 47, velocity); 2383 lastC[2][4] = 0; 2384 } 2385 2386 //C48 2387 if ((keysC[2][5] == 0) and (lastC[2][5] == 0)) { 2388 MidiSend(noteOn3, 48, velocity); 2389 lastC[2][5] = 7; 2390 } 2391 //Write Midi Note Off 2392 if ((keysC[2][5] == 1) and (lastC[2][5] == 7)) { 2393 MidiSend(noteOff3, 48, velocity); 2394 lastC[2][5] = 0; 2395 } 2396 2397 //C49 2398 if ((keysC[3][0] == 0) and (lastC[3][0] == 0)) { 2399 MidiSend(noteOn3, 49, velocity); 2400 lastC[3][0] = 7; 2401 } 2402 //Write Midi Note Off 2403 if ((keysC[3][0] == 1) and (lastC[3][0] == 7)) { 2404 MidiSend(noteOff3, 49, velocity); 2405 lastC[3][0] = 0; 2406 } 2407 2408 //C50 2409 if ((keysC[3][1] == 0) and (lastC[3][1] == 0)) { 2410 MidiSend(noteOn3, 50, velocity); 2411 lastC[3][1] = 7; 2412 } 2413 //Write Midi Note Off 2414 if ((keysC[3][1] == 1) and (lastC[3][1] == 7)) { 2415 MidiSend(noteOff3, 50, velocity); 2416 lastC[3][1] = 0; 2417 } 2418 2419 //C51 2420 if ((keysC[3][2] == 0) and (lastC[3][2] == 0)) { 2421 MidiSend(noteOn3, 51, velocity); 2422 lastC[3][2] = 7; 2423 } 2424 //Write Midi Note Off 2425 if ((keysC[3][2] == 1) and (lastC[3][2] == 7)) { 2426 MidiSend(noteOff3, 51, velocity); 2427 lastC[3][2] = 0; 2428 } 2429 2430 //C52 2431 if ((keysC[3][3] == 0) and (lastC[3][3] == 0)) { 2432 MidiSend(noteOn3, 52, velocity); 2433 lastC[3][3] = 7; 2434 } 2435 //Write Midi Note Off 2436 if ((keysC[3][3] == 1) and (lastC[3][3] == 7)) { 2437 MidiSend(noteOff3, 52, velocity); 2438 lastC[3][3] = 0; 2439 } 2440 2441 //C53 2442 if ((keysC[3][4] == 0) and (lastC[3][4] == 0)) { 2443 MidiSend(noteOn3, 53, velocity); 2444 lastC[3][4] = 7; 2445 } 2446 //Write Midi Note Off 2447 if ((keysC[3][4] == 1) and (lastC[3][4] == 7)) { 2448 MidiSend(noteOff3, 53, velocity); 2449 lastC[3][4] = 0; 2450 } 2451 2452 //C54 2453 if ((keysC[3][5] == 0) and (lastC[3][5] == 0)) { 2454 MidiSend(noteOn3, 54, velocity); 2455 lastC[3][5] = 7; 2456 } 2457 //Write Midi Note Off 2458 if ((keysC[3][5] == 1) and (lastC[3][5] == 7)) { 2459 MidiSend(noteOff3, 54, velocity); 2460 lastC[3][5] = 0; 2461 } 2462 2463 //C55 2464 if ((keysC[4][0] == 0) and (lastC[4][0] == 0)) { 2465 MidiSend(noteOn3, 55, velocity); 2466 lastC[4][0] = 7; 2467 } 2468 //Write Midi Note Off 2469 if ((keysC[4][0] == 1) and (lastC[4][0] == 7)) { 2470 MidiSend(noteOff3, 55, velocity); 2471 lastC[4][0] = 0; 2472 } 2473 2474 //C56 2475 if ((keysC[4][1] == 0) and (lastC[4][1] == 0)) { 2476 MidiSend(noteOn3, 56, velocity); 2477 lastC[4][1] = 7; 2478 } 2479 //Write Midi Note Off 2480 if ((keysC[4][1] == 1) and (lastC[4][1] == 7)) { 2481 MidiSend(noteOff3, 56, velocity); 2482 lastC[4][1] = 0; 2483 } 2484 2485 //C57 2486 if ((keysC[4][2] == 0) and (lastC[4][2] == 0)) { 2487 MidiSend(noteOn3, 57, velocity); 2488 lastC[4][2] = 7; 2489 } 2490 //Write Midi Note Off 2491 if ((keysC[4][2] == 1) and (lastC[4][2] == 7)) { 2492 MidiSend(noteOff3, 57, velocity); 2493 lastC[4][2] = 0; 2494 } 2495 2496 //C58 2497 if ((keysC[4][3] == 0) and (lastC[4][3] == 0)) { 2498 MidiSend(noteOn3, 58, velocity); 2499 lastC[4][3] = 7; 2500 } 2501 //Write Midi Note Off 2502 if ((keysC[4][3] == 1) and (lastC[4][3] == 7)) { 2503 MidiSend(noteOff3, 58, velocity); 2504 lastC[4][3] = 0; 2505 } 2506 2507 //C59 2508 if ((keysC[4][4] == 0) and (lastC[4][4] == 0)) { 2509 MidiSend(noteOn3, 59, velocity); 2510 lastC[4][4] = 7; 2511 } 2512 //Write Midi Note Off 2513 if ((keysC[4][4] == 1) and (lastC[4][4] == 7)) { 2514 MidiSend(noteOff3, 59, velocity); 2515 lastC[4][4] = 0; 2516 } 2517 2518 //C60 2519 if ((keysC[4][5] == 0) and (lastC[4][5] == 0)) { 2520 MidiSend(noteOn3, 60, velocity); 2521 lastC[4][5] = 7; 2522 } 2523 //Write Midi Note Off 2524 if ((keysC[4][5] == 1) and (lastC[4][5] == 7)) { 2525 MidiSend(noteOff3, 60, velocity); 2526 lastC[4][5] = 0; 2527 } 2528 2529 //C61 2530 if ((keysC[5][0] == 0) and (lastC[5][0] == 0)) { 2531 MidiSend(noteOn3, 61, velocity); 2532 lastC[5][0] = 7; 2533 } 2534 //Write Midi Note Off 2535 if ((keysC[5][0] == 1) and (lastC[5][0] == 7)) { 2536 MidiSend(noteOff3, 61, velocity); 2537 lastC[5][0] = 0; 2538 } 2539 2540 //C62 2541 if ((keysC[5][1] == 0) and (lastC[5][1] == 0)) { 2542 MidiSend(noteOn3, 62, velocity); 2543 lastC[5][1] = 7; 2544 } 2545 //Write Midi Note Off 2546 if ((keysC[5][1] == 1) and (lastC[5][1] == 7)) { 2547 MidiSend(noteOff3, 62, velocity); 2548 lastC[5][1] = 0; 2549 } 2550 2551 //C63 2552 if ((keysC[5][2] == 0) and (lastC[5][2] == 0)) { 2553 MidiSend(noteOn3, 63, velocity); 2554 lastC[5][2] = 7; 2555 } 2556 //Write Midi Note Off 2557 if ((keysC[5][2] == 1) and (lastC[5][2] == 7)) { 2558 MidiSend(noteOff3, 63, velocity); 2559 lastC[5][2] = 0; 2560 } 2561 2562 //C64 2563 if ((keysC[5][3] == 0) and (lastC[5][3] == 0)) { 2564 MidiSend(noteOn3, 64, velocity); 2565 lastC[5][3] = 7; 2566 } 2567 //Write Midi Note Off 2568 if ((keysC[5][3] == 1) and (lastC[5][3] == 7)) { 2569 MidiSend(noteOff3, 64, velocity); 2570 lastC[5][3] = 0; 2571 } 2572 2573 //C65 2574 if ((keysC[5][4] == 0) and (lastC[5][4] == 0)) { 2575 MidiSend(noteOn3, 65, velocity); 2576 lastC[5][4] = 7; 2577 } 2578 //Write Midi Note Off 2579 if ((keysC[5][4] == 1) and (lastC[5][4] == 7)) { 2580 MidiSend(noteOff3, 65, velocity); 2581 lastC[5][4] = 0; 2582 } 2583 2584 //C66 2585 if ((keysC[5][5] == 0) and (lastC[5][5] == 0)) { 2586 MidiSend(noteOn3, 66, velocity); 2587 lastC[5][5] = 7; 2588 } 2589 //Write Midi Note Off 2590 if ((keysC[5][5] == 1) and (lastC[5][5] == 7)) { 2591 MidiSend(noteOff3, 66, velocity); 2592 lastC[5][5] = 0; 2593 } 2594 2595 //C67 2596 if ((keysC[6][0] == 0) and (lastC[6][0] == 0)) { 2597 MidiSend(noteOn3, 67, velocity); 2598 lastC[6][0] = 7; 2599 } 2600 //Write Midi Note Off 2601 if ((keysC[6][0] == 1) and (lastC[6][0] == 7)) { 2602 MidiSend(noteOff3, 67, velocity); 2603 lastC[6][0] = 0; 2604 } 2605 2606 //C68 2607 if ((keysC[6][1] == 0) and (lastC[6][1] == 0)) { 2608 MidiSend(noteOn3, 68, velocity); 2609 lastC[6][1] = 7; 2610 } 2611 //Write Midi Note Off 2612 if ((keysC[6][1] == 1) and (lastC[6][1] == 7)) { 2613 MidiSend(noteOff3, 68, velocity); 2614 lastC[6][1] = 0; 2615 } 2616 2617 //C69 2618 if ((keysC[6][2] == 0) and (lastC[6][2] == 0)) { 2619 MidiSend(noteOn3, 69, velocity); 2620 lastC[6][2] = 7; 2621 } 2622 //Write Midi Note Off 2623 if ((keysC[6][2] == 1) and (lastC[6][2] == 7)) { 2624 MidiSend(noteOff3, 69, velocity); 2625 lastC[6][2] = 0; 2626 } 2627 2628 //C70 2629 if ((keysC[6][3] == 0) and (lastC[6][3] == 0)) { 2630 MidiSend(noteOn3, 70, velocity); 2631 lastC[6][3] = 7; 2632 } 2633 //Write Midi Note Off 2634 if ((keysC[6][3] == 1) and (lastC[6][3] == 7)) { 2635 MidiSend(noteOff3, 70, velocity); 2636 lastC[6][3] = 0; 2637 } 2638 2639 //C71 2640 if ((keysC[6][4] == 0) and (lastC[6][4] == 0)) { 2641 MidiSend(noteOn3, 71, velocity); 2642 lastC[6][4] = 7; 2643 } 2644 //Write Midi Note Off 2645 if ((keysC[6][4] == 1) and (lastC[6][4] == 7)) { 2646 MidiSend(noteOff3, 71, velocity); 2647 lastC[6][4] = 0; 2648 } 2649 2650 //C72 2651 if ((keysC[6][5] == 0) and (lastC[6][5] == 0)) { 2652 MidiSend(noteOn3, 72, velocity); 2653 lastC[6][5] = 7; 2654 } 2655 //Write Midi Note Off 2656 if ((keysC[6][5] == 1) and (lastC[6][5] == 7)) { 2657 MidiSend(noteOff3, 72, velocity); 2658 lastC[6][5] = 0; 2659 } 2660 2661 //C73 2662 if ((keysC[7][0] == 0) and (lastC[7][0] == 0)) { 2663 MidiSend(noteOn3, 73, velocity); 2664 lastC[7][0] = 7; 2665 } 2666 //Write Midi Note Off 2667 if ((keysC[7][0] == 1) and (lastC[7][0] == 7)) { 2668 MidiSend(noteOff3, 73, velocity); 2669 lastC[7][0] = 0; 2670 } 2671 2672 //C74 2673 if ((keysC[7][1] == 0) and (lastC[7][1] == 0)) { 2674 MidiSend(noteOn3, 74, velocity); 2675 lastC[7][1] = 7; 2676 } 2677 //Write Midi Note Off 2678 if ((keysC[7][1] == 1) and (lastC[7][1] == 7)) { 2679 MidiSend(noteOff3, 74, velocity); 2680 lastC[7][1] = 0; 2681 } 2682 2683 //C75 2684 if ((keysC[7][2] == 0) and (lastC[7][2] == 0)) { 2685 MidiSend(noteOn3, 75, velocity); 2686 lastC[7][2] = 7; 2687 } 2688 //Write Midi Note Off 2689 if ((keysC[7][2] == 1) and (lastC[7][2] == 7)) { 2690 MidiSend(noteOff3, 75, velocity); 2691 lastC[7][2] = 0; 2692 } 2693 2694 //C76 2695 if ((keysC[7][3] == 0) and (lastC[7][3] == 0)) { 2696 MidiSend(noteOn3, 76, velocity); 2697 lastC[7][3] = 7; 2698 } 2699 //Write Midi Note Off 2700 if ((keysC[7][3] == 1) and (lastC[7][3] == 7)) { 2701 MidiSend(noteOff3, 76, velocity); 2702 lastC[7][3] = 0; 2703 } 2704 2705 //C77 2706 if ((keysC[7][4] == 0) and (lastC[7][4] == 0)) { 2707 MidiSend(noteOn3, 77, velocity); 2708 lastC[7][4] = 7; 2709 } 2710 //Write Midi Note Off 2711 if ((keysC[7][4] == 1) and (lastC[7][4] == 7)) { 2712 MidiSend(noteOff3, 77, velocity); 2713 lastC[7][4] = 0; 2714 } 2715 2716 //C78 2717 if ((keysC[7][5] == 0) and (lastC[7][5] == 0)) { 2718 MidiSend(noteOn3, 78, velocity); 2719 lastC[7][5] = 7; 2720 } 2721 //Write Midi Note Off 2722 if ((keysC[7][5] == 1) and (lastC[7][5] == 7)) { 2723 MidiSend(noteOff3, 78, velocity); 2724 lastC[7][5] = 0; 2725 } 2726 2727 //C79 2728 if ((keysC[8][0] == 0) and (lastC[8][0] == 0)) { 2729 MidiSend(noteOn3, 79, velocity); 2730 lastC[8][0] = 7; 2731 } 2732 //Write Midi Note Off 2733 if ((keysC[8][0] == 1) and (lastC[8][0] == 7)) { 2734 MidiSend(noteOff2, 79, velocity); 2735 lastC[8][0] = 0; 2736 } 2737 2738 //C80 2739 if ((keysC[8][1] == 0) and (lastC[8][1] == 0)) { 2740 MidiSend(noteOn3, 80, velocity); 2741 lastC[8][1] = 7; 2742 } 2743 //Write Midi Note Off 2744 if ((keysC[8][1] == 1) and (lastC[8][1] == 7)) { 2745 MidiSend(noteOff3, 80, velocity); 2746 lastC[8][1] = 0; 2747 } 2748 2749 //C81 2750 if ((keysC[8][2] == 0) and (lastC[8][2] == 0)) { 2751 MidiSend(noteOn3, 81, velocity); 2752 lastC[8][2] = 7; 2753 } 2754 //Write Midi Note Off 2755 if ((keysC[8][2] == 1) and (lastC[8][2] == 7)) { 2756 MidiSend(noteOff3, 81, velocity); 2757 lastC[8][2] = 0; 2758 } 2759 2760 //C82 2761 if ((keysC[8][3] == 0) and (lastC[8][3] == 0)) { 2762 MidiSend(noteOn3, 82, velocity); 2763 lastC[8][3] = 7; 2764 } 2765 //Write Midi Note Off 2766 if ((keysC[8][3] == 1) and (lastC[8][3] == 7)) { 2767 MidiSend(noteOff3, 82, velocity); 2768 lastC[8][3] = 0; 2769 } 2770 2771 //C83 2772 if ((keysC[8][4] == 0) and (lastC[8][4] == 0)) { 2773 MidiSend(noteOn3, 83, velocity); 2774 lastC[8][4] = 7; 2775 } 2776 //Write Midi Note Off 2777 if ((keysC[8][4] == 1) and (lastC[8][4] == 7)) { 2778 MidiSend(noteOff3, 83, velocity); 2779 lastC[8][4] = 0; 2780 } 2781 2782 //C84 2783 if ((keysC[8][5] == 0) and (lastC[8][5] == 0)) { 2784 MidiSend(noteOn3, 84, velocity); 2785 lastC[8][5] = 7; 2786 } 2787 //Write Midi Note Off 2788 if ((keysC[8][5] == 1) and (lastC[8][5] == 7)) { 2789 MidiSend(noteOff3, 84, velocity); 2790 lastC[8][5] = 0; 2791 } 2792 2793 //C85 2794 if ((keysC[9][0] == 0) and (lastC[9][0] == 0)) { 2795 MidiSend(noteOn3, 85, velocity); 2796 lastC[9][0] = 7; 2797 } 2798 //Write Midi Note Off 2799 if ((keysC[9][0] == 1) and (lastC[9][0] == 7)) { 2800 MidiSend(noteOff3, 85, velocity); 2801 lastC[9][0] = 0; 2802 } 2803 2804 //C86 2805 if ((keysC[9][1] == 0) and (lastC[9][1] == 0)) { 2806 MidiSend(noteOn2, 86, velocity); 2807 lastC[9][1] = 7; 2808 } 2809 //Write Midi Note Off 2810 if ((keysC[9][1] == 1) and (lastC[9][1] == 7)) { 2811 MidiSend(noteOff3, 86, velocity); 2812 lastC[9][1] = 0; 2813 } 2814 2815 //C87 2816 if ((keysC[9][2] == 0) and (lastC[9][2] == 0)) { 2817 MidiSend(noteOn3, 87, velocity); 2818 lastC[9][2] = 7; 2819 } 2820 //Write Midi Note Off 2821 if ((keysC[9][2] == 1) and (lastC[9][2] == 7)) { 2822 MidiSend(noteOff3, 87, velocity); 2823 lastC[9][2] = 0; 2824 } 2825 2826 //C88 2827 if ((keysC[9][3] == 0) and (lastC[9][3] == 0)) { 2828 MidiSend(noteOn3, 88, velocity); 2829 lastC[9][3] = 7; 2830 } 2831 //Write Midi Note Off 2832 if ((keysC[9][3] == 1) and (lastC[9][3] == 7)) { 2833 MidiSend(noteOff3, 88, velocity); 2834 lastC[9][3] = 0; 2835 } 2836 2837 //C89 2838 if ((keysC[9][4] == 0) and (lastC[9][4] == 0)) { 2839 MidiSend(noteOn3, 89, velocity); 2840 lastC[9][4] = 7; 2841 } 2842 //Write Midi Note Off 2843 if ((keysC[9][4] == 1) and (lastC[9][4] == 7)) { 2844 MidiSend(noteOff3, 89, velocity); 2845 lastC[9][4] = 0; 2846 } 2847 2848 //C90 2849 if ((keysC[9][5] == 0) and (lastC[9][5] == 0)) { 2850 MidiSend(noteOn3, 90, velocity); 2851 lastC[9][5] = 7; 2852 } 2853 //Write Midi Note Off 2854 if ((keysC[9][5] == 1) and (lastC[9][5] == 7)) { 2855 MidiSend(noteOff3, 90, velocity); 2856 lastC[9][5] = 0; 2857 } 2858 2859 //C91 2860 if ((keysC[10][0] == 0) and (lastC[10][0] == 0)) { 2861 MidiSend(noteOn3, 91, velocity); 2862 lastC[10][0] = 7; 2863 } 2864 //Write Midi Note Off 2865 if ((keysC[10][0] == 1) and (lastC[10][0] == 7)) { 2866 MidiSend(noteOff3, 91, velocity); 2867 lastC[10][0] = 0; 2868 } 2869 2870 //C92 2871 if ((keysC[10][1] == 0) and (lastC[10][1] == 0)) { 2872 MidiSend(noteOn3, 92, velocity); 2873 lastC[10][1] = 7; 2874 } 2875 //Write Midi Note Off 2876 if ((keysC[10][1] == 1) and (lastC[10][1] == 7)) { 2877 MidiSend(noteOff3, 92, velocity); 2878 lastC[10][1] = 0; 2879 } 2880 2881 //C93 2882 if ((keysC[10][2] == 0) and (lastC[10][2] == 0)) { 2883 MidiSend(noteOn3, 93, velocity); 2884 lastC[10][2] = 7; 2885 } 2886 //Write Midi Note Off 2887 if ((keysC[10][2] == 1) and (lastC[10][2] == 7)) { 2888 MidiSend(noteOff3, 93, velocity); 2889 lastC[10][2] = 0; 2890 } 2891 2892 //C94 2893 if ((keysC[10][3] == 0) and (lastC[10][3] == 0)) { 2894 MidiSend(noteOn3, 94, velocity); 2895 lastC[10][3] = 7; 2896 } 2897 //Write Midi Note Off 2898 if ((keysC[10][3] == 1) and (lastC[10][3] == 7)) { 2899 MidiSend(noteOff3, 94, velocity); 2900 lastC[10][3] = 0; 2901 } 2902 2903 //C95 2904 if ((keysC[10][4] == 0) and (lastC[10][4] == 0)) { 2905 MidiSend(noteOn3, 95, velocity); 2906 lastC[10][4] = 7; 2907 } 2908 //Write Midi Note Off 2909 if ((keysC[10][4] == 1) and (lastC[10][4] == 7)) { 2910 MidiSend(noteOff3, 95, velocity); 2911 lastC[10][4] = 0; 2912 } 2913 2914 //C96 2915 if ((keysC[10][5] == 0) and (lastC[10][5] == 0)) { 2916 MidiSend(noteOn3, 96, velocity); 2917 lastC[10][5] = 7; 2918 } 2919 //Write Midi Note Off 2920 if ((keysC[10][5] == 1) and (lastC[10][5] == 7)) { 2921 MidiSend(noteOff3, 96, velocity); 2922 lastC[10][5] = 0; 2923 } 2924 2925 //Write Keyboard D 2926 2927 //D36 2928 if ((keysD[0][0] == 0) and (lastD[0][0] == 0)) { 2929 MidiSend(noteOn4, 36, velocity); 2930 lastD[0][0] = 7; 2931 } 2932 if ((keysD[0][0] == 1) and (lastD[0][0] == 7)) { 2933 MidiSend(noteOff4, 36, velocity); 2934 lastD[0][0] = 0; 2935 } 2936 2937 //D37 2938 if ((keysD[1][0] == 0) and (lastD[1][0] == 0)) { 2939 MidiSend(noteOn4, 37, velocity); 2940 lastD[1][0] = 7; 2941 } 2942 if ((keysD[1][0] == 1) and (lastD[1][0] == 7)) { 2943 MidiSend(noteOff4, 37, velocity); 2944 lastD[1][0] = 0; 2945 } 2946 2947 //D38 2948 if ((keysD[1][1] == 0) and (lastD[1][1] == 0)) { 2949 MidiSend(noteOn4, 38, velocity); 2950 lastD[1][1] = 7; 2951 } 2952 //Write Midi Note Off 2953 if ((keysD[1][1] == 1) and (lastD[1][1] == 7)) { 2954 MidiSend(noteOff4, 38, velocity); 2955 lastD[1][1] = 0; 2956 } 2957 2958 //D39 2959 if ((keysD[1][2] == 0) and (lastD[1][2] == 0)) { 2960 MidiSend(noteOn4, 39, velocity); 2961 lastD[1][2] = 7; 2962 } 2963 //Write Midi Note Off 2964 if ((keysD[1][2] == 1) and (lastD[1][2] == 7)) { 2965 MidiSend(noteOff4, 39, velocity); 2966 lastD[1][2] = 0; 2967 } 2968 2969 //D40 2970 if ((keysD[1][3] == 0) and (lastD[1][3] == 0)) { 2971 MidiSend(noteOn4, 40, velocity); 2972 lastD[1][3] = 7; 2973 } 2974 //Write Midi Note Off 2975 if ((keysD[1][3] == 1) and (lastD[1][3] == 7)) { 2976 MidiSend(noteOff4, 40, velocity); 2977 lastD[1][3] = 0; 2978 } 2979 2980 //D41 2981 if ((keysD[1][4] == 0) and (lastD[1][4] == 0)) { 2982 MidiSend(noteOn4, 41, velocity); 2983 lastD[1][4] = 7; 2984 } 2985 //Write Midi Note Off 2986 if ((keysD[1][4] == 1) and (lastD[1][4] == 7)) { 2987 MidiSend(noteOff4, 41, velocity); 2988 lastD[1][4] = 0; 2989 } 2990 2991 //D42 2992 if ((keysD[1][5] == 0) and (lastD[1][5] == 0)) { 2993 MidiSend(noteOn4, 42, velocity); 2994 lastD[1][5] = 7; 2995 } 2996 //Write Midi Note Off 2997 if ((keysD[1][5] == 1) and (lastD[1][5] == 7)) { 2998 MidiSend(noteOff4, 42, velocity); 2999 lastD[1][5] = 0; 3000 } 3001 3002 //D43 3003 if ((keysD[2][0] == 0) and (lastD[2][0] == 0)) { 3004 MidiSend(noteOn4, 43, velocity); 3005 lastD[2][0] = 7; 3006 } 3007 //Write Midi Note Off 3008 if ((keysD[2][0] == 1) and (lastD[2][0] == 7)) { 3009 MidiSend(noteOff4, 43, velocity); 3010 lastD[2][0] = 0; 3011 } 3012 3013 //B44 3014 if ((keysD[2][1] == 0) and (lastD[2][1] == 0)) { 3015 MidiSend(noteOn4, 44, velocity); 3016 lastD[2][1] = 7; 3017 } 3018 //Write Midi Note Off 3019 if ((keysD[2][1] == 1) and (lastD[2][1] == 7)) { 3020 MidiSend(noteOff4, 44, velocity); 3021 lastD[2][1] = 0; 3022 } 3023 3024 //D45 3025 if ((keysD[2][2] == 0) and (lastD[2][2] == 0)) { 3026 MidiSend(noteOn4, 45, velocity); 3027 lastD[2][2] = 7; 3028 } 3029 //Write Midi Note Off 3030 if ((keysD[2][2] == 1) and (lastD[2][2] == 7)) { 3031 MidiSend(noteOff4, 45, velocity); 3032 lastD[2][2] = 0; 3033 } 3034 3035 //D46 3036 if ((keysD[2][3] == 0) and (lastD[2][3] == 0)) { 3037 MidiSend(noteOn4, 46, velocity); 3038 lastD[2][3] = 7; 3039 } 3040 //Write Midi Note Off 3041 if ((keysD[2][3] == 1) and (lastD[2][3] == 7)) { 3042 MidiSend(noteOff4, 46, velocity); 3043 lastD[2][3] = 0; 3044 } 3045 3046 //D47 3047 if ((keysD[2][4] == 0) and (lastD[2][4] == 0)) { 3048 MidiSend(noteOn4, 47, velocity); 3049 lastD[2][4] = 7; 3050 } 3051 //Write Midi Note Off 3052 if ((keysD[2][4] == 1) and (lastD[2][4] == 7)) { 3053 MidiSend(noteOff4, 47, velocity); 3054 lastD[2][4] = 0; 3055 } 3056 3057 //D48 3058 if ((keysD[2][5] == 0) and (lastD[2][5] == 0)) { 3059 MidiSend(noteOn4, 48, velocity); 3060 lastD[2][5] = 7; 3061 } 3062 //Write Midi Note Off 3063 if ((keysD[2][5] == 1) and (lastD[2][5] == 7)) { 3064 MidiSend(noteOff4, 48, velocity); 3065 lastD[2][5] = 0; 3066 } 3067 3068 //D49 3069 if ((keysD[3][0] == 0) and (lastD[3][0] == 0)) { 3070 MidiSend(noteOn4, 49, velocity); 3071 lastD[3][0] = 7; 3072 } 3073 //Write Midi Note Off 3074 if ((keysD[3][0] == 1) and (lastD[3][0] == 7)) { 3075 MidiSend(noteOff4, 49, velocity); 3076 lastD[3][0] = 0; 3077 } 3078 3079 //D50 3080 if ((keysD[3][1] == 0) and (lastD[3][1] == 0)) { 3081 MidiSend(noteOn4, 50, velocity); 3082 lastD[3][1] = 7; 3083 } 3084 //Write Midi Note Off 3085 if ((keysD[3][1] == 1) and (lastD[3][1] == 7)) { 3086 MidiSend(noteOff4, 50, velocity); 3087 lastD[3][1] = 0; 3088 } 3089 3090 //D51 3091 if ((keysD[3][2] == 0) and (lastD[3][2] == 0)) { 3092 MidiSend(noteOn4, 51, velocity); 3093 lastD[3][2] = 7; 3094 } 3095 //Write Midi Note Off 3096 if ((keysD[3][2] == 1) and (lastD[3][2] == 7)) { 3097 MidiSend(noteOff4, 51, velocity); 3098 lastD[3][2] = 0; 3099 } 3100 3101 //D52 3102 if ((key