Components and supplies
Arduino UNO
Project description
Code
Pushbutton Program
c_cpp
1 2#include "pitches.h" 3const int buttonPin1 = 13; //C 4 const int buttonPin2 = 12; //CS 5 const int buttonPin3 = 11; //D 6 const int buttonPin4 = 10; // DS 7 const int buttonPin5 = 9; // E 8 const int buttonPin6 = 8; //F 9 const int buttonPin7 = 7; //FS 10 const int buttonPin8 = 6; //G 11 const int buttonPin9 = 5; //GS 12 const int buttonPin10 = 4; //A 13 const int buttonPin11 = 3; //AS 14 const int buttonPin12 = 2; //B 15 const int buttonPin13 = 1; //C 16const int dip1 = A0; // LSB, 1 17 const int dip2 = A1;// 2 18 const int dip3 = A2;// 3 19 const int dip4 = A3;// 4 20 const int dip5 = A4;// 5 21 const int dip6 = A5; //MSB, 6 22int dip1state = 0; 23 int dip2state = 0; 24 int dip3state = 0; 25 int dip4state = 0; 26 int dip5state = 0; 27 int dip6state = 0; 28int buttonState1 = 0; 29 int buttonState2 = 0; 30 int buttonState3 = 0; 31 int buttonState4 = 0; 32 int buttonState5 = 0; 33 int buttonState6 = 0; 34 int buttonState7 = 0; 35 int buttonState8 = 0; 36 int buttonState9 = 0; 37 int buttonState10 = 0; 38 int buttonState11 = 0; 39 int buttonState12 = 0; 40 int buttonState13 = 0; 41 42 43void setup() { 44 45pinMode(buttonPin1, INPUT); 46 pinMode(buttonPin2, INPUT); 47 pinMode(buttonPin3, INPUT); 48 pinMode(buttonPin4, INPUT); 49 pinMode(buttonPin5, INPUT); 50 pinMode(buttonPin6, INPUT); 51 pinMode(buttonPin7, INPUT); 52 pinMode(buttonPin8, INPUT); 53 pinMode(buttonPin9, INPUT); 54 pinMode(buttonPin10, INPUT); 55 pinMode(buttonPin11, INPUT); 56 pinMode(buttonPin12, INPUT); 57 pinMode(buttonPin13, INPUT); 58pinMode(dip1, INPUT); 59 pinMode(dip2, INPUT); 60 pinMode(dip3, INPUT); 61 pinMode(dip4, INPUT); 62 pinMode(dip5, INPUT); 63 pinMode(dip6, INPUT); 64} 65 66void loop(){ 67// read the state of the pushbutton value: 68buttonState1 = digitalRead(buttonPin1); 69buttonState2 = digitalRead(buttonPin2); 70buttonState3 = digitalRead(buttonPin3); 71buttonState4 = digitalRead(buttonPin4); 72buttonState5 = digitalRead(buttonPin5); 73buttonState6 = digitalRead(buttonPin6); 74buttonState7 = digitalRead(buttonPin7); 75buttonState8 = digitalRead(buttonPin8); 76buttonState9 = digitalRead(buttonPin9); 77buttonState10 = digitalRead(buttonPin10); 78buttonState11 = digitalRead(buttonPin11); 79buttonState12 = digitalRead(buttonPin12); 80buttonState13 = digitalRead(buttonPin13); 81dip1state = digitalRead(dip1); 82dip2state = digitalRead(dip2); 83dip3state = digitalRead(dip3); 84dip4state = digitalRead(dip4); 85dip5state = digitalRead(dip5); 86dip6state = digitalRead(dip6); 87 88 89if (dip1state == LOW //00 or 19 in HEX; C4 90 && dip2state == LOW 91 && dip3state == LOW 92 && dip4state == LOW 93 && dip5state == LOW 94 && dip6state == LOW 95 || dip1state == HIGH 96 && dip2state == LOW 97 && dip3state == LOW 98 && dip4state == HIGH 99 && dip5state == HIGH 100 && dip6state == LOW ) 101 { if (buttonState1 == LOW) { 102 tone(0, NOTE_C4);} 103 else if (buttonState2 == LOW) { 104 tone(0, NOTE_CS4);} 105 else if(buttonState3 == LOW) { 106 tone(0, NOTE_D4);} 107 else if(buttonState4 == LOW) { 108 tone(0, NOTE_DS4);} 109 else if(buttonState5 == LOW) { 110 tone(0, NOTE_E4);} 111 else if(buttonState6 == LOW) { 112 tone(0, NOTE_F4);} 113 else if(buttonState7 == LOW) { 114 tone(0, NOTE_FS4);} 115 else if(buttonState8 == LOW) { 116 tone(0, NOTE_G4);} 117 else if(buttonState9 == LOW) { 118 tone(0, NOTE_GS4);} 119 else if(buttonState10 == LOW) { 120 tone(0, NOTE_A4);} 121 else if(buttonState11 == LOW) { 122 tone(0, NOTE_AS4);} 123 else if(buttonState12 == LOW) { 124 tone(0, NOTE_B4);} 125 else if(buttonState13 == LOW) { 126 tone(0, NOTE_C5);} 127 else { 128 noTone(0); } 129 } 130 131 else if (dip1state == HIGH //01 in HEX; C2 132 && dip2state == LOW 133 && dip3state == LOW 134 && dip4state == LOW 135 && dip5state == LOW 136 && dip6state == LOW) 137 138{ if (buttonState1 == LOW) { 139 tone(0, NOTE_C2);} 140 else if (buttonState2 == LOW) { 141 tone(0, NOTE_CS2);} 142 else if(buttonState3 == LOW) { 143 tone(0, NOTE_D2);} 144 else if(buttonState4 == LOW) { 145 tone(0, NOTE_DS2);} 146 else if(buttonState5 == LOW) { 147 tone(0, NOTE_E2);} 148 else if(buttonState6 == LOW) { 149 tone(0, NOTE_F2);} 150 else if(buttonState7 == LOW) { 151 tone(0, NOTE_FS2);} 152 else if(buttonState8 == LOW) { 153 tone(0, NOTE_G2);} 154 else if(buttonState9 == LOW) { 155 tone(0, NOTE_GS2);} 156 else if(buttonState10 == LOW) { 157 tone(0, NOTE_A2);} 158 else if(buttonState11 == LOW) { 159 tone(0, NOTE_AS2);} 160 else if(buttonState12 == LOW) { 161 tone(0, NOTE_B2);} 162 else if(buttonState13 == LOW) { 163 tone(0, NOTE_C3);} 164 else { 165 noTone(0); } 166 } 167 else if (dip1state == LOW //02 in HEX; CS2 168 && dip2state == HIGH 169 && dip3state == LOW 170 && dip4state == LOW 171 && dip5state == LOW 172 && dip6state == LOW) 173 174 {if (buttonState1 == LOW) { 175 tone(0, NOTE_CS2);} 176 else if (buttonState2 == LOW) { 177 tone(0, NOTE_D2);} 178 else if(buttonState3 == LOW) { 179 tone(0, NOTE_DS2);} 180 else if(buttonState4 == LOW) { 181 tone(0, NOTE_E2);} 182 else if(buttonState5 == LOW) { 183 tone(0, NOTE_F2);} 184 else if(buttonState6 == LOW) { 185 tone(0, NOTE_FS2);} 186 else if(buttonState7 == LOW) { 187 tone(0, NOTE_G2);} 188 else if(buttonState8 == LOW) { 189 tone(0, NOTE_GS2);} 190 else if(buttonState9 == LOW) { 191 tone(0, NOTE_A2);} 192 else if(buttonState10 == LOW) { 193 tone(0, NOTE_AS2);} 194 else if(buttonState11 == LOW) { 195 tone(0, NOTE_B2);} 196 else if(buttonState12 == LOW) { 197 tone(0, NOTE_C3);} 198 else if(buttonState13 == LOW) { 199 tone(0, NOTE_CS3);} 200 else { 201 noTone(0); } 202 } 203 else if (dip1state == HIGH // 03 in HEX; D2 204 && dip2state == HIGH 205 && dip3state == LOW 206 && dip4state == LOW 207 && dip5state == LOW 208 && dip6state == LOW) 209 210{if (buttonState1 == LOW) { 211tone(0, NOTE_D2);} 212 else if (buttonState2 == LOW) { 213 tone(0, NOTE_DS2);} 214 else if(buttonState3 == LOW) { 215 tone(0, NOTE_E2);} 216 else if(buttonState4 == LOW) { 217 tone(0, NOTE_F2);} 218 else if(buttonState5 == LOW) { 219 tone(0, NOTE_FS2);} 220 else if(buttonState6 == LOW) { 221 tone(0, NOTE_G2);} 222 else if(buttonState7 == LOW) { 223 tone(0, NOTE_GS2);} 224 else if(buttonState8 == LOW) { 225 tone(0, NOTE_A2);} 226 else if(buttonState9 == LOW) { 227 tone(0, NOTE_AS2);} 228 else if(buttonState10 == LOW) { 229 tone(0, NOTE_B2);} 230 else if(buttonState11 == LOW) { 231 tone(0, NOTE_C3);} 232 else if(buttonState12 == LOW) { 233 tone(0, NOTE_CS3);} 234 else if(buttonState13 == LOW) { 235 tone(0, NOTE_D3);} 236 else { 237 noTone(0); } 238 } 239 240 241 else if (dip1state == LOW // 04 in HEX DS2 242 && dip2state == LOW 243 && dip3state == HIGH 244 && dip4state == LOW 245 && dip5state == LOW 246 && dip6state == LOW) 247 248 249 {if (buttonState1 == LOW) { 250 tone(0, NOTE_DS2);} 251 else if (buttonState2 == LOW) { 252 tone(0, NOTE_E2);} 253 else if(buttonState3 == LOW) { 254 tone(0, NOTE_F2);} 255 else if(buttonState4 == LOW) { 256 tone(0, NOTE_FS2);} 257 else if(buttonState5 == LOW) { 258 tone(0, NOTE_G2);} 259 else if(buttonState6 == LOW) { 260 tone(0, NOTE_GS2);} 261 else if(buttonState7 == LOW) { 262 tone(0, NOTE_A2);} 263 else if(buttonState8 == LOW) { 264 tone(0, NOTE_AS2);} 265 else if(buttonState9 == LOW) { 266 tone(0, NOTE_B2);} 267 else if(buttonState10 == LOW) { 268 tone(0, NOTE_C3);} 269 else if(buttonState11 == LOW) { 270 tone(0, NOTE_CS3);} 271 else if(buttonState12 == LOW) { 272 tone(0, NOTE_D3);} 273 else if(buttonState13 == LOW) { 274 tone(0, NOTE_DS3);} 275 else { 276 noTone(0); } 277 } 278 279 280 281 282else if (dip1state == HIGH // 05 in HEX; E2 283 && dip2state == LOW 284 && dip3state == HIGH 285 && dip4state == LOW 286 && dip5state == LOW 287 && dip6state == LOW) 288 289{if (buttonState1 == LOW) { 290 tone(0, NOTE_E2);} 291 else if (buttonState2 == LOW) { 292 tone(0, NOTE_F2);} 293 else if(buttonState3 == LOW) { 294 tone(0, NOTE_FS2);} 295 else if(buttonState4 == LOW) { 296 tone(0, NOTE_G2);} 297 else if(buttonState5 == LOW) { 298 tone(0, NOTE_GS2);} 299 else if(buttonState6 == LOW) { 300 tone(0, NOTE_A2);} 301 else if(buttonState7 == LOW) { 302 tone(0, NOTE_AS2);} 303 else if(buttonState8 == LOW) { 304 tone(0, NOTE_B2);} 305 else if(buttonState9 == LOW) { 306 tone(0, NOTE_C3);} 307 else if(buttonState10 == LOW) { 308 tone(0, NOTE_CS3);} 309 else if(buttonState11 == LOW) { 310 tone(0, NOTE_D3);} 311 else if(buttonState12 == LOW) { 312 tone(0, NOTE_DS3);} 313 else if(buttonState13 == LOW) { 314 tone(0, NOTE_E3);} 315 else { 316 noTone(0); } 317 } 318 319 320 321 else if (dip1state == LOW // 06 in HEX; F2 322 && dip2state == HIGH 323 && dip3state == HIGH 324 && dip4state == LOW 325 && dip5state == LOW 326 && dip6state == LOW) 327 328{if (buttonState1 == LOW) { 329 tone(0, NOTE_F2);} 330 else if (buttonState2 == LOW) { 331 tone(0, NOTE_FS2);} 332 else if(buttonState3 == LOW) { 333 tone(0, NOTE_G2);} 334 else if(buttonState4 == LOW) { 335 tone(0, NOTE_GS2);} 336 else if(buttonState5 == LOW) { 337 tone(0, NOTE_A2);} 338 else if(buttonState6 == LOW) { 339 tone(0, NOTE_AS2);} 340 else if(buttonState7 == LOW) { 341 tone(0, NOTE_B2);} 342 else if(buttonState8 == LOW) { 343 tone(0, NOTE_C3);} 344 else if(buttonState9 == LOW) { 345 tone(0, NOTE_CS3);} 346 else if(buttonState10 == LOW) { 347 tone(0, NOTE_D3);} 348 else if(buttonState11 == LOW) { 349 tone(0, NOTE_DS3);} 350 else if(buttonState12 == LOW) { 351 tone(0, NOTE_E3);} 352 else if(buttonState13 == LOW) { 353 tone(0, NOTE_F3);} 354 else { 355 noTone(0); } 356 } 357 358 359else if (dip1state == HIGH // 07 in HEX; FS2 360 && dip2state == HIGH 361 && dip3state == HIGH 362 && dip4state == LOW 363 && dip5state == LOW 364 && dip6state == LOW) 365{if (buttonState1 == LOW) { 366 tone(0, NOTE_FS2);} 367 else if (buttonState2 == LOW) { 368 tone(0, NOTE_G2);} 369 else if(buttonState3 == LOW) { 370 tone(0, NOTE_GS2);} 371 else if(buttonState4 == LOW) { 372 tone(0, NOTE_A2);} 373 else if(buttonState5 == LOW) { 374 tone(0, NOTE_AS2);} 375 else if(buttonState6 == LOW) { 376 tone(0, NOTE_B2);} 377 else if(buttonState7 == LOW) { 378 tone(0, NOTE_C3);} 379 else if(buttonState8 == LOW) { 380 tone(0, NOTE_CS3);} 381 else if(buttonState9 == LOW) { 382 tone(0, NOTE_D3);} 383 else if(buttonState10 == LOW) { 384 tone(0, NOTE_DS3);} 385 else if(buttonState11 == LOW) { 386 tone(0, NOTE_E3);} 387 else if(buttonState12 == LOW) { 388 tone(0, NOTE_F3);} 389 else if(buttonState13 == LOW) { 390 tone(0, NOTE_FS3);} 391 else { 392 noTone(0); } 393 } 394 395 else if (dip1state == LOW // 08 in HEX; G2 396 && dip2state == LOW 397 && dip3state == LOW 398 && dip4state == HIGH 399 && dip5state == LOW 400 && dip6state == LOW) 401{if (buttonState1 == LOW) { 402 tone(0, NOTE_G2);} 403 else if (buttonState2 == LOW) { 404 tone(0, NOTE_GS2);} 405 else if(buttonState3 == LOW) { 406 tone(0, NOTE_A2);} 407 else if(buttonState4 == LOW) { 408 tone(0, NOTE_AS2);} 409 else if(buttonState5 == LOW) { 410 tone(0, NOTE_B2);} 411 else if(buttonState6 == LOW) { 412 tone(0, NOTE_C3);} 413 else if(buttonState7 == LOW) { 414 tone(0, NOTE_CS3);} 415 else if(buttonState8 == LOW) { 416 tone(0, NOTE_D3);} 417 else if(buttonState9 == LOW) { 418 tone(0, NOTE_DS3);} 419 else if(buttonState10 == LOW) { 420 tone(0, NOTE_E3);} 421 else if(buttonState11 == LOW) { 422 tone(0, NOTE_F3);} 423 else if(buttonState12 == LOW) { 424 tone(0, NOTE_FS3);} 425 else if(buttonState13 == LOW) { 426 tone(0, NOTE_G3);} 427 else { 428 noTone(0); } 429 } 430 431 432 else if (dip1state == HIGH // 09 in HEX; GS2 433 && dip2state == LOW 434 && dip3state == LOW 435 && dip4state == HIGH 436 && dip5state == LOW 437 && dip6state == LOW) 438 {if (buttonState1 == LOW) { 439 tone(0, NOTE_GS2);} 440 else if (buttonState2 == LOW) { 441 tone(0, NOTE_A2);} 442 else if(buttonState3 == LOW) { 443 tone(0, NOTE_AS2);} 444 else if(buttonState4 == LOW) { 445 tone(0, NOTE_B2);} 446 else if(buttonState5 == LOW) { 447 tone(0, NOTE_C3);} 448 else if(buttonState6 == LOW) { 449 tone(0, NOTE_CS3);} 450 else if(buttonState7 == LOW) { 451 tone(0, NOTE_D3);} 452 else if(buttonState8 == LOW) { 453 tone(0, NOTE_DS3);} 454 else if(buttonState9 == LOW) { 455 tone(0, NOTE_E3);} 456 else if(buttonState10 == LOW) { 457 tone(0, NOTE_F3);} 458 else if(buttonState11 == LOW) { 459 tone(0, NOTE_FS3);} 460 else if(buttonState12 == LOW) { 461 tone(0, NOTE_G3);} 462 else if(buttonState13 == LOW) { 463 tone(0, NOTE_GS3);} 464 else { 465 noTone(0); } 466 } 467 468else if (dip1state == LOW // 0A in HEX; A2 469 && dip2state == HIGH 470 && dip3state == LOW 471 && dip4state == HIGH 472 && dip5state == LOW 473 && dip6state == LOW) 474 {if (buttonState1 == LOW) { 475 tone(0, NOTE_A2);} 476 else if (buttonState2 == LOW) { 477 tone(0, NOTE_AS2);} 478 else if(buttonState3 == LOW) { 479 tone(0, NOTE_B2);} 480 else if(buttonState4 == LOW) { 481 tone(0, NOTE_C3);} 482 else if(buttonState5 == LOW) { 483 tone(0, NOTE_CS3);} 484 else if(buttonState6 == LOW) { 485 tone(0, NOTE_D3);} 486 else if(buttonState7 == LOW) { 487 tone(0, NOTE_DS3);} 488 else if(buttonState8 == LOW) { 489 tone(0, NOTE_E3);} 490 else if(buttonState9 == LOW) { 491 tone(0, NOTE_F3);} 492 else if(buttonState10 == LOW) { 493 tone(0, NOTE_FS3);} 494 else if(buttonState11 == LOW) { 495 tone(0, NOTE_G3);} 496 else if(buttonState12 == LOW) { 497 tone(0, NOTE_GS3);} 498 else if(buttonState13 == LOW) { 499 tone(0, NOTE_A3);} 500 else { 501 noTone(0); } 502 } 503 504else if (dip1state == HIGH // 0B in HEX; AS2 505 && dip2state == HIGH 506 && dip3state == LOW 507 && dip4state == HIGH 508 && dip5state == LOW 509 && dip6state == LOW) 510 {if (buttonState1 == LOW) { 511 tone(0, NOTE_AS2);} 512 else if (buttonState2 == LOW) { 513 tone(0, NOTE_B2);} 514 else if(buttonState3 == LOW) { 515 tone(0, NOTE_C3);} 516 else if(buttonState4 == LOW) { 517 tone(0, NOTE_CS3);} 518 else if(buttonState5 == LOW) { 519 tone(0, NOTE_D3);} 520 else if(buttonState6 == LOW) { 521 tone(0, NOTE_DS3);} 522 else if(buttonState7 == LOW) { 523 tone(0, NOTE_E3);} 524 else if(buttonState8 == LOW) { 525 tone(0, NOTE_F3);} 526 else if(buttonState9 == LOW) { 527 tone(0, NOTE_FS3);} 528 else if(buttonState10 == LOW) { 529 tone(0, NOTE_G3);} 530 else if(buttonState11 == LOW) { 531 tone(0, NOTE_GS3);} 532 else if(buttonState12 == LOW) { 533 tone(0, NOTE_A3);} 534 else if(buttonState13 == LOW) { 535 tone(0, NOTE_AS3);} 536 else { 537 noTone(0); } 538 } 539 540 else if (dip1state == LOW // 0C in HEX; B2 541 && dip2state == LOW 542 && dip3state == HIGH 543 && dip4state == HIGH 544 && dip5state == LOW 545 && dip6state == LOW) 546 {if (buttonState1 == LOW) { 547 tone(0, NOTE_B2);} 548 else if (buttonState2 == LOW) { 549 tone(0, NOTE_C3);} 550 else if(buttonState3 == LOW) { 551 tone(0, NOTE_CS3);} 552 else if(buttonState4 == LOW) { 553 tone(0, NOTE_D3);} 554 else if(buttonState5 == LOW) { 555 tone(0, NOTE_DS3);} 556 else if(buttonState6 == LOW) { 557 tone(0, NOTE_E3);} 558 else if(buttonState7 == LOW) { 559 tone(0, NOTE_F3);} 560 else if(buttonState8 == LOW) { 561 tone(0, NOTE_FS3);} 562 else if(buttonState9 == LOW) { 563 tone(0, NOTE_G3);} 564 else if(buttonState10 == LOW) { 565 tone(0, NOTE_GS3);} 566 else if(buttonState11 == LOW) { 567 tone(0, NOTE_A3);} 568 else if(buttonState12 == LOW) { 569 tone(0, NOTE_AS3);} 570 else if(buttonState13 == LOW) { 571 tone(0, NOTE_B3);} 572 else { 573 noTone(0); } 574 } 575 576 else if (dip1state == HIGH //0D in HEX; C3 577 && dip2state == LOW 578 && dip3state == HIGH 579 && dip4state == HIGH 580 && dip5state == LOW 581 && dip6state == LOW) 582 583 {if (buttonState1 == LOW) { 584 tone(0, NOTE_C3);} 585 else if (buttonState2 == LOW) { 586 tone(0, NOTE_CS3);} 587 else if(buttonState3 == LOW) { 588 tone(0, NOTE_D3);} 589 else if(buttonState4 == LOW) { 590 tone(0, NOTE_DS3);} 591 else if(buttonState5 == LOW) { 592 tone(0, NOTE_E3);} 593 else if(buttonState6 == LOW) { 594 tone(0, NOTE_F3);} 595 else if(buttonState7 == LOW) { 596 tone(0, NOTE_FS3);} 597 else if(buttonState8 == LOW) { 598 tone(0, NOTE_G3);} 599 else if(buttonState9 == LOW) { 600 tone(0, NOTE_GS3);} 601 else if(buttonState10 == LOW) { 602 tone(0, NOTE_A3);} 603 else if(buttonState11 == LOW) { 604 tone(0, NOTE_AS3);} 605 else if(buttonState12 == LOW) { 606 tone(0, NOTE_B3);} 607 else if(buttonState13 == LOW) { 608 tone(0, NOTE_C4);} 609 else { 610 noTone(0); } 611 } 612 613 else if (dip1state == LOW // 0E in HEX; CS3 614 && dip2state == HIGH 615 && dip3state == HIGH 616 && dip4state == HIGH 617 && dip5state == LOW 618 && dip6state == LOW) 619 620 {if (buttonState1 == LOW) { 621 tone(0, NOTE_CS3);} 622 else if (buttonState2 == LOW) { 623 tone(0, NOTE_D3);} 624 else if(buttonState3 == LOW) { 625 tone(0, NOTE_DS3);} 626 else if(buttonState4 == LOW) { 627 tone(0, NOTE_E3);} 628 else if(buttonState5 == LOW) { 629 tone(0, NOTE_F3);} 630 else if(buttonState6 == LOW) { 631 tone(0, NOTE_FS3);} 632 else if(buttonState7 == LOW) { 633 tone(0, NOTE_G3);} 634 else if(buttonState8 == LOW) { 635 tone(0, NOTE_GS3);} 636 else if(buttonState9 == LOW) { 637 tone(0, NOTE_A3);} 638 else if(buttonState10 == LOW) { 639 tone(0, NOTE_AS3);} 640 else if(buttonState11 == LOW) { 641 tone(0, NOTE_B3);} 642 else if(buttonState12 == LOW) { 643 tone(0, NOTE_C4);} 644 else if(buttonState13 == LOW) { 645 tone(0, NOTE_CS4);} 646 else { 647 noTone(0); } 648 } 649else if (dip1state == HIGH // 0F in HEX; D3 650 && dip2state == HIGH 651 && dip3state == HIGH 652 && dip4state == HIGH 653 && dip5state == LOW 654 && dip6state == LOW) 655{if (buttonState1 == LOW) { 656 tone(0, NOTE_D3);} 657 else if (buttonState2 == LOW) { 658 tone(0, NOTE_DS3);} 659 else if(buttonState3 == LOW) { 660 tone(0, NOTE_E3);} 661 else if(buttonState4 == LOW) { 662 tone(0, NOTE_F3);} 663 else if(buttonState5 == LOW) { 664 tone(0, NOTE_FS3);} 665 else if(buttonState6 == LOW) { 666 tone(0, NOTE_G3);} 667 else if(buttonState7 == LOW) { 668 tone(0, NOTE_GS3);} 669 else if(buttonState8 == LOW) { 670 tone(0, NOTE_A3);} 671 else if(buttonState9 == LOW) { 672 tone(0, NOTE_AS3);} 673 else if(buttonState10 == LOW) { 674 tone(0, NOTE_B3);} 675 else if(buttonState11 == LOW) { 676 tone(0, NOTE_C4);} 677 else if(buttonState12 == LOW) { 678 tone(0, NOTE_CS4);} 679 else if(buttonState13 == LOW) { 680 tone(0, NOTE_D4);} 681 else { 682 noTone(0); } 683 } 684 685else if (dip1state == LOW // 10 in HEX DS3 686 && dip2state == LOW 687 && dip3state == LOW 688 && dip4state == LOW 689 && dip5state == HIGH 690 && dip6state == LOW) 691 { if (buttonState1 == LOW) { 692 tone(0, NOTE_DS3);} 693 else if (buttonState2 == LOW) { 694 tone(0, NOTE_E3);} 695 else if(buttonState3 == LOW) { 696 tone(0, NOTE_F3);} 697 else if(buttonState4 == LOW) { 698 tone(0, NOTE_FS3);} 699 else if(buttonState5 == LOW) { 700 tone(0, NOTE_G3);} 701 else if(buttonState6 == LOW) { 702 tone(0, NOTE_GS3);} 703 else if(buttonState7 == LOW) { 704 tone(0, NOTE_A3);} 705 else if(buttonState8 == LOW) { 706 tone(0, NOTE_AS3);} 707 else if(buttonState9 == LOW) { 708 tone(0, NOTE_B3);} 709 else if(buttonState10 == LOW) { 710 tone(0, NOTE_C4);} 711 else if(buttonState11 == LOW) { 712 tone(0, NOTE_CS4);} 713 else if(buttonState12 == LOW) { 714 tone(0, NOTE_D4);} 715 else if(buttonState13 == LOW) { 716 tone(0, NOTE_DS4);} 717 else { 718 noTone(0); } 719 } 720 721 else if (dip1state == HIGH // 11 in HEX; E3 722 && dip2state == LOW 723 && dip3state == LOW 724 && dip4state == LOW 725 && dip5state == HIGH 726 && dip6state == LOW) 727 { if (buttonState1 == LOW) { 728 tone(0, NOTE_E3);} 729 else if (buttonState2 == LOW) { 730 tone(0, NOTE_F3);} 731 else if(buttonState3 == LOW) { 732 tone(0, NOTE_FS3);} 733 else if(buttonState4 == LOW) { 734 tone(0, NOTE_G3);} 735 else if(buttonState5 == LOW) { 736 tone(0, NOTE_GS3);} 737 else if(buttonState6 == LOW) { 738 tone(0, NOTE_A3);} 739 else if(buttonState7 == LOW) { 740 tone(0, NOTE_AS3);} 741 else if(buttonState8 == LOW) { 742 tone(0, NOTE_B3);} 743 else if(buttonState9 == LOW) { 744 tone(0, NOTE_C4);} 745 else if(buttonState10 == LOW) { 746 tone(0, NOTE_CS4);} 747 else if(buttonState11 == LOW) { 748 tone(0, NOTE_D4);} 749 else if(buttonState12 == LOW) { 750 tone(0, NOTE_DS4);} 751 else if(buttonState13 == LOW) { 752 tone(0, NOTE_E4);} 753 else { 754 noTone(0); } 755 } 756 757 758else if (dip1state == LOW // 12 in HEX; F3 759 && dip2state == HIGH 760 && dip3state == LOW 761 && dip4state == LOW 762 && dip5state == HIGH 763 && dip6state == LOW) 764 765{ if (buttonState1 == LOW) { 766 tone(0, NOTE_F3);} 767 else if (buttonState2 == LOW) { 768 tone(0, NOTE_FS3);} 769 else if(buttonState3 == LOW) { 770 tone(0, NOTE_G3);} 771 else if(buttonState4 == LOW) { 772 tone(0, NOTE_GS3);} 773 else if(buttonState5 == LOW) { 774 tone(0, NOTE_A3);} 775 else if(buttonState6 == LOW) { 776 tone(0, NOTE_AS3);} 777 else if(buttonState7 == LOW) { 778 tone(0, NOTE_B3);} 779 else if(buttonState8 == LOW) { 780 tone(0, NOTE_C4);} 781 else if(buttonState9 == LOW) { 782 tone(0, NOTE_CS4);} 783 else if(buttonState10 == LOW) { 784 tone(0, NOTE_D4);} 785 else if(buttonState11 == LOW) { 786 tone(0, NOTE_DS4);} 787 else if(buttonState12 == LOW) { 788 tone(0, NOTE_E4);} 789 else if(buttonState13 == LOW) { 790 tone(0, NOTE_F4);} 791 else { 792 noTone(0); } 793 } 794 795 else if (dip1state == HIGH // 13 in HEX; FS3 796 && dip2state == HIGH 797 && dip3state == LOW 798 && dip4state == LOW 799 && dip5state == HIGH 800 && dip6state == LOW) 801{ if (buttonState1 == LOW) { 802 tone(0, NOTE_FS3);} 803 else if (buttonState2 == LOW) { 804 tone(0, NOTE_G3);} 805 else if(buttonState3 == LOW) { 806 tone(0, NOTE_GS3);} 807 else if(buttonState4 == LOW) { 808 tone(0, NOTE_A3);} 809 else if(buttonState5 == LOW) { 810 tone(0, NOTE_AS3);} 811 else if(buttonState6 == LOW) { 812 tone(0, NOTE_B3);} 813 else if(buttonState7 == LOW) { 814 tone(0, NOTE_C4);} 815 else if(buttonState8 == LOW) { 816 tone(0, NOTE_CS4);} 817 else if(buttonState9 == LOW) { 818 tone(0, NOTE_D4);} 819 else if(buttonState10 == LOW) { 820 tone(0, NOTE_DS4);} 821 else if(buttonState11 == LOW) { 822 tone(0, NOTE_E4);} 823 else if(buttonState12 == LOW) { 824 tone(0, NOTE_F4);} 825 else if(buttonState13 == LOW) { 826 tone(0, NOTE_FS4);} 827 else { 828 noTone(0); } 829 } 830 831 else if (dip1state == LOW // 14 in HEX; G3 832 && dip2state == LOW 833 && dip3state == HIGH 834 && dip4state == LOW 835 && dip5state == HIGH 836 && dip6state == LOW) 837{ if (buttonState1 == LOW) { 838 tone(0, NOTE_G3);} 839 else if (buttonState2 == LOW) { 840 tone(0, NOTE_GS3);} 841 else if(buttonState3 == LOW) { 842 tone(0, NOTE_A3);} 843 else if(buttonState4 == LOW) { 844 tone(0, NOTE_AS3);} 845 else if(buttonState5 == LOW) { 846 tone(0, NOTE_B3);} 847 else if(buttonState6 == LOW) { 848 tone(0, NOTE_C4);} 849 else if(buttonState7 == LOW) { 850 tone(0, NOTE_CS4);} 851 else if(buttonState8 == LOW) { 852 tone(0, NOTE_D4);} 853 else if(buttonState9 == LOW) { 854 tone(0, NOTE_DS4);} 855 else if(buttonState10 == LOW) { 856 tone(0, NOTE_E4);} 857 else if(buttonState11 == LOW) { 858 tone(0, NOTE_F4);} 859 else if(buttonState12 == LOW) { 860 tone(0, NOTE_FS4);} 861 else if(buttonState13 == LOW) { 862 tone(0, NOTE_G4);} 863 else { 864 noTone(0); } 865 } 866 else if (dip1state == HIGH // 15 in HEX; GS3 867 && dip2state == LOW 868 && dip3state == HIGH 869 && dip4state == LOW 870 && dip5state == HIGH 871 && dip6state == LOW) 872{ if (buttonState1 == LOW) { 873 tone(0, NOTE_GS3);} 874 else if (buttonState2 == LOW) { 875 tone(0, NOTE_A3);} 876 else if(buttonState3 == LOW) { 877 tone(0, NOTE_AS3);} 878 else if(buttonState4 == LOW) { 879 tone(0, NOTE_B3);} 880 else if(buttonState5 == LOW) { 881 tone(0, NOTE_C4);} 882 else if(buttonState6 == LOW) { 883 tone(0, NOTE_CS4);} 884 else if(buttonState7 == LOW) { 885 tone(0, NOTE_D4);} 886 else if(buttonState8 == LOW) { 887 tone(0, NOTE_DS4);} 888 else if(buttonState9 == LOW) { 889 tone(0, NOTE_E4);} 890 else if(buttonState10 == LOW) { 891 tone(0, NOTE_F4);} 892 else if(buttonState11 == LOW) { 893 tone(0, NOTE_FS4);} 894 else if(buttonState12 == LOW) { 895 tone(0, NOTE_G4);} 896 else if(buttonState13 == LOW) { 897 tone(0, NOTE_GS4);} 898 else { 899 noTone(0); } 900 } 901 902else if (dip1state == LOW // 16 in HEX; A3 903 && dip2state == HIGH 904 && dip3state == HIGH 905 && dip4state == LOW 906 && dip5state == HIGH 907 && dip6state == LOW) 908{ if (buttonState1 == LOW) { 909 tone(0, NOTE_A3);} 910 else if (buttonState2 == LOW) { 911 tone(0, NOTE_AS3);} 912 else if(buttonState3 == LOW) { 913 tone(0, NOTE_B3);} 914 else if(buttonState4 == LOW) { 915 tone(0, NOTE_C4);} 916 else if(buttonState5 == LOW) { 917 tone(0, NOTE_CS4);} 918 else if(buttonState6 == LOW) { 919 tone(0, NOTE_D4);} 920 else if(buttonState7 == LOW) { 921 tone(0, NOTE_DS4);} 922 else if(buttonState8 == LOW) { 923 tone(0, NOTE_E4);} 924 else if(buttonState9 == LOW) { 925 tone(0, NOTE_F4);} 926 else if(buttonState10 == LOW) { 927 tone(0, NOTE_FS4);} 928 else if(buttonState11 == LOW) { 929 tone(0, NOTE_G4);} 930 else if(buttonState12 == LOW) { 931 tone(0, NOTE_GS4);} 932 else if(buttonState13 == LOW) { 933 tone(0, NOTE_A4);} 934 else { 935 noTone(0); } 936 } 937 938else if (dip1state == HIGH // 17 in HEX; AS3 939 && dip2state == HIGH 940 && dip3state == HIGH 941 && dip4state == LOW 942 && dip5state == HIGH 943 && dip6state == LOW) 944{ if (buttonState1 == LOW) { 945 tone(0, NOTE_AS3);} 946 else if (buttonState2 == LOW) { 947 tone(0, NOTE_B3);} 948 else if(buttonState3 == LOW) { 949 tone(0, NOTE_C4);} 950 else if(buttonState4 == LOW) { 951 tone(0, NOTE_CS4);} 952 else if(buttonState5 == LOW) { 953 tone(0, NOTE_D4);} 954 else if(buttonState6 == LOW) { 955 tone(0, NOTE_DS4);} 956 else if(buttonState7 == LOW) { 957 tone(0, NOTE_E4);} 958 else if(buttonState8 == LOW) { 959 tone(0, NOTE_F4);} 960 else if(buttonState9 == LOW) { 961 tone(0, NOTE_FS4);} 962 else if(buttonState10 == LOW) { 963 tone(0, NOTE_G4);} 964 else if(buttonState11 == LOW) { 965 tone(0, NOTE_GS4);} 966 else if(buttonState12 == LOW) { 967 tone(0, NOTE_A4);} 968 else if(buttonState13 == LOW) { 969 tone(0, NOTE_AS4);} 970 else { 971 noTone(0); } 972 } 973 else if (dip1state == LOW // 18 in HEX; B3 974 && dip2state == LOW 975 && dip3state == LOW 976 && dip4state == HIGH 977 && dip5state == HIGH 978 && dip6state == LOW) 979{ if (buttonState1 == LOW) { 980 tone(0, NOTE_B3);} 981 else if (buttonState2 == LOW) { 982 tone(0, NOTE_C4);} 983 else if(buttonState3 == LOW) { 984 tone(0, NOTE_CS4);} 985 else if(buttonState4 == LOW) { 986 tone(0, NOTE_D4);} 987 else if(buttonState5 == LOW) { 988 tone(0, NOTE_DS4);} 989 else if(buttonState6 == LOW) { 990 tone(0, NOTE_E4);} 991 else if(buttonState7 == LOW) { 992 tone(0, NOTE_F4);} 993 else if(buttonState8 == LOW) { 994 tone(0, NOTE_FS4);} 995 else if(buttonState9 == LOW) { 996 tone(0, NOTE_G4);} 997 else if(buttonState10 == LOW) { 998 tone(0, NOTE_GS4);} 999 else if(buttonState11 == LOW) { 1000 tone(0, NOTE_A4);} 1001 else if(buttonState12 == LOW) { 1002 tone(0, NOTE_AS4);} 1003 else if(buttonState13 == LOW) { 1004 tone(0, NOTE_B4);} 1005 else { 1006 noTone(0); } 1007 } 1008 else if (dip1state == HIGH //19 in HEX; C4 1009 && dip2state == LOW 1010 && dip3state == LOW 1011 && dip4state == HIGH 1012 && dip5state == HIGH 1013 && dip6state == LOW) 1014{ if (buttonState1 == LOW) { 1015 tone(0, NOTE_C4);} 1016 else if (buttonState2 == LOW) { 1017 tone(0, NOTE_CS4);} 1018 else if(buttonState3 == LOW) { 1019 tone(0, NOTE_D4);} 1020 else if(buttonState4 == LOW) { 1021 tone(0, NOTE_DS4);} 1022 else if(buttonState5 == LOW) { 1023 tone(0, NOTE_E4);} 1024 else if(buttonState6 == LOW) { 1025 tone(0, NOTE_F4);} 1026 else if(buttonState7 == LOW) { 1027 tone(0, NOTE_FS4);} 1028 else if(buttonState8 == LOW) { 1029 tone(0, NOTE_G4);} 1030 else if(buttonState9 == LOW) { 1031 tone(0, NOTE_GS4);} 1032 else if(buttonState10 == LOW) { 1033 tone(0, NOTE_A4);} 1034 else if(buttonState11 == LOW) { 1035 tone(0, NOTE_AS4);} 1036 else if(buttonState12 == LOW) { 1037 tone(0, NOTE_B4);} 1038 else if(buttonState13 == LOW) { 1039 tone(0, NOTE_C5);} 1040 else { 1041 noTone(0); } 1042 } 1043 else if (dip1state == LOW // 1A in HEX; CS4 1044 && dip2state == HIGH 1045 && dip3state == LOW 1046 && dip4state == HIGH 1047 && dip5state == HIGH 1048 && dip6state == LOW) 1049{ if (buttonState1 == LOW) { 1050 tone(0, NOTE_CS4);} 1051 else if (buttonState2 == LOW) { 1052 tone(0, NOTE_D4);} 1053 else if(buttonState3 == LOW) { 1054 tone(0, NOTE_DS4);} 1055 else if(buttonState4 == LOW) { 1056 tone(0, NOTE_E4);} 1057 else if(buttonState5 == LOW) { 1058 tone(0, NOTE_F4);} 1059 else if(buttonState6 == LOW) { 1060 tone(0, NOTE_FS4);} 1061 else if(buttonState7 == LOW) { 1062 tone(0, NOTE_G4);} 1063 else if(buttonState8 == LOW) { 1064 tone(0, NOTE_GS4);} 1065 else if(buttonState9 == LOW) { 1066 tone(0, NOTE_A4);} 1067 else if(buttonState10 == LOW) { 1068 tone(0, NOTE_AS4);} 1069 else if(buttonState11 == LOW) { 1070 tone(0, NOTE_B4);} 1071 else if(buttonState12 == LOW) { 1072 tone(0, NOTE_C5);} 1073 else if(buttonState13 == LOW) { 1074 tone(0, NOTE_CS5);} 1075 else { 1076 noTone(0); } 1077 } 1078 1079 else if (dip1state == HIGH // 1B in HEX; D4 1080 && dip2state == HIGH 1081 && dip3state == LOW 1082 && dip4state == HIGH 1083 && dip5state == HIGH 1084 && dip6state == LOW) 1085{ if (buttonState1 == LOW) { 1086 tone(0, NOTE_D4);} 1087 else if (buttonState2 == LOW) { 1088 tone(0, NOTE_DS4);} 1089 else if(buttonState3 == LOW) { 1090 tone(0, NOTE_E4);} 1091 else if(buttonState4 == LOW) { 1092 tone(0, NOTE_F4);} 1093 else if(buttonState5 == LOW) { 1094 tone(0, NOTE_FS4);} 1095 else if(buttonState6 == LOW) { 1096 tone(0, NOTE_G4);} 1097 else if(buttonState7 == LOW) { 1098 tone(0, NOTE_GS4);} 1099 else if(buttonState8 == LOW) { 1100 tone(0, NOTE_A4);} 1101 else if(buttonState9 == LOW) { 1102 tone(0, NOTE_AS4);} 1103 else if(buttonState10 == LOW) { 1104 tone(0, NOTE_B4);} 1105 else if(buttonState11 == LOW) { 1106 tone(0, NOTE_C5);} 1107 else if(buttonState12 == LOW) { 1108 tone(0, NOTE_CS5);} 1109 else if(buttonState13 == LOW) { 1110 tone(0, NOTE_D5);} 1111 else { 1112 noTone(0); } 1113 } 1114 1115 else if (dip1state == LOW // 1C in HEX DS4 1116 && dip2state == LOW 1117 && dip3state == HIGH 1118 && dip4state == HIGH 1119 && dip5state == HIGH 1120 && dip6state == LOW) 1121{ if (buttonState1 == LOW) { 1122 tone(0, NOTE_DS4);} 1123 else if (buttonState2 == LOW) { 1124 tone(0, NOTE_E4);} 1125 else if(buttonState3 == LOW) { 1126 tone(0, NOTE_F4);} 1127 else if(buttonState4 == LOW) { 1128 tone(0, NOTE_FS4);} 1129 else if(buttonState5 == LOW) { 1130 tone(0, NOTE_G4);} 1131 else if(buttonState6 == LOW) { 1132 tone(0, NOTE_GS4);} 1133 else if(buttonState7 == LOW) { 1134 tone(0, NOTE_A4);} 1135 else if(buttonState8 == LOW) { 1136 tone(0, NOTE_AS4);} 1137 else if(buttonState9 == LOW) { 1138 tone(0, NOTE_B4);} 1139 else if(buttonState10 == LOW) { 1140 tone(0, NOTE_C5);} 1141 else if(buttonState11 == LOW) { 1142 tone(0, NOTE_CS5);} 1143 else if(buttonState12 == LOW) { 1144 tone(0, NOTE_D5);} 1145 else if(buttonState13 == LOW) { 1146 tone(0, NOTE_DS5);} 1147 else { 1148 noTone(0); } 1149 } 1150 else if (dip1state == HIGH // 1D in HEX; E4 1151 && dip2state == LOW 1152 && dip3state == HIGH 1153 && dip4state == HIGH 1154 && dip5state == HIGH 1155 && dip6state == LOW) 1156 { if (buttonState1 == LOW) { 1157 tone(0, NOTE_E4);} 1158 else if (buttonState2 == LOW) { 1159 tone(0, NOTE_F4);} 1160 else if(buttonState3 == LOW) { 1161 tone(0, NOTE_FS4);} 1162 else if(buttonState4 == LOW) { 1163 tone(0, NOTE_G4);} 1164 else if(buttonState5 == LOW) { 1165 tone(0, NOTE_GS4);} 1166 else if(buttonState6 == LOW) { 1167 tone(0, NOTE_A4);} 1168 else if(buttonState7 == LOW) { 1169 tone(0, NOTE_AS4);} 1170 else if(buttonState8 == LOW) { 1171 tone(0, NOTE_B4);} 1172 else if(buttonState9 == LOW) { 1173 tone(0, NOTE_C5);} 1174 else if(buttonState10 == LOW) { 1175 tone(0, NOTE_CS5);} 1176 else if(buttonState11 == LOW) { 1177 tone(0, NOTE_D5);} 1178 else if(buttonState12 == LOW) { 1179 tone(0, NOTE_DS5);} 1180 else if(buttonState13 == LOW) { 1181 tone(0, NOTE_E5);} 1182 else { 1183 noTone(0); } 1184 } 1185 else if (dip1state == LOW // 1E in HEX; F4 1186 && dip2state == HIGH 1187 && dip3state == HIGH 1188 && dip4state == HIGH 1189 && dip5state == HIGH 1190 && dip6state == LOW) 1191 { if (buttonState1 == LOW) { 1192 tone(0, NOTE_F4);} 1193 else if (buttonState2 == LOW) { 1194 tone(0, NOTE_FS4);} 1195 else if(buttonState3 == LOW) { 1196 tone(0, NOTE_G4);} 1197 else if(buttonState4 == LOW) { 1198 tone(0, NOTE_GS4);} 1199 else if(buttonState5 == LOW) { 1200 tone(0, NOTE_A4);} 1201 else if(buttonState6 == LOW) { 1202 tone(0, NOTE_AS4);} 1203 else if(buttonState7 == LOW) { 1204 tone(0, NOTE_B4);} 1205 else if(buttonState8 == LOW) { 1206 tone(0, NOTE_C5);} 1207 else if(buttonState9 == LOW) { 1208 tone(0, NOTE_CS5);} 1209 else if(buttonState10 == LOW) { 1210 tone(0, NOTE_D5);} 1211 else if(buttonState11 == LOW) { 1212 tone(0, NOTE_DS5);} 1213 else if(buttonState12 == LOW) { 1214 tone(0, NOTE_E5);} 1215 else if(buttonState13 == LOW) { 1216 tone(0, NOTE_F5);} 1217 else { 1218 noTone(0); } 1219 } 1220 1221 else if (dip1state == HIGH // 1F in HEX; FS4 1222 && dip2state == HIGH 1223 && dip3state == HIGH 1224 && dip4state == HIGH 1225 && dip5state == HIGH 1226 && dip6state == LOW) 1227 { if (buttonState1 == LOW) { 1228 tone(0, NOTE_FS4);} 1229 else if (buttonState2 == LOW) { 1230 tone(0, NOTE_G4);} 1231 else if(buttonState3 == LOW) { 1232 tone(0, NOTE_GS4);} 1233 else if(buttonState4 == LOW) { 1234 tone(0, NOTE_A4);} 1235 else if(buttonState5 == LOW) { 1236 tone(0, NOTE_AS4);} 1237 else if(buttonState6 == LOW) { 1238 tone(0, NOTE_B4);} 1239 else if(buttonState7 == LOW) { 1240 tone(0, NOTE_C5);} 1241 else if(buttonState8 == LOW) { 1242 tone(0, NOTE_CS5);} 1243 else if(buttonState9 == LOW) { 1244 tone(0, NOTE_D5);} 1245 else if(buttonState10 == LOW) { 1246 tone(0, NOTE_DS5);} 1247 else if(buttonState11 == LOW) { 1248 tone(0, NOTE_E5);} 1249 else if(buttonState12 == LOW) { 1250 tone(0, NOTE_F5);} 1251 else if(buttonState13 == LOW) { 1252 tone(0, NOTE_FS5);} 1253 else { 1254 noTone(0); } 1255 } 1256 1257else if (dip1state == LOW // 20 in HEX; G4 1258 && dip2state == LOW 1259 && dip3state == LOW 1260 && dip4state == LOW 1261 && dip5state == LOW 1262 && dip6state == HIGH) 1263 { if (buttonState1 == LOW) { 1264 tone(0, NOTE_G4);} 1265 else if (buttonState2 == LOW) { 1266 tone(0, NOTE_GS4);} 1267 else if(buttonState3 == LOW) { 1268 tone(0, NOTE_A4);} 1269 else if(buttonState4 == LOW) { 1270 tone(0, NOTE_AS4);} 1271 else if(buttonState5 == LOW) { 1272 tone(0, NOTE_B4);} 1273 else if(buttonState6 == LOW) { 1274 tone(0, NOTE_C5);} 1275 else if(buttonState7 == LOW) { 1276 tone(0, NOTE_CS5);} 1277 else if(buttonState8 == LOW) { 1278 tone(0, NOTE_D5);} 1279 else if(buttonState9 == LOW) { 1280 tone(0, NOTE_DS5);} 1281 else if(buttonState10 == LOW) { 1282 tone(0, NOTE_E5);} 1283 else if(buttonState11 == LOW) { 1284 tone(0, NOTE_F5);} 1285 else if(buttonState12 == LOW) { 1286 tone(0, NOTE_FS5);} 1287 else if(buttonState13 == LOW) { 1288 tone(0, NOTE_G5);} 1289 else { 1290 noTone(0); } 1291 } 1292else if (dip1state == HIGH // 21 in HEX; GS4 1293 && dip2state == LOW 1294 && dip3state == LOW 1295 && dip4state == LOW 1296 && dip5state == LOW 1297 && dip6state == HIGH) 1298 { if (buttonState1 == LOW) { 1299 tone(0, NOTE_GS4);} 1300 else if (buttonState2 == LOW) { 1301 tone(0, NOTE_A4);} 1302 else if(buttonState3 == LOW) { 1303 tone(0, NOTE_AS4);} 1304 else if(buttonState4 == LOW) { 1305 tone(0, NOTE_B4);} 1306 else if(buttonState5 == LOW) { 1307 tone(0, NOTE_C5);} 1308 else if(buttonState6 == LOW) { 1309 tone(0, NOTE_CS5);} 1310 else if(buttonState7 == LOW) { 1311 tone(0, NOTE_D5);} 1312 else if(buttonState8 == LOW) { 1313 tone(0, NOTE_DS5);} 1314 else if(buttonState9 == LOW) { 1315 tone(0, NOTE_E5);} 1316 else if(buttonState10 == LOW) { 1317 tone(0, NOTE_F5);} 1318 else if(buttonState11 == LOW) { 1319 tone(0, NOTE_FS5);} 1320 else if(buttonState12 == LOW) { 1321 tone(0, NOTE_G5);} 1322 else if(buttonState13 == LOW) { 1323 tone(0, NOTE_GS5);} 1324 else { 1325 noTone(0); } 1326 } 1327else if (dip1state == LOW // 22 in HEX; A4 1328 && dip2state == HIGH 1329 && dip3state == LOW 1330 && dip4state == LOW 1331 && dip5state == LOW 1332 && dip6state == HIGH) 1333 { if (buttonState1 == LOW) { 1334 tone(0, NOTE_A4);} 1335 else if (buttonState2 == LOW) { 1336 tone(0, NOTE_AS4);} 1337 else if(buttonState3 == LOW) { 1338 tone(0, NOTE_B4);} 1339 else if(buttonState4 == LOW) { 1340 tone(0, NOTE_C5);} 1341 else if(buttonState5 == LOW) { 1342 tone(0, NOTE_CS5);} 1343 else if(buttonState6 == LOW) { 1344 tone(0, NOTE_D5);} 1345 else if(buttonState7 == LOW) { 1346 tone(0, NOTE_DS5);} 1347 else if(buttonState8 == LOW) { 1348 tone(0, NOTE_E5);} 1349 else if(buttonState9 == LOW) { 1350 tone(0, NOTE_F5);} 1351 else if(buttonState10 == LOW) { 1352 tone(0, NOTE_FS5);} 1353 else if(buttonState11 == LOW) { 1354 tone(0, NOTE_G5);} 1355 else if(buttonState12 == LOW) { 1356 tone(0, NOTE_GS5);} 1357 else if(buttonState13 == LOW) { 1358 tone(0, NOTE_A5);} 1359 else { 1360 noTone(0); } 1361 } 1362 1363 else if (dip1state == HIGH // 23 in HEX; AS4 1364 && dip2state == HIGH 1365 && dip3state == LOW 1366 && dip4state == LOW 1367 && dip5state == LOW 1368 && dip6state == HIGH) 1369 1370 { if (buttonState1 == LOW) { 1371 tone(0, NOTE_AS4);} 1372 else if (buttonState2 == LOW) { 1373 tone(0, NOTE_B4);} 1374 else if(buttonState3 == LOW) { 1375 tone(0, NOTE_C5);} 1376 else if(buttonState4 == LOW) { 1377 tone(0, NOTE_CS5);} 1378 else if(buttonState5 == LOW) { 1379 tone(0, NOTE_D5);} 1380 else if(buttonState6 == LOW) { 1381 tone(0, NOTE_DS5);} 1382 else if(buttonState7 == LOW) { 1383 tone(0, NOTE_E5);} 1384 else if(buttonState8 == LOW) { 1385 tone(0, NOTE_F5);} 1386 else if(buttonState9 == LOW) { 1387 tone(0, NOTE_FS5);} 1388 else if(buttonState10 == LOW) { 1389 tone(0, NOTE_G5);} 1390 else if(buttonState11 == LOW) { 1391 tone(0, NOTE_GS5);} 1392 else if(buttonState12 == LOW) { 1393 tone(0, NOTE_A5);} 1394 else if(buttonState13 == LOW) { 1395 tone(0, NOTE_AS5);} 1396 else { 1397 noTone(0); } 1398 } 1399 1400 else if (dip1state == LOW // 24 in HEX; B4 1401 && dip2state == LOW 1402 && dip3state == HIGH 1403 && dip4state == LOW 1404 && dip5state == LOW 1405 && dip6state == HIGH) 1406{ if (buttonState1 == LOW) { 1407 tone(0, NOTE_B4);} 1408 else if (buttonState2 == LOW) { 1409 tone(0, NOTE_C5);} 1410 else if(buttonState3 == LOW) { 1411 tone(0, NOTE_CS5);} 1412 else if(buttonState4 == LOW) { 1413 tone(0, NOTE_D5);} 1414 else if(buttonState5 == LOW) { 1415 tone(0, NOTE_DS5);} 1416 else if(buttonState6 == LOW) { 1417 tone(0, NOTE_E5);} 1418 else if(buttonState7 == LOW) { 1419 tone(0, NOTE_F5);} 1420 else if(buttonState8 == LOW) { 1421 tone(0, NOTE_FS5);} 1422 else if(buttonState9 == LOW) { 1423 tone(0, NOTE_G5);} 1424 else if(buttonState10 == LOW) { 1425 tone(0, NOTE_GS5);} 1426 else if(buttonState11 == LOW) { 1427 tone(0, NOTE_A5);} 1428 else if(buttonState12 == LOW) { 1429 tone(0, NOTE_AS5);} 1430 else if(buttonState13 == LOW) { 1431 tone(0, NOTE_B5);} 1432 else { 1433 noTone(0); } 1434 } 1435 else if (dip1state == HIGH //25 in HEX; C5 1436 && dip2state == LOW 1437 && dip3state == HIGH 1438 && dip4state == LOW 1439 && dip5state == LOW 1440 && dip6state == HIGH) 1441{ if (buttonState1 == LOW) { 1442 tone(0, NOTE_C5);} 1443 else if (buttonState2 == LOW) { 1444 tone(0, NOTE_CS5);} 1445 else if(buttonState3 == LOW) { 1446 tone(0, NOTE_D5);} 1447 else if(buttonState4 == LOW) { 1448 tone(0, NOTE_DS5);} 1449 else if(buttonState5 == LOW) { 1450 tone(0, NOTE_E5);} 1451 else if(buttonState6 == LOW) { 1452 tone(0, NOTE_F5);} 1453 else if(buttonState7 == LOW) { 1454 tone(0, NOTE_FS5);} 1455 else if(buttonState8 == LOW) { 1456 tone(0, NOTE_G5);} 1457 else if(buttonState9 == LOW) { 1458 tone(0, NOTE_GS5);} 1459 else if(buttonState10 == LOW) { 1460 tone(0, NOTE_A5);} 1461 else if(buttonState11 == LOW) { 1462 tone(0, NOTE_AS5);} 1463 else if(buttonState12 == LOW) { 1464 tone(0, NOTE_B5);} 1465 else if(buttonState13 == LOW) { 1466 tone(0, NOTE_C6);} 1467 else { 1468 noTone(0); } 1469 } 1470 1471else if (dip1state == LOW // 26 in HEX; CS5 1472 && dip2state == HIGH 1473 && dip3state == HIGH 1474 && dip4state == LOW 1475 && dip5state == LOW 1476 && dip6state == HIGH) 1477{ if (buttonState1 == LOW) { 1478 tone(0, NOTE_CS5);} 1479 else if (buttonState2 == LOW) { 1480 tone(0, NOTE_D5);} 1481 else if(buttonState3 == LOW) { 1482 tone(0, NOTE_DS5);} 1483 else if(buttonState4 == LOW) { 1484 tone(0, NOTE_E5);} 1485 else if(buttonState5 == LOW) { 1486 tone(0, NOTE_F5);} 1487 else if(buttonState6 == LOW) { 1488 tone(0, NOTE_FS5);} 1489 else if(buttonState7 == LOW) { 1490 tone(0, NOTE_G5);} 1491 else if(buttonState8 == LOW) { 1492 tone(0, NOTE_GS5);} 1493 else if(buttonState9 == LOW) { 1494 tone(0, NOTE_A5);} 1495 else if(buttonState10 == LOW) { 1496 tone(0, NOTE_AS5);} 1497 else if(buttonState11 == LOW) { 1498 tone(0, NOTE_B5);} 1499 else if(buttonState12 == LOW) { 1500 tone(0, NOTE_C6);} 1501 else if(buttonState13 == LOW) { 1502 tone(0, NOTE_CS6);} 1503 else { 1504 noTone(0); } 1505 } 1506else if (dip1state == HIGH // 27 in HEX; D5 1507 && dip2state == HIGH 1508 && dip3state == HIGH 1509 && dip4state == LOW 1510 && dip5state == LOW 1511 && dip6state == HIGH) 1512 1513{ if (buttonState1 == LOW) { 1514 tone(0, NOTE_D5);} 1515 else if (buttonState2 == LOW) { 1516 tone(0, NOTE_DS5);} 1517 else if(buttonState3 == LOW) { 1518 tone(0, NOTE_E5);} 1519 else if(buttonState4 == LOW) { 1520 tone(0, NOTE_F5);} 1521 else if(buttonState5 == LOW) { 1522 tone(0, NOTE_FS5);} 1523 else if(buttonState6 == LOW) { 1524 tone(0, NOTE_G5);} 1525 else if(buttonState7 == LOW) { 1526 tone(0, NOTE_GS5);} 1527 else if(buttonState8 == LOW) { 1528 tone(0, NOTE_A5);} 1529 else if(buttonState9 == LOW) { 1530 tone(0, NOTE_AS5);} 1531 else if(buttonState10 == LOW) { 1532 tone(0, NOTE_B5);} 1533 else if(buttonState11 == LOW) { 1534 tone(0, NOTE_C6);} 1535 else if(buttonState12 == LOW) { 1536 tone(0, NOTE_CS6);} 1537 else if(buttonState13 == LOW) { 1538 tone(0, NOTE_D6);} 1539 else { 1540 noTone(0); } 1541 } 1542 1543else if (dip1state == LOW // 28 in HEX DS5 1544 && dip2state == LOW 1545 && dip3state == LOW 1546 && dip4state == HIGH 1547 && dip5state == LOW 1548 && dip6state == HIGH) 1549 1550{ if (buttonState1 == LOW) { 1551 tone(0, NOTE_DS5);} 1552 else if (buttonState2 == LOW) { 1553 tone(0, NOTE_E5);} 1554 else if(buttonState3 == LOW) { 1555 tone(0, NOTE_F5);} 1556 else if(buttonState4 == LOW) { 1557 tone(0, NOTE_FS5);} 1558 else if(buttonState5 == LOW) { 1559 tone(0, NOTE_G5);} 1560 else if(buttonState6 == LOW) { 1561 tone(0, NOTE_GS5);} 1562 else if(buttonState7 == LOW) { 1563 tone(0, NOTE_A5);} 1564 else if(buttonState8 == LOW) { 1565 tone(0, NOTE_AS5);} 1566 else if(buttonState9 == LOW) { 1567 tone(0, NOTE_B5);} 1568 else if(buttonState10 == LOW) { 1569 tone(0, NOTE_C6);} 1570 else if(buttonState11 == LOW) { 1571 tone(0, NOTE_CS6);} 1572 else if(buttonState12 == LOW) { 1573 tone(0, NOTE_D6);} 1574 else if(buttonState13 == LOW) { 1575 tone(0, NOTE_DS6);} 1576 else { 1577 noTone(0); } 1578 } 1579 1580 else if (dip1state == HIGH // 29 in HEX; E5 1581 && dip2state == LOW 1582 && dip3state == LOW 1583 && dip4state == HIGH 1584 && dip5state == LOW 1585 && dip6state == HIGH) 1586 1587{ if (buttonState1 == LOW) { 1588 tone(0, NOTE_E5);} 1589 else if (buttonState2 == LOW) { 1590 tone(0, NOTE_F5);} 1591 else if(buttonState3 == LOW) { 1592 tone(0, NOTE_FS5);} 1593 else if(buttonState4 == LOW) { 1594 tone(0, NOTE_G5);} 1595 else if(buttonState5 == LOW) { 1596 tone(0, NOTE_GS5);} 1597 else if(buttonState6 == LOW) { 1598 tone(0, NOTE_A5);} 1599 else if(buttonState7 == LOW) { 1600 tone(0, NOTE_AS5);} 1601 else if(buttonState8 == LOW) { 1602 tone(0, NOTE_B5);} 1603 else if(buttonState9 == LOW) { 1604 tone(0, NOTE_C6);} 1605 else if(buttonState10 == LOW) { 1606 tone(0, NOTE_CS6);} 1607 else if(buttonState11 == LOW) { 1608 tone(0, NOTE_D6);} 1609 else if(buttonState12 == LOW) { 1610 tone(0, NOTE_DS6);} 1611 else if(buttonState13 == LOW) { 1612 tone(0, NOTE_E6);} 1613 else { 1614 noTone(0); } 1615 } 1616 1617else if (dip1state == LOW // 2A in HEX; F5 1618 && dip2state == HIGH 1619 && dip3state == LOW 1620 && dip4state == HIGH 1621 && dip5state == LOW 1622 && dip6state == HIGH) 1623{ if (buttonState1 == LOW) { 1624 tone(0, NOTE_F5);} 1625 else if (buttonState2 == LOW) { 1626 tone(0, NOTE_FS5);} 1627 else if(buttonState3 == LOW) { 1628 tone(0, NOTE_G5);} 1629 else if(buttonState4 == LOW) { 1630 tone(0, NOTE_GS5);} 1631 else if(buttonState5 == LOW) { 1632 tone(0, NOTE_A5);} 1633 else if(buttonState6 == LOW) { 1634 tone(0, NOTE_AS5);} 1635 else if(buttonState7 == LOW) { 1636 tone(0, NOTE_B5);} 1637 else if(buttonState8 == LOW) { 1638 tone(0, NOTE_C6);} 1639 else if(buttonState9 == LOW) { 1640 tone(0, NOTE_CS6);} 1641 else if(buttonState10 == LOW) { 1642 tone(0, NOTE_D6);} 1643 else if(buttonState11 == LOW) { 1644 tone(0, NOTE_DS6);} 1645 else if(buttonState12 == LOW) { 1646 tone(0, NOTE_E6);} 1647 else if(buttonState13 == LOW) { 1648 tone(0, NOTE_F6);} 1649 else { 1650 noTone(0); } 1651 } 1652 else if (dip1state == HIGH // 2B in HEX; FS5 1653 && dip2state == HIGH 1654 && dip3state == LOW 1655 && dip4state == HIGH 1656 && dip5state == LOW 1657 && dip6state == HIGH) 1658 1659{ if (buttonState1 == LOW) { 1660 tone(0, NOTE_FS5);} 1661 else if (buttonState2 == LOW) { 1662 tone(0, NOTE_G5);} 1663 else if(buttonState3 == LOW) { 1664 tone(0, NOTE_GS5);} 1665 else if(buttonState4 == LOW) { 1666 tone(0, NOTE_A5);} 1667 else if(buttonState5 == LOW) { 1668 tone(0, NOTE_AS5);} 1669 else if(buttonState6 == LOW) { 1670 tone(0, NOTE_B5);} 1671 else if(buttonState7 == LOW) { 1672 tone(0, NOTE_C6);} 1673 else if(buttonState8 == LOW) { 1674 tone(0, NOTE_CS6);} 1675 else if(buttonState9 == LOW) { 1676 tone(0, NOTE_D6);} 1677 else if(buttonState10 == LOW) { 1678 tone(0, NOTE_DS6);} 1679 else if(buttonState11 == LOW) { 1680 tone(0, NOTE_E6);} 1681 else if(buttonState12 == LOW) { 1682 tone(0, NOTE_F6);} 1683 else if(buttonState13 == LOW) { 1684 tone(0, NOTE_FS6);} 1685 else { 1686 noTone(0); } 1687 } 1688 1689else if (dip1state == LOW // 2C in HEX; G5 1690 && dip2state == LOW 1691 && dip3state == HIGH 1692 && dip4state == HIGH 1693 && dip5state == LOW 1694 && dip6state == HIGH) 1695{ if (buttonState1 == LOW) { 1696 tone(0, NOTE_G5);} 1697 else if (buttonState2 == LOW) { 1698 tone(0, NOTE_GS5);} 1699 else if(buttonState3 == LOW) { 1700 tone(0, NOTE_A5);} 1701 else if(buttonState4 == LOW) { 1702 tone(0, NOTE_AS5);} 1703 else if(buttonState5 == LOW) { 1704 tone(0, NOTE_B5);} 1705 else if(buttonState6 == LOW) { 1706 tone(0, NOTE_C6);} 1707 else if(buttonState7 == LOW) { 1708 tone(0, NOTE_CS6);} 1709 else if(buttonState8 == LOW) { 1710 tone(0, NOTE_D6);} 1711 else if(buttonState9 == LOW) { 1712 tone(0, NOTE_DS6);} 1713 else if(buttonState10 == LOW) { 1714 tone(0, NOTE_E6);} 1715 else if(buttonState11 == LOW) { 1716 tone(0, NOTE_F6);} 1717 else if(buttonState12 == LOW) { 1718 tone(0, NOTE_FS6);} 1719 else if(buttonState13 == LOW) { 1720 tone(0, NOTE_G6);} 1721 else { 1722 noTone(0); } 1723 } 1724 else if (dip1state == HIGH // 2D in HEX; GS5 1725 && dip2state == LOW 1726 && dip3state == HIGH 1727 && dip4state == HIGH 1728 && dip5state == LOW 1729 && dip6state == HIGH) 1730 1731{ if (buttonState1 == LOW) { 1732 tone(0, NOTE_GS5);} 1733 else if (buttonState2 == LOW) { 1734 tone(0, NOTE_A5);} 1735 else if(buttonState3 == LOW) { 1736 tone(0, NOTE_AS5);} 1737 else if(buttonState4 == LOW) { 1738 tone(0, NOTE_B5);} 1739 else if(buttonState5 == LOW) { 1740 tone(0, NOTE_C6);} 1741 else if(buttonState6 == LOW) { 1742 tone(0, NOTE_CS6);} 1743 else if(buttonState7 == LOW) { 1744 tone(0, NOTE_D6);} 1745 else if(buttonState8 == LOW) { 1746 tone(0, NOTE_DS6);} 1747 else if(buttonState9 == LOW) { 1748 tone(0, NOTE_E6);} 1749 else if(buttonState10 == LOW) { 1750 tone(0, NOTE_F6);} 1751 else if(buttonState11 == LOW) { 1752 tone(0, NOTE_FS6);} 1753 else if(buttonState12 == LOW) { 1754 tone(0, NOTE_G6);} 1755 else if(buttonState13 == LOW) { 1756 tone(0, NOTE_GS6);} 1757 else { 1758 noTone(0); } 1759 } 1760 else if (dip1state == LOW // 2E in HEX; A5 1761 && dip2state == HIGH 1762 && dip3state == HIGH 1763 && dip4state == HIGH 1764 && dip5state == LOW 1765 && dip6state == HIGH) 1766 { if (buttonState1 == LOW) { 1767 tone(0, NOTE_A5);} 1768 else if (buttonState2 == LOW) { 1769 tone(0, NOTE_AS5);} 1770 else if(buttonState3 == LOW) { 1771 tone(0, NOTE_B5);} 1772 else if(buttonState4 == LOW) { 1773 tone(0, NOTE_C6);} 1774 else if(buttonState5 == LOW) { 1775 tone(0, NOTE_CS6);} 1776 else if(buttonState6 == LOW) { 1777 tone(0, NOTE_D6);} 1778 else if(buttonState7 == LOW) { 1779 tone(0, NOTE_DS6);} 1780 else if(buttonState8 == LOW) { 1781 tone(0, NOTE_E6);} 1782 else if(buttonState9 == LOW) { 1783 tone(0, NOTE_F6);} 1784 else if(buttonState10 == LOW) { 1785 tone(0, NOTE_FS6);} 1786 else if(buttonState11 == LOW) { 1787 tone(0, NOTE_G6);} 1788 else if(buttonState12 == LOW) { 1789 tone(0, NOTE_GS6);} 1790 else if(buttonState13 == LOW) { 1791 tone(0, NOTE_A6);} 1792 else { 1793 noTone(0); } 1794 } 1795 1796 else if (dip1state == HIGH // 2F in HEX; AS5 1797 && dip2state == HIGH 1798 && dip3state == HIGH 1799 && dip4state == HIGH 1800 && dip5state == LOW 1801 && dip6state == HIGH) 1802 { if (buttonState1 == LOW) { 1803 tone(0, NOTE_AS5);} 1804 else if (buttonState2 == LOW) { 1805 tone(0, NOTE_B5);} 1806 else if(buttonState3 == LOW) { 1807 tone(0, NOTE_C6);} 1808 else if(buttonState4 == LOW) { 1809 tone(0, NOTE_CS6);} 1810 else if(buttonState5 == LOW) { 1811 tone(0, NOTE_D6);} 1812 else if(buttonState6 == LOW) { 1813 tone(0, NOTE_DS6);} 1814 else if(buttonState7 == LOW) { 1815 tone(0, NOTE_E6);} 1816 else if(buttonState8 == LOW) { 1817 tone(0, NOTE_F6);} 1818 else if(buttonState9 == LOW) { 1819 tone(0, NOTE_FS6);} 1820 else if(buttonState10 == LOW) { 1821 tone(0, NOTE_G6);} 1822 else if(buttonState11 == LOW) { 1823 tone(0, NOTE_GS6);} 1824 else if(buttonState12 == LOW) { 1825 tone(0, NOTE_A6);} 1826 else if(buttonState13 == LOW) { 1827 tone(0, NOTE_AS6);} 1828 else { 1829 noTone(0); } 1830 } 1831else if (dip1state == LOW // 30 in HEX; B5 1832 && dip2state == LOW 1833 && dip3state == LOW 1834 && dip4state == LOW 1835 && dip5state == HIGH 1836 && dip6state == HIGH) 1837 1838 { if (buttonState1 == LOW) { 1839 tone(0, NOTE_B5);} 1840 else if (buttonState2 == LOW) { 1841 tone(0, NOTE_C6);} 1842 else if(buttonState3 == LOW) { 1843 tone(0, NOTE_CS6);} 1844 else if(buttonState4 == LOW) { 1845 tone(0, NOTE_D6);} 1846 else if(buttonState5 == LOW) { 1847 tone(0, NOTE_DS6);} 1848 else if(buttonState6 == LOW) { 1849 tone(0, NOTE_E6);} 1850 else if(buttonState7 == LOW) { 1851 tone(0, NOTE_F6);} 1852 else if(buttonState8 == LOW) { 1853 tone(0, NOTE_FS6);} 1854 else if(buttonState9 == LOW) { 1855 tone(0, NOTE_G6);} 1856 else if(buttonState10 == LOW) { 1857 tone(0, NOTE_GS6);} 1858 else if(buttonState11 == LOW) { 1859 tone(0, NOTE_A6);} 1860 else if(buttonState12 == LOW) { 1861 tone(0, NOTE_AS6);} 1862 else if(buttonState13 == LOW) { 1863 tone(0, NOTE_B6);} 1864 else { 1865 noTone(0); } 1866 } 1867 1868 1869 else if (dip1state == HIGH //31 in HEX; C6 1870 && dip2state == LOW 1871 && dip3state == LOW 1872 && dip4state == LOW 1873 && dip5state == HIGH 1874 && dip6state == HIGH) 1875 { if (buttonState1 == LOW) { 1876 tone(0, NOTE_C6);} 1877 else if (buttonState2 == LOW) { 1878 tone(0, NOTE_CS6);} 1879 else if(buttonState3 == LOW) { 1880 tone(0, NOTE_D6);} 1881 else if(buttonState4 == LOW) { 1882 tone(0, NOTE_DS6);} 1883 else if(buttonState5 == LOW) { 1884 tone(0, NOTE_E6);} 1885 else if(buttonState6 == LOW) { 1886 tone(0, NOTE_F6);} 1887 else if(buttonState7 == LOW) { 1888 tone(0, NOTE_FS6);} 1889 else if(buttonState8 == LOW) { 1890 tone(0, NOTE_G6);} 1891 else if(buttonState9 == LOW) { 1892 tone(0, NOTE_GS6);} 1893 else if(buttonState10 == LOW) { 1894 tone(0, NOTE_A6);} 1895 else if(buttonState11 == LOW) { 1896 tone(0, NOTE_AS6);} 1897 else if(buttonState12 == LOW) { 1898 tone(0, NOTE_B6);} 1899 else if(buttonState13 == LOW) { 1900 tone(0, NOTE_C7);} 1901 else { 1902 noTone(0); } 1903 } 1904 1905 else if (dip1state == LOW // 32 in HEX; CS6 1906 && dip2state == HIGH 1907 && dip3state == LOW 1908 && dip4state == LOW 1909 && dip5state == HIGH 1910 && dip6state == HIGH) 1911 1912 { if (buttonState1 == LOW) { 1913 tone(0, NOTE_CS6);} 1914 else if (buttonState2 == LOW) { 1915 tone(0, NOTE_D6);} 1916 else if(buttonState3 == LOW) { 1917 tone(0, NOTE_DS6);} 1918 else if(buttonState4 == LOW) { 1919 tone(0, NOTE_E6);} 1920 else if(buttonState5 == LOW) { 1921 tone(0, NOTE_F6);} 1922 else if(buttonState6 == LOW) { 1923 tone(0, NOTE_FS6);} 1924 else if(buttonState7 == LOW) { 1925 tone(0, NOTE_G6);} 1926 else if(buttonState8 == LOW) { 1927 tone(0, NOTE_GS6);} 1928 else if(buttonState9 == LOW) { 1929 tone(0, NOTE_A6);} 1930 else if(buttonState10 == LOW) { 1931 tone(0, NOTE_AS6);} 1932 else if(buttonState11 == LOW) { 1933 tone(0, NOTE_B6);} 1934 else if(buttonState12 == LOW) { 1935 tone(0, NOTE_C7);} 1936 else if(buttonState13 == LOW) { 1937 tone(0, NOTE_CS7);} 1938 else { 1939 noTone(0); } 1940 } 1941 1942else if (dip1state == HIGH // 33 in HEX; D6 1943 && dip2state == HIGH 1944 && dip3state == LOW 1945 && dip4state == LOW 1946 && dip5state == HIGH 1947 && dip6state == HIGH) 1948 1949 { if (buttonState1 == LOW) { 1950 tone(0, NOTE_D6);} 1951 else if (buttonState2 == LOW) { 1952 tone(0, NOTE_DS6);} 1953 else if(buttonState3 == LOW) { 1954 tone(0, NOTE_E6);} 1955 else if(buttonState4 == LOW) { 1956 tone(0, NOTE_F6);} 1957 else if(buttonState5 == LOW) { 1958 tone(0, NOTE_FS6);} 1959 else if(buttonState6 == LOW) { 1960 tone(0, NOTE_G6);} 1961 else if(buttonState7 == LOW) { 1962 tone(0, NOTE_GS6);} 1963 else if(buttonState8 == LOW) { 1964 tone(0, NOTE_A6);} 1965 else if(buttonState9 == LOW) { 1966 tone(0, NOTE_AS6);} 1967 else if(buttonState10 == LOW) { 1968 tone(0, NOTE_B6);} 1969 else if(buttonState11 == LOW) { 1970 tone(0, NOTE_C7);} 1971 else if(buttonState12 == LOW) { 1972 tone(0, NOTE_CS7);} 1973 else if(buttonState13 == LOW) { 1974 tone(0, NOTE_D7);} 1975 else { 1976 noTone(0); } 1977 } 1978 1979else if (dip1state == LOW // 34 in HEX DS6 1980 && dip2state == LOW 1981 && dip3state == HIGH 1982 && dip4state == LOW 1983 && dip5state == HIGH 1984 && dip6state == HIGH) 1985 { if (buttonState1 == LOW) { 1986 tone(0, NOTE_DS6);} 1987 else if (buttonState2 == LOW) { 1988 tone(0, NOTE_E6);} 1989 else if(buttonState3 == LOW) { 1990 tone(0, NOTE_F6);} 1991 else if(buttonState4 == LOW) { 1992 tone(0, NOTE_FS6);} 1993 else if(buttonState5 == LOW) { 1994 tone(0, NOTE_G6);} 1995 else if(buttonState6 == LOW) { 1996 tone(0, NOTE_GS6);} 1997 else if(buttonState7 == LOW) { 1998 tone(0, NOTE_A6);} 1999 else if(buttonState8 == LOW) { 2000 tone(0, NOTE_AS6);} 2001 else if(buttonState9 == LOW) { 2002 tone(0, NOTE_B6);} 2003 else if(buttonState10 == LOW) { 2004 tone(0, NOTE_C7);} 2005 else if(buttonState11 == LOW) { 2006 tone(0, NOTE_CS7);} 2007 else if(buttonState12 == LOW) { 2008 tone(0, NOTE_D7);} 2009 else if(buttonState13 == LOW) { 2010 tone(0, NOTE_DS7);} 2011 else { 2012 noTone(0); } 2013 } 2014 2015 else if (dip1state == HIGH // 35 in HEX; E6 2016 && dip2state == LOW 2017 && dip3state == HIGH 2018 && dip4state == LOW 2019 && dip5state == HIGH 2020 && dip6state == HIGH) 2021 2022 { if (buttonState1 == LOW) { 2023 tone(0, NOTE_E6);} 2024 else if (buttonState2 == LOW) { 2025 tone(0, NOTE_F6);} 2026 else if(buttonState3 == LOW) { 2027 tone(0, NOTE_FS6);} 2028 else if(buttonState4 == LOW) { 2029 tone(0, NOTE_G6);} 2030 else if(buttonState5 == LOW) { 2031 tone(0, NOTE_GS6);} 2032 else if(buttonState6 == LOW) { 2033 tone(0, NOTE_A6);} 2034 else if(buttonState7 == LOW) { 2035 tone(0, NOTE_AS6);} 2036 else if(buttonState8 == LOW) { 2037 tone(0, NOTE_B6);} 2038 else if(buttonState9 == LOW) { 2039 tone(0, NOTE_C7);} 2040 else if(buttonState10 == LOW) { 2041 tone(0, NOTE_CS7);} 2042 else if(buttonState11 == LOW) { 2043 tone(0, NOTE_D7);} 2044 else if(buttonState12 == LOW) { 2045 tone(0, NOTE_DS7);} 2046 else if(buttonState13 == LOW) { 2047 tone(0, NOTE_E7);} 2048 else { 2049 noTone(0); } 2050 } 2051else if (dip1state == LOW // 36 in HEX; F6 2052 && dip2state == HIGH 2053 && dip3state == HIGH 2054 && dip4state == LOW 2055 && dip5state == HIGH 2056 && dip6state == HIGH) 2057 { if (buttonState1 == LOW) { 2058 tone(0, NOTE_F6);} 2059 else if (buttonState2 == LOW) { 2060 tone(0, NOTE_FS6);} 2061 else if(buttonState3 == LOW) { 2062 tone(0, NOTE_G6);} 2063 else if(buttonState4 == LOW) { 2064 tone(0, NOTE_GS6);} 2065 else if(buttonState5 == LOW) { 2066 tone(0, NOTE_A6);} 2067 else if(buttonState6 == LOW) { 2068 tone(0, NOTE_AS6);} 2069 else if(buttonState7 == LOW) { 2070 tone(0, NOTE_B6);} 2071 else if(buttonState8 == LOW) { 2072 tone(0, NOTE_C7);} 2073 else if(buttonState9 == LOW) { 2074 tone(0, NOTE_CS7);} 2075 else if(buttonState10 == LOW) { 2076 tone(0, NOTE_D7);} 2077 else if(buttonState11 == LOW) { 2078 tone(0, NOTE_DS7);} 2079 else if(buttonState12 == LOW) { 2080 tone(0, NOTE_E7);} 2081 else if(buttonState13 == LOW) { 2082 tone(0, NOTE_F7);} 2083 else { 2084 noTone(0); } 2085 } 2086 else if (dip1state == HIGH // 37 in HEX; FS6 2087 && dip2state == HIGH 2088 && dip3state == HIGH 2089 && dip4state == LOW 2090 && dip5state == HIGH 2091 && dip6state == HIGH) 2092 2093 { if (buttonState1 == LOW) { 2094 tone(0, NOTE_FS6);} 2095 else if (buttonState2 == LOW) { 2096 tone(0, NOTE_G6);} 2097 else if(buttonState3 == LOW) { 2098 tone(0, NOTE_GS6);} 2099 else if(buttonState4 == LOW) { 2100 tone(0, NOTE_A6);} 2101 else if(buttonState5 == LOW) { 2102 tone(0, NOTE_AS6);} 2103 else if(buttonState6 == LOW) { 2104 tone(0, NOTE_B6);} 2105 else if(buttonState7 == LOW) { 2106 tone(0, NOTE_C7);} 2107 else if(buttonState8 == LOW) { 2108 tone(0, NOTE_CS7);} 2109 else if(buttonState9 == LOW) { 2110 tone(0, NOTE_D7);} 2111 else if(buttonState10 == LOW) { 2112 tone(0, NOTE_DS7);} 2113 else if(buttonState11 == LOW) { 2114 tone(0, NOTE_E7);} 2115 else if(buttonState12 == LOW) { 2116 tone(0, NOTE_F7);} 2117 else if(buttonState13 == LOW) { 2118 tone(0, NOTE_FS7);} 2119 else { 2120 noTone(0); } 2121 } 2122 2123 else if (dip1state == LOW // 38 in HEX; G6 2124 && dip2state == LOW 2125 && dip3state == LOW 2126 && dip4state == HIGH 2127 && dip5state == HIGH 2128 && dip6state == HIGH) 2129 2130 { if (buttonState1 == LOW) { 2131 tone(0, NOTE_G6);} 2132 else if (buttonState2 == LOW) { 2133 tone(0, NOTE_GS6);} 2134 else if(buttonState3 == LOW) { 2135 tone(0, NOTE_A6);} 2136 else if(buttonState4 == LOW) { 2137 tone(0, NOTE_AS6);} 2138 else if(buttonState5 == LOW) { 2139 tone(0, NOTE_B6);} 2140 else if(buttonState6 == LOW) { 2141 tone(0, NOTE_C7);} 2142 else if(buttonState7 == LOW) { 2143 tone(0, NOTE_CS7);} 2144 else if(buttonState8 == LOW) { 2145 tone(0, NOTE_D7);} 2146 else if(buttonState9 == LOW) { 2147 tone(0, NOTE_DS7);} 2148 else if(buttonState10 == LOW) { 2149 tone(0, NOTE_E7);} 2150 else if(buttonState11 == LOW) { 2151 tone(0, NOTE_F7);} 2152 else if(buttonState12 == LOW) { 2153 tone(0, NOTE_FS7);} 2154 else if(buttonState13 == LOW) { 2155 tone(0, NOTE_G7);} 2156 else { 2157 noTone(0); } 2158 } 2159else if (dip1state == HIGH // 39 in HEX; GS6 2160 && dip2state == LOW 2161 && dip3state == LOW 2162 && dip4state == HIGH 2163 && dip5state == HIGH 2164 && dip6state == HIGH) 2165 { if (buttonState1 == LOW) { 2166 tone(0, NOTE_GS6);} 2167 else if (buttonState2 == LOW) { 2168 tone(0, NOTE_A6);} 2169 else if(buttonState3 == LOW) { 2170 tone(0, NOTE_AS6);} 2171 else if(buttonState4 == LOW) { 2172 tone(0, NOTE_B6);} 2173 else if(buttonState5 == LOW) { 2174 tone(0, NOTE_C7);} 2175 else if(buttonState6 == LOW) { 2176 tone(0, NOTE_CS7);} 2177 else if(buttonState7 == LOW) { 2178 tone(0, NOTE_D7);} 2179 else if(buttonState8 == LOW) { 2180 tone(0, NOTE_DS7);} 2181 else if(buttonState9 == LOW) { 2182 tone(0, NOTE_E7);} 2183 else if(buttonState10 == LOW) { 2184 tone(0, NOTE_F7);} 2185 else if(buttonState11 == LOW) { 2186 tone(0, NOTE_FS7);} 2187 else if(buttonState12 == LOW) { 2188 tone(0, NOTE_G7);} 2189 else if(buttonState13 == LOW) { 2190 tone(0, NOTE_GS7);} 2191 else { 2192 noTone(0); } 2193 } 2194 else if (dip1state == LOW // 3A in HEX; A6 2195 && dip2state == HIGH 2196 && dip3state == LOW 2197 && dip4state == HIGH 2198 && dip5state == HIGH 2199 && dip6state == HIGH) 2200 2201 { if (buttonState1 == LOW) { 2202 tone(0, NOTE_A6);} 2203 else if (buttonState2 == LOW) { 2204 tone(0, NOTE_AS6);} 2205 else if(buttonState3 == LOW) { 2206 tone(0, NOTE_B6);} 2207 else if(buttonState4 == LOW) { 2208 tone(0, NOTE_C7);} 2209 else if(buttonState5 == LOW) { 2210 tone(0, NOTE_CS7);} 2211 else if(buttonState6 == LOW) { 2212 tone(0, NOTE_D7);} 2213 else if(buttonState7 == LOW) { 2214 tone(0, NOTE_DS7);} 2215 else if(buttonState8 == LOW) { 2216 tone(0, NOTE_E7);} 2217 else if(buttonState9 == LOW) { 2218 tone(0, NOTE_F7);} 2219 else if(buttonState10 == LOW) { 2220 tone(0, NOTE_FS7);} 2221 else if(buttonState11 == LOW) { 2222 tone(0, NOTE_G7);} 2223 else if(buttonState12 == LOW) { 2224 tone(0, NOTE_GS7);} 2225 else if(buttonState13 == LOW) { 2226 tone(0, NOTE_A7);} 2227 else { 2228 noTone(0); } 2229 } 2230 else if (dip1state == HIGH // 3B in HEX; AS6 2231 && dip2state == HIGH 2232 && dip3state == LOW 2233 && dip4state == HIGH 2234 && dip5state == HIGH 2235 && dip6state == HIGH) 2236 { if (buttonState1 == LOW) { 2237 tone(0, NOTE_AS6);} 2238 else if (buttonState2 == LOW) { 2239 tone(0, NOTE_B6);} 2240 else if(buttonState3 == LOW) { 2241 tone(0, NOTE_C7);} 2242 else if(buttonState4 == LOW) { 2243 tone(0, NOTE_CS7);} 2244 else if(buttonState5 == LOW) { 2245 tone(0, NOTE_D7);} 2246 else if(buttonState6 == LOW) { 2247 tone(0, NOTE_DS7);} 2248 else if(buttonState7 == LOW) { 2249 tone(0, NOTE_E7);} 2250 else if(buttonState8 == LOW) { 2251 tone(0, NOTE_F7);} 2252 else if(buttonState9 == LOW) { 2253 tone(0, NOTE_FS7);} 2254 else if(buttonState10 == LOW) { 2255 tone(0, NOTE_G7);} 2256 else if(buttonState11 == LOW) { 2257 tone(0, NOTE_GS7);} 2258 else if(buttonState12 == LOW) { 2259 tone(0, NOTE_A7);} 2260 else if(buttonState13 == LOW) { 2261 tone(0, NOTE_AS7);} 2262 else { 2263 noTone(0); } 2264 } 2265 else if (dip1state == LOW // 3C in HEX; B6 2266 && dip2state == LOW 2267 && dip3state == HIGH 2268 && dip4state == HIGH 2269 && dip5state == HIGH 2270 && dip6state == HIGH) 2271 { if (buttonState1 == LOW) { 2272 tone(0, NOTE_B6);} 2273 else if (buttonState2 == LOW) { 2274 tone(0, NOTE_C7);} 2275 else if(buttonState3 == LOW) { 2276 tone(0, NOTE_CS7);} 2277 else if(buttonState4 == LOW) { 2278 tone(0, NOTE_D7);} 2279 else if(buttonState5 == LOW) { 2280 tone(0, NOTE_DS7);} 2281 else if(buttonState6 == LOW) { 2282 tone(0, NOTE_E7);} 2283 else if(buttonState7 == LOW) { 2284 tone(0, NOTE_F7);} 2285 else if(buttonState8 == LOW) { 2286 tone(0, NOTE_FS7);} 2287 else if(buttonState9 == LOW) { 2288 tone(0, NOTE_G7);} 2289 else if(buttonState10 == LOW) { 2290 tone(0, NOTE_GS7);} 2291 else if(buttonState11 == LOW) { 2292 tone(0, NOTE_A7);} 2293 else if(buttonState12 == LOW) { 2294 tone(0, NOTE_AS7);} 2295 else if(buttonState13 == LOW) { 2296 tone(0, NOTE_B7);} 2297 else { 2298 noTone(0); } 2299 } 2300 2301 2302 2303 2304 2305 2306else { 2307//turn off sound 2308noTone(0); 2309} 2310} 2311
Pushbutton Program
c_cpp
1 2#include "pitches.h" 3const int buttonPin1 = 13; //C 4 const int buttonPin2 = 12; //CS 5 const int buttonPin3 = 11; //D 6 const int buttonPin4 = 10; // DS 7 const int buttonPin5 = 9; // E 8 const int buttonPin6 = 8; //F 9 const int buttonPin7 = 7; //FS 10 const int buttonPin8 = 6; //G 11 const int buttonPin9 = 5; //GS 12 const int buttonPin10 = 4; //A 13 const int buttonPin11 = 3; //AS 14 const int buttonPin12 = 2; //B 15 const int buttonPin13 = 1; //C 16const int dip1 = A0; // LSB, 1 17 const int dip2 = A1;// 2 18 const int dip3 = A2;// 3 19 const int dip4 = A3;// 4 20 const int dip5 = A4;// 5 21 const int dip6 = A5; //MSB, 6 22int dip1state = 0; 23 int dip2state = 0; 24 int dip3state = 0; 25 int dip4state = 0; 26 int dip5state = 0; 27 int dip6state = 0; 28int buttonState1 = 0; 29 int buttonState2 = 0; 30 int buttonState3 = 0; 31 int buttonState4 = 0; 32 int buttonState5 = 0; 33 int buttonState6 = 0; 34 int buttonState7 = 0; 35 int buttonState8 = 0; 36 int buttonState9 = 0; 37 int buttonState10 = 0; 38 int buttonState11 = 0; 39 int buttonState12 = 0; 40 int buttonState13 = 0; 41 42 43void setup() { 44 45pinMode(buttonPin1, INPUT); 46 pinMode(buttonPin2, INPUT); 47 pinMode(buttonPin3, INPUT); 48 pinMode(buttonPin4, INPUT); 49 pinMode(buttonPin5, INPUT); 50 pinMode(buttonPin6, INPUT); 51 pinMode(buttonPin7, INPUT); 52 pinMode(buttonPin8, INPUT); 53 pinMode(buttonPin9, INPUT); 54 pinMode(buttonPin10, INPUT); 55 pinMode(buttonPin11, INPUT); 56 pinMode(buttonPin12, INPUT); 57 pinMode(buttonPin13, INPUT); 58pinMode(dip1, INPUT); 59 pinMode(dip2, INPUT); 60 pinMode(dip3, INPUT); 61 pinMode(dip4, INPUT); 62 pinMode(dip5, INPUT); 63 pinMode(dip6, INPUT); 64} 65 66void loop(){ 67// read the state of the pushbutton value: 68buttonState1 = digitalRead(buttonPin1); 69buttonState2 = digitalRead(buttonPin2); 70buttonState3 = digitalRead(buttonPin3); 71buttonState4 = digitalRead(buttonPin4); 72buttonState5 = digitalRead(buttonPin5); 73buttonState6 = digitalRead(buttonPin6); 74buttonState7 = digitalRead(buttonPin7); 75buttonState8 = digitalRead(buttonPin8); 76buttonState9 = digitalRead(buttonPin9); 77buttonState10 = digitalRead(buttonPin10); 78buttonState11 = digitalRead(buttonPin11); 79buttonState12 = digitalRead(buttonPin12); 80buttonState13 = digitalRead(buttonPin13); 81dip1state = digitalRead(dip1); 82dip2state = digitalRead(dip2); 83dip3state = digitalRead(dip3); 84dip4state = digitalRead(dip4); 85dip5state = digitalRead(dip5); 86dip6state = digitalRead(dip6); 87 88 89if (dip1state == LOW //00 or 19 in HEX; C4 90 && dip2state == LOW 91 && dip3state == LOW 92 && dip4state == LOW 93 && dip5state == LOW 94 && dip6state == LOW 95 || dip1state == HIGH 96 && dip2state == LOW 97 && dip3state == LOW 98 && dip4state == HIGH 99 && dip5state == HIGH 100 && dip6state == LOW ) 101 { if (buttonState1 == LOW) { 102 tone(0, NOTE_C4);} 103 else if (buttonState2 == LOW) { 104 tone(0, NOTE_CS4);} 105 else if(buttonState3 == LOW) { 106 tone(0, NOTE_D4);} 107 else if(buttonState4 == LOW) { 108 tone(0, NOTE_DS4);} 109 else if(buttonState5 == LOW) { 110 tone(0, NOTE_E4);} 111 else if(buttonState6 == LOW) { 112 tone(0, NOTE_F4);} 113 else if(buttonState7 == LOW) { 114 tone(0, NOTE_FS4);} 115 else if(buttonState8 == LOW) { 116 tone(0, NOTE_G4);} 117 else if(buttonState9 == LOW) { 118 tone(0, NOTE_GS4);} 119 else if(buttonState10 == LOW) { 120 tone(0, NOTE_A4);} 121 else if(buttonState11 == LOW) { 122 tone(0, NOTE_AS4);} 123 else if(buttonState12 == LOW) { 124 tone(0, NOTE_B4);} 125 else if(buttonState13 == LOW) { 126 tone(0, NOTE_C5);} 127 else { 128 noTone(0); } 129 } 130 131 else if (dip1state == HIGH //01 in HEX; C2 132 && dip2state == LOW 133 && dip3state == LOW 134 && dip4state == LOW 135 && dip5state == LOW 136 && dip6state == LOW) 137 138{ if (buttonState1 == LOW) { 139 tone(0, NOTE_C2);} 140 else if (buttonState2 == LOW) { 141 tone(0, NOTE_CS2);} 142 else if(buttonState3 == LOW) { 143 tone(0, NOTE_D2);} 144 else if(buttonState4 == LOW) { 145 tone(0, NOTE_DS2);} 146 else if(buttonState5 == LOW) { 147 tone(0, NOTE_E2);} 148 else if(buttonState6 == LOW) { 149 tone(0, NOTE_F2);} 150 else if(buttonState7 == LOW) { 151 tone(0, NOTE_FS2);} 152 else if(buttonState8 == LOW) { 153 tone(0, NOTE_G2);} 154 else if(buttonState9 == LOW) { 155 tone(0, NOTE_GS2);} 156 else if(buttonState10 == LOW) { 157 tone(0, NOTE_A2);} 158 else if(buttonState11 == LOW) { 159 tone(0, NOTE_AS2);} 160 else if(buttonState12 == LOW) { 161 tone(0, NOTE_B2);} 162 else if(buttonState13 == LOW) { 163 tone(0, NOTE_C3);} 164 else { 165 noTone(0); } 166 } 167 else if (dip1state == LOW //02 in HEX; CS2 168 && dip2state == HIGH 169 && dip3state == LOW 170 && dip4state == LOW 171 && dip5state == LOW 172 && dip6state == LOW) 173 174 {if (buttonState1 == LOW) { 175 tone(0, NOTE_CS2);} 176 else if (buttonState2 == LOW) { 177 tone(0, NOTE_D2);} 178 else if(buttonState3 == LOW) { 179 tone(0, NOTE_DS2);} 180 else if(buttonState4 == LOW) { 181 tone(0, NOTE_E2);} 182 else if(buttonState5 == LOW) { 183 tone(0, NOTE_F2);} 184 else if(buttonState6 == LOW) { 185 tone(0, NOTE_FS2);} 186 else if(buttonState7 == LOW) { 187 tone(0, NOTE_G2);} 188 else if(buttonState8 == LOW) { 189 tone(0, NOTE_GS2);} 190 else if(buttonState9 == LOW) { 191 tone(0, NOTE_A2);} 192 else if(buttonState10 == LOW) { 193 tone(0, NOTE_AS2);} 194 else if(buttonState11 == LOW) { 195 tone(0, NOTE_B2);} 196 else if(buttonState12 == LOW) { 197 tone(0, NOTE_C3);} 198 else if(buttonState13 == LOW) { 199 tone(0, NOTE_CS3);} 200 else { 201 noTone(0); } 202 } 203 else if (dip1state == HIGH // 03 in HEX; D2 204 && dip2state == HIGH 205 && dip3state == LOW 206 && dip4state == LOW 207 && dip5state == LOW 208 && dip6state == LOW) 209 210{if (buttonState1 == LOW) { 211tone(0, NOTE_D2);} 212 else if (buttonState2 == LOW) { 213 tone(0, NOTE_DS2);} 214 else if(buttonState3 == LOW) { 215 tone(0, NOTE_E2);} 216 else if(buttonState4 == LOW) { 217 tone(0, NOTE_F2);} 218 else if(buttonState5 == LOW) { 219 tone(0, NOTE_FS2);} 220 else if(buttonState6 == LOW) { 221 tone(0, NOTE_G2);} 222 else if(buttonState7 == LOW) { 223 tone(0, NOTE_GS2);} 224 else if(buttonState8 == LOW) { 225 tone(0, NOTE_A2);} 226 else if(buttonState9 == LOW) { 227 tone(0, NOTE_AS2);} 228 else if(buttonState10 == LOW) { 229 tone(0, NOTE_B2);} 230 else if(buttonState11 == LOW) { 231 tone(0, NOTE_C3);} 232 else if(buttonState12 == LOW) { 233 tone(0, NOTE_CS3);} 234 else if(buttonState13 == LOW) { 235 tone(0, NOTE_D3);} 236 else { 237 noTone(0); } 238 } 239 240 241 else if (dip1state == LOW // 04 in HEX DS2 242 && dip2state == LOW 243 && dip3state == HIGH 244 && dip4state == LOW 245 && dip5state == LOW 246 && dip6state == LOW) 247 248 249 {if (buttonState1 == LOW) { 250 tone(0, NOTE_DS2);} 251 else if (buttonState2 == LOW) { 252 tone(0, NOTE_E2);} 253 else if(buttonState3 == LOW) { 254 tone(0, NOTE_F2);} 255 else if(buttonState4 == LOW) { 256 tone(0, NOTE_FS2);} 257 else if(buttonState5 == LOW) { 258 tone(0, NOTE_G2);} 259 else if(buttonState6 == LOW) { 260 tone(0, NOTE_GS2);} 261 else if(buttonState7 == LOW) { 262 tone(0, NOTE_A2);} 263 else if(buttonState8 == LOW) { 264 tone(0, NOTE_AS2);} 265 else if(buttonState9 == LOW) { 266 tone(0, NOTE_B2);} 267 else if(buttonState10 == LOW) { 268 tone(0, NOTE_C3);} 269 else if(buttonState11 == LOW) { 270 tone(0, NOTE_CS3);} 271 else if(buttonState12 == LOW) { 272 tone(0, NOTE_D3);} 273 else if(buttonState13 == LOW) { 274 tone(0, NOTE_DS3);} 275 else { 276 noTone(0); } 277 } 278 279 280 281 282else if (dip1state == HIGH // 05 in HEX; E2 283 && dip2state == LOW 284 && dip3state == HIGH 285 && dip4state == LOW 286 && dip5state == LOW 287 && dip6state == LOW) 288 289{if (buttonState1 == LOW) { 290 tone(0, NOTE_E2);} 291 else if (buttonState2 == LOW) { 292 tone(0, NOTE_F2);} 293 else if(buttonState3 == LOW) { 294 tone(0, NOTE_FS2);} 295 else if(buttonState4 == LOW) { 296 tone(0, NOTE_G2);} 297 else if(buttonState5 == LOW) { 298 tone(0, NOTE_GS2);} 299 else if(buttonState6 == LOW) { 300 tone(0, NOTE_A2);} 301 else if(buttonState7 == LOW) { 302 tone(0, NOTE_AS2);} 303 else if(buttonState8 == LOW) { 304 tone(0, NOTE_B2);} 305 else if(buttonState9 == LOW) { 306 tone(0, NOTE_C3);} 307 else if(buttonState10 == LOW) { 308 tone(0, NOTE_CS3);} 309 else if(buttonState11 == LOW) { 310 tone(0, NOTE_D3);} 311 else if(buttonState12 == LOW) { 312 tone(0, NOTE_DS3);} 313 else if(buttonState13 == LOW) { 314 tone(0, NOTE_E3);} 315 else { 316 noTone(0); } 317 } 318 319 320 321 else if (dip1state == LOW // 06 in HEX; F2 322 && dip2state == HIGH 323 && dip3state == HIGH 324 && dip4state == LOW 325 && dip5state == LOW 326 && dip6state == LOW) 327 328{if (buttonState1 == LOW) { 329 tone(0, NOTE_F2);} 330 else if (buttonState2 == LOW) { 331 tone(0, NOTE_FS2);} 332 else if(buttonState3 == LOW) { 333 tone(0, NOTE_G2);} 334 else if(buttonState4 == LOW) { 335 tone(0, NOTE_GS2);} 336 else if(buttonState5 == LOW) { 337 tone(0, NOTE_A2);} 338 else if(buttonState6 == LOW) { 339 tone(0, NOTE_AS2);} 340 else if(buttonState7 == LOW) { 341 tone(0, NOTE_B2);} 342 else if(buttonState8 == LOW) { 343 tone(0, NOTE_C3);} 344 else if(buttonState9 == LOW) { 345 tone(0, NOTE_CS3);} 346 else if(buttonState10 == LOW) { 347 tone(0, NOTE_D3);} 348 else if(buttonState11 == LOW) { 349 tone(0, NOTE_DS3);} 350 else if(buttonState12 == LOW) { 351 tone(0, NOTE_E3);} 352 else if(buttonState13 == LOW) { 353 tone(0, NOTE_F3);} 354 else { 355 noTone(0); } 356 } 357 358 359else if (dip1state == HIGH // 07 in HEX; FS2 360 && dip2state == HIGH 361 && dip3state == HIGH 362 && dip4state == LOW 363 && dip5state == LOW 364 && dip6state == LOW) 365{if (buttonState1 == LOW) { 366 tone(0, NOTE_FS2);} 367 else if (buttonState2 == LOW) { 368 tone(0, NOTE_G2);} 369 else if(buttonState3 == LOW) { 370 tone(0, NOTE_GS2);} 371 else if(buttonState4 == LOW) { 372 tone(0, NOTE_A2);} 373 else if(buttonState5 == LOW) { 374 tone(0, NOTE_AS2);} 375 else if(buttonState6 == LOW) { 376 tone(0, NOTE_B2);} 377 else if(buttonState7 == LOW) { 378 tone(0, NOTE_C3);} 379 else if(buttonState8 == LOW) { 380 tone(0, NOTE_CS3);} 381 else if(buttonState9 == LOW) { 382 tone(0, NOTE_D3);} 383 else if(buttonState10 == LOW) { 384 tone(0, NOTE_DS3);} 385 else if(buttonState11 == LOW) { 386 tone(0, NOTE_E3);} 387 else if(buttonState12 == LOW) { 388 tone(0, NOTE_F3);} 389 else if(buttonState13 == LOW) { 390 tone(0, NOTE_FS3);} 391 else { 392 noTone(0); } 393 } 394 395 else if (dip1state == LOW // 08 in HEX; G2 396 && dip2state == LOW 397 && dip3state == LOW 398 && dip4state == HIGH 399 && dip5state == LOW 400 && dip6state == LOW) 401{if (buttonState1 == LOW) { 402 tone(0, NOTE_G2);} 403 else if (buttonState2 == LOW) { 404 tone(0, NOTE_GS2);} 405 else if(buttonState3 == LOW) { 406 tone(0, NOTE_A2);} 407 else if(buttonState4 == LOW) { 408 tone(0, NOTE_AS2);} 409 else if(buttonState5 == LOW) { 410 tone(0, NOTE_B2);} 411 else if(buttonState6 == LOW) { 412 tone(0, NOTE_C3);} 413 else if(buttonState7 == LOW) { 414 tone(0, NOTE_CS3);} 415 else if(buttonState8 == LOW) { 416 tone(0, NOTE_D3);} 417 else if(buttonState9 == LOW) { 418 tone(0, NOTE_DS3);} 419 else if(buttonState10 == LOW) { 420 tone(0, NOTE_E3);} 421 else if(buttonState11 == LOW) { 422 tone(0, NOTE_F3);} 423 else if(buttonState12 == LOW) { 424 tone(0, NOTE_FS3);} 425 else if(buttonState13 == LOW) { 426 tone(0, NOTE_G3);} 427 else { 428 noTone(0); } 429 } 430 431 432 else if (dip1state == HIGH // 09 in HEX; GS2 433 && dip2state == LOW 434 && dip3state == LOW 435 && dip4state == HIGH 436 && dip5state == LOW 437 && dip6state == LOW) 438 {if (buttonState1 == LOW) { 439 tone(0, NOTE_GS2);} 440 else if (buttonState2 == LOW) { 441 tone(0, NOTE_A2);} 442 else if(buttonState3 == LOW) { 443 tone(0, NOTE_AS2);} 444 else if(buttonState4 == LOW) { 445 tone(0, NOTE_B2);} 446 else if(buttonState5 == LOW) { 447 tone(0, NOTE_C3);} 448 else if(buttonState6 == LOW) { 449 tone(0, NOTE_CS3);} 450 else if(buttonState7 == LOW) { 451 tone(0, NOTE_D3);} 452 else if(buttonState8 == LOW) { 453 tone(0, NOTE_DS3);} 454 else if(buttonState9 == LOW) { 455 tone(0, NOTE_E3);} 456 else if(buttonState10 == LOW) { 457 tone(0, NOTE_F3);} 458 else if(buttonState11 == LOW) { 459 tone(0, NOTE_FS3);} 460 else if(buttonState12 == LOW) { 461 tone(0, NOTE_G3);} 462 else if(buttonState13 == LOW) { 463 tone(0, NOTE_GS3);} 464 else { 465 noTone(0); } 466 } 467 468else if (dip1state == LOW // 0A in HEX; A2 469 && dip2state == HIGH 470 && dip3state == LOW 471 && dip4state == HIGH 472 && dip5state == LOW 473 && dip6state == LOW) 474 {if (buttonState1 == LOW) { 475 tone(0, NOTE_A2);} 476 else if (buttonState2 == LOW) { 477 tone(0, NOTE_AS2);} 478 else if(buttonState3 == LOW) { 479 tone(0, NOTE_B2);} 480 else if(buttonState4 == LOW) { 481 tone(0, NOTE_C3);} 482 else if(buttonState5 == LOW) { 483 tone(0, NOTE_CS3);} 484 else if(buttonState6 == LOW) { 485 tone(0, NOTE_D3);} 486 else if(buttonState7 == LOW) { 487 tone(0, NOTE_DS3);} 488 else if(buttonState8 == LOW) { 489 tone(0, NOTE_E3);} 490 else if(buttonState9 == LOW) { 491 tone(0, NOTE_F3);} 492 else if(buttonState10 == LOW) { 493 tone(0, NOTE_FS3);} 494 else if(buttonState11 == LOW) { 495 tone(0, NOTE_G3);} 496 else if(buttonState12 == LOW) { 497 tone(0, NOTE_GS3);} 498 else if(buttonState13 == LOW) { 499 tone(0, NOTE_A3);} 500 else { 501 noTone(0); } 502 } 503 504else if (dip1state == HIGH // 0B in HEX; AS2 505 && dip2state == HIGH 506 && dip3state == LOW 507 && dip4state == HIGH 508 && dip5state == LOW 509 && dip6state == LOW) 510 {if (buttonState1 == LOW) { 511 tone(0, NOTE_AS2);} 512 else if (buttonState2 == LOW) { 513 tone(0, NOTE_B2);} 514 else if(buttonState3 == LOW) { 515 tone(0, NOTE_C3);} 516 else if(buttonState4 == LOW) { 517 tone(0, NOTE_CS3);} 518 else if(buttonState5 == LOW) { 519 tone(0, NOTE_D3);} 520 else if(buttonState6 == LOW) { 521 tone(0, NOTE_DS3);} 522 else if(buttonState7 == LOW) { 523 tone(0, NOTE_E3);} 524 else if(buttonState8 == LOW) { 525 tone(0, NOTE_F3);} 526 else if(buttonState9 == LOW) { 527 tone(0, NOTE_FS3);} 528 else if(buttonState10 == LOW) { 529 tone(0, NOTE_G3);} 530 else if(buttonState11 == LOW) { 531 tone(0, NOTE_GS3);} 532 else if(buttonState12 == LOW) { 533 tone(0, NOTE_A3);} 534 else if(buttonState13 == LOW) { 535 tone(0, NOTE_AS3);} 536 else { 537 noTone(0); } 538 } 539 540 else if (dip1state == LOW // 0C in HEX; B2 541 && dip2state == LOW 542 && dip3state == HIGH 543 && dip4state == HIGH 544 && dip5state == LOW 545 && dip6state == LOW) 546 {if (buttonState1 == LOW) { 547 tone(0, NOTE_B2);} 548 else if (buttonState2 == LOW) { 549 tone(0, NOTE_C3);} 550 else if(buttonState3 == LOW) { 551 tone(0, NOTE_CS3);} 552 else if(buttonState4 == LOW) { 553 tone(0, NOTE_D3);} 554 else if(buttonState5 == LOW) { 555 tone(0, NOTE_DS3);} 556 else if(buttonState6 == LOW) { 557 tone(0, NOTE_E3);} 558 else if(buttonState7 == LOW) { 559 tone(0, NOTE_F3);} 560 else if(buttonState8 == LOW) { 561 tone(0, NOTE_FS3);} 562 else if(buttonState9 == LOW) { 563 tone(0, NOTE_G3);} 564 else if(buttonState10 == LOW) { 565 tone(0, NOTE_GS3);} 566 else if(buttonState11 == LOW) { 567 tone(0, NOTE_A3);} 568 else if(buttonState12 == LOW) { 569 tone(0, NOTE_AS3);} 570 else if(buttonState13 == LOW) { 571 tone(0, NOTE_B3);} 572 else { 573 noTone(0); } 574 } 575 576 else if (dip1state == HIGH //0D in HEX; C3 577 && dip2state == LOW 578 && dip3state == HIGH 579 && dip4state == HIGH 580 && dip5state == LOW 581 && dip6state == LOW) 582 583 {if (buttonState1 == LOW) { 584 tone(0, NOTE_C3);} 585 else if (buttonState2 == LOW) { 586 tone(0, NOTE_CS3);} 587 else if(buttonState3 == LOW) { 588 tone(0, NOTE_D3);} 589 else if(buttonState4 == LOW) { 590 tone(0, NOTE_DS3);} 591 else if(buttonState5 == LOW) { 592 tone(0, NOTE_E3);} 593 else if(buttonState6 == LOW) { 594 tone(0, NOTE_F3);} 595 else if(buttonState7 == LOW) { 596 tone(0, NOTE_FS3);} 597 else if(buttonState8 == LOW) { 598 tone(0, NOTE_G3);} 599 else if(buttonState9 == LOW) { 600 tone(0, NOTE_GS3);} 601 else if(buttonState10 == LOW) { 602 tone(0, NOTE_A3);} 603 else if(buttonState11 == LOW) { 604 tone(0, NOTE_AS3);} 605 else if(buttonState12 == LOW) { 606 tone(0, NOTE_B3);} 607 else if(buttonState13 == LOW) { 608 tone(0, NOTE_C4);} 609 else { 610 noTone(0); } 611 } 612 613 else if (dip1state == LOW // 0E in HEX; CS3 614 && dip2state == HIGH 615 && dip3state == HIGH 616 && dip4state == HIGH 617 && dip5state == LOW 618 && dip6state == LOW) 619 620 {if (buttonState1 == LOW) { 621 tone(0, NOTE_CS3);} 622 else if (buttonState2 == LOW) { 623 tone(0, NOTE_D3);} 624 else if(buttonState3 == LOW) { 625 tone(0, NOTE_DS3);} 626 else if(buttonState4 == LOW) { 627 tone(0, NOTE_E3);} 628 else if(buttonState5 == LOW) { 629 tone(0, NOTE_F3);} 630 else if(buttonState6 == LOW) { 631 tone(0, NOTE_FS3);} 632 else if(buttonState7 == LOW) { 633 tone(0, NOTE_G3);} 634 else if(buttonState8 == LOW) { 635 tone(0, NOTE_GS3);} 636 else if(buttonState9 == LOW) { 637 tone(0, NOTE_A3);} 638 else if(buttonState10 == LOW) { 639 tone(0, NOTE_AS3);} 640 else if(buttonState11 == LOW) { 641 tone(0, NOTE_B3);} 642 else if(buttonState12 == LOW) { 643 tone(0, NOTE_C4);} 644 else if(buttonState13 == LOW) { 645 tone(0, NOTE_CS4);} 646 else { 647 noTone(0); } 648 } 649else if (dip1state == HIGH // 0F in HEX; D3 650 && dip2state == HIGH 651 && dip3state == HIGH 652 && dip4state == HIGH 653 && dip5state == LOW 654 && dip6state == LOW) 655{if (buttonState1 == LOW) { 656 tone(0, NOTE_D3);} 657 else if (buttonState2 == LOW) { 658 tone(0, NOTE_DS3);} 659 else if(buttonState3 == LOW) { 660 tone(0, NOTE_E3);} 661 else if(buttonState4 == LOW) { 662 tone(0, NOTE_F3);} 663 else if(buttonState5 == LOW) { 664 tone(0, NOTE_FS3);} 665 else if(buttonState6 == LOW) { 666 tone(0, NOTE_G3);} 667 else if(buttonState7 == LOW) { 668 tone(0, NOTE_GS3);} 669 else if(buttonState8 == LOW) { 670 tone(0, NOTE_A3);} 671 else if(buttonState9 == LOW) { 672 tone(0, NOTE_AS3);} 673 else if(buttonState10 == LOW) { 674 tone(0, NOTE_B3);} 675 else if(buttonState11 == LOW) { 676 tone(0, NOTE_C4);} 677 else if(buttonState12 == LOW) { 678 tone(0, NOTE_CS4);} 679 else if(buttonState13 == LOW) { 680 tone(0, NOTE_D4);} 681 else { 682 noTone(0); } 683 } 684 685else if (dip1state == LOW // 10 in HEX DS3 686 && dip2state == LOW 687 && dip3state == LOW 688 && dip4state == LOW 689 && dip5state == HIGH 690 && dip6state == LOW) 691 { if (buttonState1 == LOW) { 692 tone(0, NOTE_DS3);} 693 else if (buttonState2 == LOW) { 694 tone(0, NOTE_E3);} 695 else if(buttonState3 == LOW) { 696 tone(0, NOTE_F3);} 697 else if(buttonState4 == LOW) { 698 tone(0, NOTE_FS3);} 699 else if(buttonState5 == LOW) { 700 tone(0, NOTE_G3);} 701 else if(buttonState6 == LOW) { 702 tone(0, NOTE_GS3);} 703 else if(buttonState7 == LOW) { 704 tone(0, NOTE_A3);} 705 else if(buttonState8 == LOW) { 706 tone(0, NOTE_AS3);} 707 else if(buttonState9 == LOW) { 708 tone(0, NOTE_B3);} 709 else if(buttonState10 == LOW) { 710 tone(0, NOTE_C4);} 711 else if(buttonState11 == LOW) { 712 tone(0, NOTE_CS4);} 713 else if(buttonState12 == LOW) { 714 tone(0, NOTE_D4);} 715 else if(buttonState13 == LOW) { 716 tone(0, NOTE_DS4);} 717 else { 718 noTone(0); } 719 } 720 721 else if (dip1state == HIGH // 11 in HEX; E3 722 && dip2state == LOW 723 && dip3state == LOW 724 && dip4state == LOW 725 && dip5state == HIGH 726 && dip6state == LOW) 727 { if (buttonState1 == LOW) { 728 tone(0, NOTE_E3);} 729 else if (buttonState2 == LOW) { 730 tone(0, NOTE_F3);} 731 else if(buttonState3 == LOW) { 732 tone(0, NOTE_FS3);} 733 else if(buttonState4 == LOW) { 734 tone(0, NOTE_G3);} 735 else if(buttonState5 == LOW) { 736 tone(0, NOTE_GS3);} 737 else if(buttonState6 == LOW) { 738 tone(0, NOTE_A3);} 739 else if(buttonState7 == LOW) { 740 tone(0, NOTE_AS3);} 741 else if(buttonState8 == LOW) { 742 tone(0, NOTE_B3);} 743 else if(buttonState9 == LOW) { 744 tone(0, NOTE_C4);} 745 else if(buttonState10 == LOW) { 746 tone(0, NOTE_CS4);} 747 else if(buttonState11 == LOW) { 748 tone(0, NOTE_D4);} 749 else if(buttonState12 == LOW) { 750 tone(0, NOTE_DS4);} 751 else if(buttonState13 == LOW) { 752 tone(0, NOTE_E4);} 753 else { 754 noTone(0); } 755 } 756 757 758else if (dip1state == LOW // 12 in HEX; F3 759 && dip2state == HIGH 760 && dip3state == LOW 761 && dip4state == LOW 762 && dip5state == HIGH 763 && dip6state == LOW) 764 765{ if (buttonState1 == LOW) { 766 tone(0, NOTE_F3);} 767 else if (buttonState2 == LOW) { 768 tone(0, NOTE_FS3);} 769 else if(buttonState3 == LOW) { 770 tone(0, NOTE_G3);} 771 else if(buttonState4 == LOW) { 772 tone(0, NOTE_GS3);} 773 else if(buttonState5 == LOW) { 774 tone(0, NOTE_A3);} 775 else if(buttonState6 == LOW) { 776 tone(0, NOTE_AS3);} 777 else if(buttonState7 == LOW) { 778 tone(0, NOTE_B3);} 779 else if(buttonState8 == LOW) { 780 tone(0, NOTE_C4);} 781 else if(buttonState9 == LOW) { 782 tone(0, NOTE_CS4);} 783 else if(buttonState10 == LOW) { 784 tone(0, NOTE_D4);} 785 else if(buttonState11 == LOW) { 786 tone(0, NOTE_DS4);} 787 else if(buttonState12 == LOW) { 788 tone(0, NOTE_E4);} 789 else if(buttonState13 == LOW) { 790 tone(0, NOTE_F4);} 791 else { 792 noTone(0); } 793 } 794 795 else if (dip1state == HIGH // 13 in HEX; FS3 796 && dip2state == HIGH 797 && dip3state == LOW 798 && dip4state == LOW 799 && dip5state == HIGH 800 && dip6state == LOW) 801{ if (buttonState1 == LOW) { 802 tone(0, NOTE_FS3);} 803 else if (buttonState2 == LOW) { 804 tone(0, NOTE_G3);} 805 else if(buttonState3 == LOW) { 806 tone(0, NOTE_GS3);} 807 else if(buttonState4 == LOW) { 808 tone(0, NOTE_A3);} 809 else if(buttonState5 == LOW) { 810 tone(0, NOTE_AS3);} 811 else if(buttonState6 == LOW) { 812 tone(0, NOTE_B3);} 813 else if(buttonState7 == LOW) { 814 tone(0, NOTE_C4);} 815 else if(buttonState8 == LOW) { 816 tone(0, NOTE_CS4);} 817 else if(buttonState9 == LOW) { 818 tone(0, NOTE_D4);} 819 else if(buttonState10 == LOW) { 820 tone(0, NOTE_DS4);} 821 else if(buttonState11 == LOW) { 822 tone(0, NOTE_E4);} 823 else if(buttonState12 == LOW) { 824 tone(0, NOTE_F4);} 825 else if(buttonState13 == LOW) { 826 tone(0, NOTE_FS4);} 827 else { 828 noTone(0); } 829 } 830 831 else if (dip1state == LOW // 14 in HEX; G3 832 && dip2state == LOW 833 && dip3state == HIGH 834 && dip4state == LOW 835 && dip5state == HIGH 836 && dip6state == LOW) 837{ if (buttonState1 == LOW) { 838 tone(0, NOTE_G3);} 839 else if (buttonState2 == LOW) { 840 tone(0, NOTE_GS3);} 841 else if(buttonState3 == LOW) { 842 tone(0, NOTE_A3);} 843 else if(buttonState4 == LOW) { 844 tone(0, NOTE_AS3);} 845 else if(buttonState5 == LOW) { 846 tone(0, NOTE_B3);} 847 else if(buttonState6 == LOW) { 848 tone(0, NOTE_C4);} 849 else if(buttonState7 == LOW) { 850 tone(0, NOTE_CS4);} 851 else if(buttonState8 == LOW) { 852 tone(0, NOTE_D4);} 853 else if(buttonState9 == LOW) { 854 tone(0, NOTE_DS4);} 855 else if(buttonState10 == LOW) { 856 tone(0, NOTE_E4);} 857 else if(buttonState11 == LOW) { 858 tone(0, NOTE_F4);} 859 else if(buttonState12 == LOW) { 860 tone(0, NOTE_FS4);} 861 else if(buttonState13 == LOW) { 862 tone(0, NOTE_G4);} 863 else { 864 noTone(0); } 865 } 866 else if (dip1state == HIGH // 15 in HEX; GS3 867 && dip2state == LOW 868 && dip3state == HIGH 869 && dip4state == LOW 870 && dip5state == HIGH 871 && dip6state == LOW) 872{ if (buttonState1 == LOW) { 873 tone(0, NOTE_GS3);} 874 else if (buttonState2 == LOW) { 875 tone(0, NOTE_A3);} 876 else if(buttonState3 == LOW) { 877 tone(0, NOTE_AS3);} 878 else if(buttonState4 == LOW) { 879 tone(0, NOTE_B3);} 880 else if(buttonState5 == LOW) { 881 tone(0, NOTE_C4);} 882 else if(buttonState6 == LOW) { 883 tone(0, NOTE_CS4);} 884 else if(buttonState7 == LOW) { 885 tone(0, NOTE_D4);} 886 else if(buttonState8 == LOW) { 887 tone(0, NOTE_DS4);} 888 else if(buttonState9 == LOW) { 889 tone(0, NOTE_E4);} 890 else if(buttonState10 == LOW) { 891 tone(0, NOTE_F4);} 892 else if(buttonState11 == LOW) { 893 tone(0, NOTE_FS4);} 894 else if(buttonState12 == LOW) { 895 tone(0, NOTE_G4);} 896 else if(buttonState13 == LOW) { 897 tone(0, NOTE_GS4);} 898 else { 899 noTone(0); } 900 } 901 902else if (dip1state == LOW // 16 in HEX; A3 903 && dip2state == HIGH 904 && dip3state == HIGH 905 && dip4state == LOW 906 && dip5state == HIGH 907 && dip6state == LOW) 908{ if (buttonState1 == LOW) { 909 tone(0, NOTE_A3);} 910 else if (buttonState2 == LOW) { 911 tone(0, NOTE_AS3);} 912 else if(buttonState3 == LOW) { 913 tone(0, NOTE_B3);} 914 else if(buttonState4 == LOW) { 915 tone(0, NOTE_C4);} 916 else if(buttonState5 == LOW) { 917 tone(0, NOTE_CS4);} 918 else if(buttonState6 == LOW) { 919 tone(0, NOTE_D4);} 920 else if(buttonState7 == LOW) { 921 tone(0, NOTE_DS4);} 922 else if(buttonState8 == LOW) { 923 tone(0, NOTE_E4);} 924 else if(buttonState9 == LOW) { 925 tone(0, NOTE_F4);} 926 else if(buttonState10 == LOW) { 927 tone(0, NOTE_FS4);} 928 else if(buttonState11 == LOW) { 929 tone(0, NOTE_G4);} 930 else if(buttonState12 == LOW) { 931 tone(0, NOTE_GS4);} 932 else if(buttonState13 == LOW) { 933 tone(0, NOTE_A4);} 934 else { 935 noTone(0); } 936 } 937 938else if (dip1state == HIGH // 17 in HEX; AS3 939 && dip2state == HIGH 940 && dip3state == HIGH 941 && dip4state == LOW 942 && dip5state == HIGH 943 && dip6state == LOW) 944{ if (buttonState1 == LOW) { 945 tone(0, NOTE_AS3);} 946 else if (buttonState2 == LOW) { 947 tone(0, NOTE_B3);} 948 else if(buttonState3 == LOW) { 949 tone(0, NOTE_C4);} 950 else if(buttonState4 == LOW) { 951 tone(0, NOTE_CS4);} 952 else if(buttonState5 == LOW) { 953 tone(0, NOTE_D4);} 954 else if(buttonState6 == LOW) { 955 tone(0, NOTE_DS4);} 956 else if(buttonState7 == LOW) { 957 tone(0, NOTE_E4);} 958 else if(buttonState8 == LOW) { 959 tone(0, NOTE_F4);} 960 else if(buttonState9 == LOW) { 961 tone(0, NOTE_FS4);} 962 else if(buttonState10 == LOW) { 963 tone(0, NOTE_G4);} 964 else if(buttonState11 == LOW) { 965 tone(0, NOTE_GS4);} 966 else if(buttonState12 == LOW) { 967 tone(0, NOTE_A4);} 968 else if(buttonState13 == LOW) { 969 tone(0, NOTE_AS4);} 970 else { 971 noTone(0); } 972 } 973 else if (dip1state == LOW // 18 in HEX; B3 974 && dip2state == LOW 975 && dip3state == LOW 976 && dip4state == HIGH 977 && dip5state == HIGH 978 && dip6state == LOW) 979{ if (buttonState1 == LOW) { 980 tone(0, NOTE_B3);} 981 else if (buttonState2 == LOW) { 982 tone(0, NOTE_C4);} 983 else if(buttonState3 == LOW) { 984 tone(0, NOTE_CS4);} 985 else if(buttonState4 == LOW) { 986 tone(0, NOTE_D4);} 987 else if(buttonState5 == LOW) { 988 tone(0, NOTE_DS4);} 989 else if(buttonState6 == LOW) { 990 tone(0, NOTE_E4);} 991 else if(buttonState7 == LOW) { 992 tone(0, NOTE_F4);} 993 else if(buttonState8 == LOW) { 994 tone(0, NOTE_FS4);} 995 else if(buttonState9 == LOW) { 996 tone(0, NOTE_G4);} 997 else if(buttonState10 == LOW) { 998 tone(0, NOTE_GS4);} 999 else if(buttonState11 == LOW) { 1000 tone(0, NOTE_A4);} 1001 else if(buttonState12 == LOW) { 1002 tone(0, NOTE_AS4);} 1003 else if(buttonState13 == LOW) { 1004 tone(0, NOTE_B4);} 1005 else { 1006 noTone(0); } 1007 } 1008 else if (dip1state == HIGH //19 in HEX; C4 1009 && dip2state == LOW 1010 && dip3state == LOW 1011 && dip4state == HIGH 1012 && dip5state == HIGH 1013 && dip6state == LOW) 1014{ if (buttonState1 == LOW) { 1015 tone(0, NOTE_C4);} 1016 else if (buttonState2 == LOW) { 1017 tone(0, NOTE_CS4);} 1018 else if(buttonState3 == LOW) { 1019 tone(0, NOTE_D4);} 1020 else if(buttonState4 == LOW) { 1021 tone(0, NOTE_DS4);} 1022 else if(buttonState5 == LOW) { 1023 tone(0, NOTE_E4);} 1024 else if(buttonState6 == LOW) { 1025 tone(0, NOTE_F4);} 1026 else if(buttonState7 == LOW) { 1027 tone(0, NOTE_FS4);} 1028 else if(buttonState8 == LOW) { 1029 tone(0, NOTE_G4);} 1030 else if(buttonState9 == LOW) { 1031 tone(0, NOTE_GS4);} 1032 else if(buttonState10 == LOW) { 1033 tone(0, NOTE_A4);} 1034 else if(buttonState11 == LOW) { 1035 tone(0, NOTE_AS4);} 1036 else if(buttonState12 == LOW) { 1037 tone(0, NOTE_B4);} 1038 else if(buttonState13 == LOW) { 1039 tone(0, NOTE_C5);} 1040 else { 1041 noTone(0); } 1042 } 1043 else if (dip1state == LOW // 1A in HEX; CS4 1044 && dip2state == HIGH 1045 && dip3state == LOW 1046 && dip4state == HIGH 1047 && dip5state == HIGH 1048 && dip6state == LOW) 1049{ if (buttonState1 == LOW) { 1050 tone(0, NOTE_CS4);} 1051 else if (buttonState2 == LOW) { 1052 tone(0, NOTE_D4);} 1053 else if(buttonState3 == LOW) { 1054 tone(0, NOTE_DS4);} 1055 else if(buttonState4 == LOW) { 1056 tone(0, NOTE_E4);} 1057 else if(buttonState5 == LOW) { 1058 tone(0, NOTE_F4);} 1059 else if(buttonState6 == LOW) { 1060 tone(0, NOTE_FS4);} 1061 else if(buttonState7 == LOW) { 1062 tone(0, NOTE_G4);} 1063 else if(buttonState8 == LOW) { 1064 tone(0, NOTE_GS4);} 1065 else if(buttonState9 == LOW) { 1066 tone(0, NOTE_A4);} 1067 else if(buttonState10 == LOW) { 1068 tone(0, NOTE_AS4);} 1069 else if(buttonState11 == LOW) { 1070 tone(0, NOTE_B4);} 1071 else if(buttonState12 == LOW) { 1072 tone(0, NOTE_C5);} 1073 else if(buttonState13 == LOW) { 1074 tone(0, NOTE_CS5);} 1075 else { 1076 noTone(0); } 1077 } 1078 1079 else if (dip1state == HIGH // 1B in HEX; D4 1080 && dip2state == HIGH 1081 && dip3state == LOW 1082 && dip4state == HIGH 1083 && dip5state == HIGH 1084 && dip6state == LOW) 1085{ if (buttonState1 == LOW) { 1086 tone(0, NOTE_D4);} 1087 else if (buttonState2 == LOW) { 1088 tone(0, NOTE_DS4);} 1089 else if(buttonState3 == LOW) { 1090 tone(0, NOTE_E4);} 1091 else if(buttonState4 == LOW) { 1092 tone(0, NOTE_F4);} 1093 else if(buttonState5 == LOW) { 1094 tone(0, NOTE_FS4);} 1095 else if(buttonState6 == LOW) { 1096 tone(0, NOTE_G4);} 1097 else if(buttonState7 == LOW) { 1098 tone(0, NOTE_GS4);} 1099 else if(buttonState8 == LOW) { 1100 tone(0, NOTE_A4);} 1101 else if(buttonState9 == LOW) { 1102 tone(0, NOTE_AS4);} 1103 else if(buttonState10 == LOW) { 1104 tone(0, NOTE_B4);} 1105 else if(buttonState11 == LOW) { 1106 tone(0, NOTE_C5);} 1107 else if(buttonState12 == LOW) { 1108 tone(0, NOTE_CS5);} 1109 else if(buttonState13 == LOW) { 1110 tone(0, NOTE_D5);} 1111 else { 1112 noTone(0); } 1113 } 1114 1115 else if (dip1state == LOW // 1C in HEX DS4 1116 && dip2state == LOW 1117 && dip3state == HIGH 1118 && dip4state == HIGH 1119 && dip5state == HIGH 1120 && dip6state == LOW) 1121{ if (buttonState1 == LOW) { 1122 tone(0, NOTE_DS4);} 1123 else if (buttonState2 == LOW) { 1124 tone(0, NOTE_E4);} 1125 else if(buttonState3 == LOW) { 1126 tone(0, NOTE_F4);} 1127 else if(buttonState4 == LOW) { 1128 tone(0, NOTE_FS4);} 1129 else if(buttonState5 == LOW) { 1130 tone(0, NOTE_G4);} 1131 else if(buttonState6 == LOW) { 1132 tone(0, NOTE_GS4);} 1133 else if(buttonState7 == LOW) { 1134 tone(0, NOTE_A4);} 1135 else if(buttonState8 == LOW) { 1136 tone(0, NOTE_AS4);} 1137 else if(buttonState9 == LOW) { 1138 tone(0, NOTE_B4);} 1139 else if(buttonState10 == LOW) { 1140 tone(0, NOTE_C5);} 1141 else if(buttonState11 == LOW) { 1142 tone(0, NOTE_CS5);} 1143 else if(buttonState12 == LOW) { 1144 tone(0, NOTE_D5);} 1145 else if(buttonState13 == LOW) { 1146 tone(0, NOTE_DS5);} 1147 else { 1148 noTone(0); } 1149 } 1150 else if (dip1state == HIGH // 1D in HEX; E4 1151 && dip2state == LOW 1152 && dip3state == HIGH 1153 && dip4state == HIGH 1154 && dip5state == HIGH 1155 && dip6state == LOW) 1156 { if (buttonState1 == LOW) { 1157 tone(0, NOTE_E4);} 1158 else if (buttonState2 == LOW) { 1159 tone(0, NOTE_F4);} 1160 else if(buttonState3 == LOW) { 1161 tone(0, NOTE_FS4);} 1162 else if(buttonState4 == LOW) { 1163 tone(0, NOTE_G4);} 1164 else if(buttonState5 == LOW) { 1165 tone(0, NOTE_GS4);} 1166 else if(buttonState6 == LOW) { 1167 tone(0, NOTE_A4);} 1168 else if(buttonState7 == LOW) { 1169 tone(0, NOTE_AS4);} 1170 else if(buttonState8 == LOW) { 1171 tone(0, NOTE_B4);} 1172 else if(buttonState9 == LOW) { 1173 tone(0, NOTE_C5);} 1174 else if(buttonState10 == LOW) { 1175 tone(0, NOTE_CS5);} 1176 else if(buttonState11 == LOW) { 1177 tone(0, NOTE_D5);} 1178 else if(buttonState12 == LOW) { 1179 tone(0, NOTE_DS5);} 1180 else if(buttonState13 == LOW) { 1181 tone(0, NOTE_E5);} 1182 else { 1183 noTone(0); } 1184 } 1185 else if (dip1state == LOW // 1E in HEX; F4 1186 && dip2state == HIGH 1187 && dip3state == HIGH 1188 && dip4state == HIGH 1189 && dip5state == HIGH 1190 && dip6state == LOW) 1191 { if (buttonState1 == LOW) { 1192 tone(0, NOTE_F4);} 1193 else if (buttonState2 == LOW) { 1194 tone(0, NOTE_FS4);} 1195 else if(buttonState3 == LOW) { 1196 tone(0, NOTE_G4);} 1197 else if(buttonState4 == LOW) { 1198 tone(0, NOTE_GS4);} 1199 else if(buttonState5 == LOW) { 1200 tone(0, NOTE_A4);} 1201 else if(buttonState6 == LOW) { 1202 tone(0, NOTE_AS4);} 1203 else if(buttonState7 == LOW) { 1204 tone(0, NOTE_B4);} 1205 else if(buttonState8 == LOW) { 1206 tone(0, NOTE_C5);} 1207 else if(buttonState9 == LOW) { 1208 tone(0, NOTE_CS5);} 1209 else if(buttonState10 == LOW) { 1210 tone(0, NOTE_D5);} 1211 else if(buttonState11 == LOW) { 1212 tone(0, NOTE_DS5);} 1213 else if(buttonState12 == LOW) { 1214 tone(0, NOTE_E5);} 1215 else if(buttonState13 == LOW) { 1216 tone(0, NOTE_F5);} 1217 else { 1218 noTone(0); } 1219 } 1220 1221 else if (dip1state == HIGH // 1F in HEX; FS4 1222 && dip2state == HIGH 1223 && dip3state == HIGH 1224 && dip4state == HIGH 1225 && dip5state == HIGH 1226 && dip6state == LOW) 1227 { if (buttonState1 == LOW) { 1228 tone(0, NOTE_FS4);} 1229 else if (buttonState2 == LOW) { 1230 tone(0, NOTE_G4);} 1231 else if(buttonState3 == LOW) { 1232 tone(0, NOTE_GS4);} 1233 else if(buttonState4 == LOW) { 1234 tone(0, NOTE_A4);} 1235 else if(buttonState5 == LOW) { 1236 tone(0, NOTE_AS4);} 1237 else if(buttonState6 == LOW) { 1238 tone(0, NOTE_B4);} 1239 else if(buttonState7 == LOW) { 1240 tone(0, NOTE_C5);} 1241 else if(buttonState8 == LOW) { 1242 tone(0, NOTE_CS5);} 1243 else if(buttonState9 == LOW) { 1244 tone(0, NOTE_D5);} 1245 else if(buttonState10 == LOW) { 1246 tone(0, NOTE_DS5);} 1247 else if(buttonState11 == LOW) { 1248 tone(0, NOTE_E5);} 1249 else if(buttonState12 == LOW) { 1250 tone(0, NOTE_F5);} 1251 else if(buttonState13 == LOW) { 1252 tone(0, NOTE_FS5);} 1253 else { 1254 noTone(0); } 1255 } 1256 1257else if (dip1state == LOW // 20 in HEX; G4 1258 && dip2state == LOW 1259 && dip3state == LOW 1260 && dip4state == LOW 1261 && dip5state == LOW 1262 && dip6state == HIGH) 1263 { if (buttonState1 == LOW) { 1264 tone(0, NOTE_G4);} 1265 else if (buttonState2 == LOW) { 1266 tone(0, NOTE_GS4);} 1267 else if(buttonState3 == LOW) { 1268 tone(0, NOTE_A4);} 1269 else if(buttonState4 == LOW) { 1270 tone(0, NOTE_AS4);} 1271 else if(buttonState5 == LOW) { 1272 tone(0, NOTE_B4);} 1273 else if(buttonState6 == LOW) { 1274 tone(0, NOTE_C5);} 1275 else if(buttonState7 == LOW) { 1276 tone(0, NOTE_CS5);} 1277 else if(buttonState8 == LOW) { 1278 tone(0, NOTE_D5);} 1279 else if(buttonState9 == LOW) { 1280 tone(0, NOTE_DS5);} 1281 else if(buttonState10 == LOW) { 1282 tone(0, NOTE_E5);} 1283 else if(buttonState11 == LOW) { 1284 tone(0, NOTE_F5);} 1285 else if(buttonState12 == LOW) { 1286 tone(0, NOTE_FS5);} 1287 else if(buttonState13 == LOW) { 1288 tone(0, NOTE_G5);} 1289 else { 1290 noTone(0); } 1291 } 1292else if (dip1state == HIGH // 21 in HEX; GS4 1293 && dip2state == LOW 1294 && dip3state == LOW 1295 && dip4state == LOW 1296 && dip5state == LOW 1297 && dip6state == HIGH) 1298 { if (buttonState1 == LOW) { 1299 tone(0, NOTE_GS4);} 1300 else if (buttonState2 == LOW) { 1301 tone(0, NOTE_A4);} 1302 else if(buttonState3 == LOW) { 1303 tone(0, NOTE_AS4);} 1304 else if(buttonState4 == LOW) { 1305 tone(0, NOTE_B4);} 1306 else if(buttonState5 == LOW) { 1307 tone(0, NOTE_C5);} 1308 else if(buttonState6 == LOW) { 1309 tone(0, NOTE_CS5);} 1310 else if(buttonState7 == LOW) { 1311 tone(0, NOTE_D5);} 1312 else if(buttonState8 == LOW) { 1313 tone(0, NOTE_DS5);} 1314 else if(buttonState9 == LOW) { 1315 tone(0, NOTE_E5);} 1316 else if(buttonState10 == LOW) { 1317 tone(0, NOTE_F5);} 1318 else if(buttonState11 == LOW) { 1319 tone(0, NOTE_FS5);} 1320 else if(buttonState12 == LOW) { 1321 tone(0, NOTE_G5);} 1322 else if(buttonState13 == LOW) { 1323 tone(0, NOTE_GS5);} 1324 else { 1325 noTone(0); } 1326 } 1327else if (dip1state == LOW // 22 in HEX; A4 1328 && dip2state == HIGH 1329 && dip3state == LOW 1330 && dip4state == LOW 1331 && dip5state == LOW 1332 && dip6state == HIGH) 1333 { if (buttonState1 == LOW) { 1334 tone(0, NOTE_A4);} 1335 else if (buttonState2 == LOW) { 1336 tone(0, NOTE_AS4);} 1337 else if(buttonState3 == LOW) { 1338 tone(0, NOTE_B4);} 1339 else if(buttonState4 == LOW) { 1340 tone(0, NOTE_C5);} 1341 else if(buttonState5 == LOW) { 1342 tone(0, NOTE_CS5);} 1343 else if(buttonState6 == LOW) { 1344 tone(0, NOTE_D5);} 1345 else if(buttonState7 == LOW) { 1346 tone(0, NOTE_DS5);} 1347 else if(buttonState8 == LOW) { 1348 tone(0, NOTE_E5);} 1349 else if(buttonState9 == LOW) { 1350 tone(0, NOTE_F5);} 1351 else if(buttonState10 == LOW) { 1352 tone(0, NOTE_FS5);} 1353 else if(buttonState11 == LOW) { 1354 tone(0, NOTE_G5);} 1355 else if(buttonState12 == LOW) { 1356 tone(0, NOTE_GS5);} 1357 else if(buttonState13 == LOW) { 1358 tone(0, NOTE_A5);} 1359 else { 1360 noTone(0); } 1361 } 1362 1363 else if (dip1state == HIGH // 23 in HEX; AS4 1364 && dip2state == HIGH 1365 && dip3state == LOW 1366 && dip4state == LOW 1367 && dip5state == LOW 1368 && dip6state == HIGH) 1369 1370 { if (buttonState1 == LOW) { 1371 tone(0, NOTE_AS4);} 1372 else if (buttonState2 == LOW) { 1373 tone(0, NOTE_B4);} 1374 else if(buttonState3 == LOW) { 1375 tone(0, NOTE_C5);} 1376 else if(buttonState4 == LOW) { 1377 tone(0, NOTE_CS5);} 1378 else if(buttonState5 == LOW) { 1379 tone(0, NOTE_D5);} 1380 else if(buttonState6 == LOW) { 1381 tone(0, NOTE_DS5);} 1382 else if(buttonState7 == LOW) { 1383 tone(0, NOTE_E5);} 1384 else if(buttonState8 == LOW) { 1385 tone(0, NOTE_F5);} 1386 else if(buttonState9 == LOW) { 1387 tone(0, NOTE_FS5);} 1388 else if(buttonState10 == LOW) { 1389 tone(0, NOTE_G5);} 1390 else if(buttonState11 == LOW) { 1391 tone(0, NOTE_GS5);} 1392 else if(buttonState12 == LOW) { 1393 tone(0, NOTE_A5);} 1394 else if(buttonState13 == LOW) { 1395 tone(0, NOTE_AS5);} 1396 else { 1397 noTone(0); } 1398 } 1399 1400 else if (dip1state == LOW // 24 in HEX; B4 1401 && dip2state == LOW 1402 && dip3state == HIGH 1403 && dip4state == LOW 1404 && dip5state == LOW 1405 && dip6state == HIGH) 1406{ if (buttonState1 == LOW) { 1407 tone(0, NOTE_B4);} 1408 else if (buttonState2 == LOW) { 1409 tone(0, NOTE_C5);} 1410 else if(buttonState3 == LOW) { 1411 tone(0, NOTE_CS5);} 1412 else if(buttonState4 == LOW) { 1413 tone(0, NOTE_D5);} 1414 else if(buttonState5 == LOW) { 1415 tone(0, NOTE_DS5);} 1416 else if(buttonState6 == LOW) { 1417 tone(0, NOTE_E5);} 1418 else if(buttonState7 == LOW) { 1419 tone(0, NOTE_F5);} 1420 else if(buttonState8 == LOW) { 1421 tone(0, NOTE_FS5);} 1422 else if(buttonState9 == LOW) { 1423 tone(0, NOTE_G5);} 1424 else if(buttonState10 == LOW) { 1425 tone(0, NOTE_GS5);} 1426 else if(buttonState11 == LOW) { 1427 tone(0, NOTE_A5);} 1428 else if(buttonState12 == LOW) { 1429 tone(0, NOTE_AS5);} 1430 else if(buttonState13 == LOW) { 1431 tone(0, NOTE_B5);} 1432 else { 1433 noTone(0); } 1434 } 1435 else if (dip1state == HIGH //25 in HEX; C5 1436 && dip2state == LOW 1437 && dip3state == HIGH 1438 && dip4state == LOW 1439 && dip5state == LOW 1440 && dip6state == HIGH) 1441{ if (buttonState1 == LOW) { 1442 tone(0, NOTE_C5);} 1443 else if (buttonState2 == LOW) { 1444 tone(0, NOTE_CS5);} 1445 else if(buttonState3 == LOW) { 1446 tone(0, NOTE_D5);} 1447 else if(buttonState4 == LOW) { 1448 tone(0, NOTE_DS5);} 1449 else if(buttonState5 == LOW) { 1450 tone(0, NOTE_E5);} 1451 else if(buttonState6 == LOW) { 1452 tone(0, NOTE_F5);} 1453 else if(buttonState7 == LOW) { 1454 tone(0, NOTE_FS5);} 1455 else if(buttonState8 == LOW) { 1456 tone(0, NOTE_G5);} 1457 else if(buttonState9 == LOW) { 1458 tone(0, NOTE_GS5);} 1459 else if(buttonState10 == LOW) { 1460 tone(0, NOTE_A5);} 1461 else if(buttonState11 == LOW) { 1462 tone(0, NOTE_AS5);} 1463 else if(buttonState12 == LOW) { 1464 tone(0, NOTE_B5);} 1465 else if(buttonState13 == LOW) { 1466 tone(0, NOTE_C6);} 1467 else { 1468 noTone(0); } 1469 } 1470 1471else if (dip1state == LOW // 26 in HEX; CS5 1472 && dip2state == HIGH 1473 && dip3state == HIGH 1474 && dip4state == LOW 1475 && dip5state == LOW 1476 && dip6state == HIGH) 1477{ if (buttonState1 == LOW) { 1478 tone(0, NOTE_CS5);} 1479 else if (buttonState2 == LOW) { 1480 tone(0, NOTE_D5);} 1481 else if(buttonState3 == LOW) { 1482 tone(0, NOTE_DS5);} 1483 else if(buttonState4 == LOW) { 1484 tone(0, NOTE_E5);} 1485 else if(buttonState5 == LOW) { 1486 tone(0, NOTE_F5);} 1487 else if(buttonState6 == LOW) { 1488 tone(0, NOTE_FS5);} 1489 else if(buttonState7 == LOW) { 1490 tone(0, NOTE_G5);} 1491 else if(buttonState8 == LOW) { 1492 tone(0, NOTE_GS5);} 1493 else if(buttonState9 == LOW) { 1494 tone(0, NOTE_A5);} 1495 else if(buttonState10 == LOW) { 1496 tone(0, NOTE_AS5);} 1497 else if(buttonState11 == LOW) { 1498 tone(0, NOTE_B5);} 1499 else if(buttonState12 == LOW) { 1500 tone(0, NOTE_C6);} 1501 else if(buttonState13 == LOW) { 1502 tone(0, NOTE_CS6);} 1503 else { 1504 noTone(0); } 1505 } 1506else if (dip1state == HIGH // 27 in HEX; D5 1507 && dip2state == HIGH 1508 && dip3state == HIGH 1509 && dip4state == LOW 1510 && dip5state == LOW 1511 && dip6state == HIGH) 1512 1513{ if (buttonState1 == LOW) { 1514 tone(0, NOTE_D5);} 1515 else if (buttonState2 == LOW) { 1516 tone(0, NOTE_DS5);} 1517 else if(buttonState3 == LOW) { 1518 tone(0, NOTE_E5);} 1519 else if(buttonState4 == LOW) { 1520 tone(0, NOTE_F5);} 1521 else if(buttonState5 == LOW) { 1522 tone(0, NOTE_FS5);} 1523 else if(buttonState6 == LOW) { 1524 tone(0, NOTE_G5);} 1525 else if(buttonState7 == LOW) { 1526 tone(0, NOTE_GS5);} 1527 else if(buttonState8 == LOW) { 1528 tone(0, NOTE_A5);} 1529 else if(buttonState9 == LOW) { 1530 tone(0, NOTE_AS5);} 1531 else if(buttonState10 == LOW) { 1532 tone(0, NOTE_B5);} 1533 else if(buttonState11 == LOW) { 1534 tone(0, NOTE_C6);} 1535 else if(buttonState12 == LOW) { 1536 tone(0, NOTE_CS6);} 1537 else if(buttonState13 == LOW) { 1538 tone(0, NOTE_D6);} 1539 else { 1540 noTone(0); } 1541 } 1542 1543else if (dip1state == LOW // 28 in HEX DS5 1544 && dip2state == LOW 1545 && dip3state == LOW 1546 && dip4state == HIGH 1547 && dip5state == LOW 1548 && dip6state == HIGH) 1549 1550{ if (buttonState1 == LOW) { 1551 tone(0, NOTE_DS5);} 1552 else if (buttonState2 == LOW) { 1553 tone(0, NOTE_E5);} 1554 else if(buttonState3 == LOW) { 1555 tone(0, NOTE_F5);} 1556 else if(buttonState4 == LOW) { 1557 tone(0, NOTE_FS5);} 1558 else if(buttonState5 == LOW) { 1559 tone(0, NOTE_G5);} 1560 else if(buttonState6 == LOW) { 1561 tone(0, NOTE_GS5);} 1562 else if(buttonState7 == LOW) { 1563 tone(0, NOTE_A5);} 1564 else if(buttonState8 == LOW) { 1565 tone(0, NOTE_AS5);} 1566 else if(buttonState9 == LOW) { 1567 tone(0, NOTE_B5);} 1568 else if(buttonState10 == LOW) { 1569 tone(0, NOTE_C6);} 1570 else if(buttonState11 == LOW) { 1571 tone(0, NOTE_CS6);} 1572 else if(buttonState12 == LOW) { 1573 tone(0, NOTE_D6);} 1574 else if(buttonState13 == LOW) { 1575 tone(0, NOTE_DS6);} 1576 else { 1577 noTone(0); } 1578 } 1579 1580 else if (dip1state == HIGH // 29 in HEX; E5 1581 && dip2state == LOW 1582 && dip3state == LOW 1583 && dip4state == HIGH 1584 && dip5state == LOW 1585 && dip6state == HIGH) 1586 1587{ if (buttonState1 == LOW) { 1588 tone(0, NOTE_E5);} 1589 else if (buttonState2 == LOW) { 1590 tone(0, NOTE_F5);} 1591 else if(buttonState3 == LOW) { 1592 tone(0, NOTE_FS5);} 1593 else if(buttonState4 == LOW) { 1594 tone(0, NOTE_G5);} 1595 else if(buttonState5 == LOW) { 1596 tone(0, NOTE_GS5);} 1597 else if(buttonState6 == LOW) { 1598 tone(0, NOTE_A5);} 1599 else if(buttonState7 == LOW) { 1600 tone(0, NOTE_AS5);} 1601 else if(buttonState8 == LOW) { 1602 tone(0, NOTE_B5);} 1603 else if(buttonState9 == LOW) { 1604 tone(0, NOTE_C6);} 1605 else if(buttonState10 == LOW) { 1606 tone(0, NOTE_CS6);} 1607 else if(buttonState11 == LOW) { 1608 tone(0, NOTE_D6);} 1609 else if(buttonState12 == LOW) { 1610 tone(0, NOTE_DS6);} 1611 else if(buttonState13 == LOW) { 1612 tone(0, NOTE_E6);} 1613 else { 1614 noTone(0); } 1615 } 1616 1617else if (dip1state == LOW // 2A in HEX; F5 1618 && dip2state == HIGH 1619 && dip3state == LOW 1620 && dip4state == HIGH 1621 && dip5state == LOW 1622 && dip6state == HIGH) 1623{ if (buttonState1 == LOW) { 1624 tone(0, NOTE_F5);} 1625 else if (buttonState2 == LOW) { 1626 tone(0, NOTE_FS5);} 1627 else if(buttonState3 == LOW) { 1628 tone(0, NOTE_G5);} 1629 else if(buttonState4 == LOW) { 1630 tone(0, NOTE_GS5);} 1631 else if(buttonState5 == LOW) { 1632 tone(0, NOTE_A5);} 1633 else if(buttonState6 == LOW) { 1634 tone(0, NOTE_AS5);} 1635 else if(buttonState7 == LOW) { 1636 tone(0, NOTE_B5);} 1637 else if(buttonState8 == LOW) { 1638 tone(0, NOTE_C6);} 1639 else if(buttonState9 == LOW) { 1640 tone(0, NOTE_CS6);} 1641 else if(buttonState10 == LOW) { 1642 tone(0, NOTE_D6);} 1643 else if(buttonState11 == LOW) { 1644 tone(0, NOTE_DS6);} 1645 else if(buttonState12 == LOW) { 1646 tone(0, NOTE_E6);} 1647 else if(buttonState13 == LOW) { 1648 tone(0, NOTE_F6);} 1649 else { 1650 noTone(0); } 1651 } 1652 else if (dip1state == HIGH // 2B in HEX; FS5 1653 && dip2state == HIGH 1654 && dip3state == LOW 1655 && dip4state == HIGH 1656 && dip5state == LOW 1657 && dip6state == HIGH) 1658 1659{ if (buttonState1 == LOW) { 1660 tone(0, NOTE_FS5);} 1661 else if (buttonState2 == LOW) { 1662 tone(0, NOTE_G5);} 1663 else if(buttonState3 == LOW) { 1664 tone(0, NOTE_GS5);} 1665 else if(buttonState4 == LOW) { 1666 tone(0, NOTE_A5);} 1667 else if(buttonState5 == LOW) { 1668 tone(0, NOTE_AS5);} 1669 else if(buttonState6 == LOW) { 1670 tone(0, NOTE_B5);} 1671 else if(buttonState7 == LOW) { 1672 tone(0, NOTE_C6);} 1673 else if(buttonState8 == LOW) { 1674 tone(0, NOTE_CS6);} 1675 else if(buttonState9 == LOW) { 1676 tone(0, NOTE_D6);} 1677 else if(buttonState10 == LOW) { 1678 tone(0, NOTE_DS6);} 1679 else if(buttonState11 == LOW) { 1680 tone(0, NOTE_E6);} 1681 else if(buttonState12 == LOW) { 1682 tone(0, NOTE_F6);} 1683 else if(buttonState13 == LOW) { 1684 tone(0, NOTE_FS6);} 1685 else { 1686 noTone(0); } 1687 } 1688 1689else if (dip1state == LOW // 2C in HEX; G5 1690 && dip2state == LOW 1691 && dip3state == HIGH 1692 && dip4state == HIGH 1693 && dip5state == LOW 1694 && dip6state == HIGH) 1695{ if (buttonState1 == LOW) { 1696 tone(0, NOTE_G5);} 1697 else if (buttonState2 == LOW) { 1698 tone(0, NOTE_GS5);} 1699 else if(buttonState3 == LOW) { 1700 tone(0, NOTE_A5);} 1701 else if(buttonState4 == LOW) { 1702 tone(0, NOTE_AS5);} 1703 else if(buttonState5 == LOW) { 1704 tone(0, NOTE_B5);} 1705 else if(buttonState6 == LOW) { 1706 tone(0, NOTE_C6);} 1707 else if(buttonState7 == LOW) { 1708 tone(0, NOTE_CS6);} 1709 else if(buttonState8 == LOW) { 1710 tone(0, NOTE_D6);} 1711 else if(buttonState9 == LOW) { 1712 tone(0, NOTE_DS6);} 1713 else if(buttonState10 == LOW) { 1714 tone(0, NOTE_E6);} 1715 else if(buttonState11 == LOW) { 1716 tone(0, NOTE_F6);} 1717 else if(buttonState12 == LOW) { 1718 tone(0, NOTE_FS6);} 1719 else if(buttonState13 == LOW) { 1720 tone(0, NOTE_G6);} 1721 else { 1722 noTone(0); } 1723 } 1724 else if (dip1state == HIGH // 2D in HEX; GS5 1725 && dip2state == LOW 1726 && dip3state == HIGH 1727 && dip4state == HIGH 1728 && dip5state == LOW 1729 && dip6state == HIGH) 1730 1731{ if (buttonState1 == LOW) { 1732 tone(0, NOTE_GS5);} 1733 else if (buttonState2 == LOW) { 1734 tone(0, NOTE_A5);} 1735 else if(buttonState3 == LOW) { 1736 tone(0, NOTE_AS5);} 1737 else if(buttonState4 == LOW) { 1738 tone(0, NOTE_B5);} 1739 else if(buttonState5 == LOW) { 1740 tone(0, NOTE_C6);} 1741 else if(buttonState6 == LOW) { 1742 tone(0, NOTE_CS6);} 1743 else if(buttonState7 == LOW) { 1744 tone(0, NOTE_D6);} 1745 else if(buttonState8 == LOW) { 1746 tone(0, NOTE_DS6);} 1747 else if(buttonState9 == LOW) { 1748 tone(0, NOTE_E6);} 1749 else if(buttonState10 == LOW) { 1750 tone(0, NOTE_F6);} 1751 else if(buttonState11 == LOW) { 1752 tone(0, NOTE_FS6);} 1753 else if(buttonState12 == LOW) { 1754 tone(0, NOTE_G6);} 1755 else if(buttonState13 == LOW) { 1756 tone(0, NOTE_GS6);} 1757 else { 1758 noTone(0); } 1759 } 1760 else if (dip1state == LOW // 2E in HEX; A5 1761 && dip2state == HIGH 1762 && dip3state == HIGH 1763 && dip4state == HIGH 1764 && dip5state == LOW 1765 && dip6state == HIGH) 1766 { if (buttonState1 == LOW) { 1767 tone(0, NOTE_A5);} 1768 else if (buttonState2 == LOW) { 1769 tone(0, NOTE_AS5);} 1770 else if(buttonState3 == LOW) { 1771 tone(0, NOTE_B5);} 1772 else if(buttonState4 == LOW) { 1773 tone(0, NOTE_C6);} 1774 else if(buttonState5 == LOW) { 1775 tone(0, NOTE_CS6);} 1776 else if(buttonState6 == LOW) { 1777 tone(0, NOTE_D6);} 1778 else if(buttonState7 == LOW) { 1779 tone(0, NOTE_DS6);} 1780 else if(buttonState8 == LOW) { 1781 tone(0, NOTE_E6);} 1782 else if(buttonState9 == LOW) { 1783 tone(0, NOTE_F6);} 1784 else if(buttonState10 == LOW) { 1785 tone(0, NOTE_FS6);} 1786 else if(buttonState11 == LOW) { 1787 tone(0, NOTE_G6);} 1788 else if(buttonState12 == LOW) { 1789 tone(0, NOTE_GS6);} 1790 else if(buttonState13 == LOW) { 1791 tone(0, NOTE_A6);} 1792 else { 1793 noTone(0); } 1794 } 1795 1796 else if (dip1state == HIGH // 2F in HEX; AS5 1797 && dip2state == HIGH 1798 && dip3state == HIGH 1799 && dip4state == HIGH 1800 && dip5state == LOW 1801 && dip6state == HIGH) 1802 { if (buttonState1 == LOW) { 1803 tone(0, NOTE_AS5);} 1804 else if (buttonState2 == LOW) { 1805 tone(0, NOTE_B5);} 1806 else if(buttonState3 == LOW) { 1807 tone(0, NOTE_C6);} 1808 else if(buttonState4 == LOW) { 1809 tone(0, NOTE_CS6);} 1810 else if(buttonState5 == LOW) { 1811 tone(0, NOTE_D6);} 1812 else if(buttonState6 == LOW) { 1813 tone(0, NOTE_DS6);} 1814 else if(buttonState7 == LOW) { 1815 tone(0, NOTE_E6);} 1816 else if(buttonState8 == LOW) { 1817 tone(0, NOTE_F6);} 1818 else if(buttonState9 == LOW) { 1819 tone(0, NOTE_FS6);} 1820 else if(buttonState10 == LOW) { 1821 tone(0, NOTE_G6);} 1822 else if(buttonState11 == LOW) { 1823 tone(0, NOTE_GS6);} 1824 else if(buttonState12 == LOW) { 1825 tone(0, NOTE_A6);} 1826 else if(buttonState13 == LOW) { 1827 tone(0, NOTE_AS6);} 1828 else { 1829 noTone(0); } 1830 } 1831else if (dip1state == LOW // 30 in HEX; B5 1832 && dip2state == LOW 1833 && dip3state == LOW 1834 && dip4state == LOW 1835 && dip5state == HIGH 1836 && dip6state == HIGH) 1837 1838 { if (buttonState1 == LOW) { 1839 tone(0, NOTE_B5);} 1840 else if (buttonState2 == LOW) { 1841 tone(0, NOTE_C6);} 1842 else if(buttonState3 == LOW) { 1843 tone(0, NOTE_CS6);} 1844 else if(buttonState4 == LOW) { 1845 tone(0, NOTE_D6);} 1846 else if(buttonState5 == LOW) { 1847 tone(0, NOTE_DS6);} 1848 else if(buttonState6 == LOW) { 1849 tone(0, NOTE_E6);} 1850 else if(buttonState7 == LOW) { 1851 tone(0, NOTE_F6);} 1852 else if(buttonState8 == LOW) { 1853 tone(0, NOTE_FS6);} 1854 else if(buttonState9 == LOW) { 1855 tone(0, NOTE_G6);} 1856 else if(buttonState10 == LOW) { 1857 tone(0, NOTE_GS6);} 1858 else if(buttonState11 == LOW) { 1859 tone(0, NOTE_A6);} 1860 else if(buttonState12 == LOW) { 1861 tone(0, NOTE_AS6);} 1862 else if(buttonState13 == LOW) { 1863 tone(0, NOTE_B6);} 1864 else { 1865 noTone(0); } 1866 } 1867 1868 1869 else if (dip1state == HIGH //31 in HEX; C6 1870 && dip2state == LOW 1871 && dip3state == LOW 1872 && dip4state == LOW 1873 && dip5state == HIGH 1874 && dip6state == HIGH) 1875 { if (buttonState1 == LOW) { 1876 tone(0, NOTE_C6);} 1877 else if (buttonState2 == LOW) { 1878 tone(0, NOTE_CS6);} 1879 else if(buttonState3 == LOW) { 1880 tone(0, NOTE_D6);} 1881 else if(buttonState4 == LOW) { 1882 tone(0, NOTE_DS6);} 1883 else if(buttonState5 == LOW) { 1884 tone(0, NOTE_E6);} 1885 else if(buttonState6 == LOW) { 1886 tone(0, NOTE_F6);} 1887 else if(buttonState7 == LOW) { 1888 tone(0, NOTE_FS6);} 1889 else if(buttonState8 == LOW) { 1890 tone(0, NOTE_G6);} 1891 else if(buttonState9 == LOW) { 1892 tone(0, NOTE_GS6);} 1893 else if(buttonState10 == LOW) { 1894 tone(0, NOTE_A6);} 1895 else if(buttonState11 == LOW) { 1896 tone(0, NOTE_AS6);} 1897 else if(buttonState12 == LOW) { 1898 tone(0, NOTE_B6);} 1899 else if(buttonState13 == LOW) { 1900 tone(0, NOTE_C7);} 1901 else { 1902 noTone(0); } 1903 } 1904 1905 else if (dip1state == LOW // 32 in HEX; CS6 1906 && dip2state == HIGH 1907 && dip3state == LOW 1908 && dip4state == LOW 1909 && dip5state == HIGH 1910 && dip6state == HIGH) 1911 1912 { if (buttonState1 == LOW) { 1913 tone(0, NOTE_CS6);} 1914 else if (buttonState2 == LOW) { 1915 tone(0, NOTE_D6);} 1916 else if(buttonState3 == LOW) { 1917 tone(0, NOTE_DS6);} 1918 else if(buttonState4 == LOW) { 1919 tone(0, NOTE_E6);} 1920 else if(buttonState5 == LOW) { 1921 tone(0, NOTE_F6);} 1922 else if(buttonState6 == LOW) { 1923 tone(0, NOTE_FS6);} 1924 else if(buttonState7 == LOW) { 1925 tone(0, NOTE_G6);} 1926 else if(buttonState8 == LOW) { 1927 tone(0, NOTE_GS6);} 1928 else if(buttonState9 == LOW) { 1929 tone(0, NOTE_A6);} 1930 else if(buttonState10 == LOW) { 1931 tone(0, NOTE_AS6);} 1932 else if(buttonState11 == LOW) { 1933 tone(0, NOTE_B6);} 1934 else if(buttonState12 == LOW) { 1935 tone(0, NOTE_C7);} 1936 else if(buttonState13 == LOW) { 1937 tone(0, NOTE_CS7);} 1938 else { 1939 noTone(0); } 1940 } 1941 1942else if (dip1state == HIGH // 33 in HEX; D6 1943 && dip2state == HIGH 1944 && dip3state == LOW 1945 && dip4state == LOW 1946 && dip5state == HIGH 1947 && dip6state == HIGH) 1948 1949 { if (buttonState1 == LOW) { 1950 tone(0, NOTE_D6);} 1951 else if (buttonState2 == LOW) { 1952 tone(0, NOTE_DS6);} 1953 else if(buttonState3 == LOW) { 1954 tone(0, NOTE_E6);} 1955 else if(buttonState4 == LOW) { 1956 tone(0, NOTE_F6);} 1957 else if(buttonState5 == LOW) { 1958 tone(0, NOTE_FS6);} 1959 else if(buttonState6 == LOW) { 1960 tone(0, NOTE_G6);} 1961 else if(buttonState7 == LOW) { 1962 tone(0, NOTE_GS6);} 1963 else if(buttonState8 == LOW) { 1964 tone(0, NOTE_A6);} 1965 else if(buttonState9 == LOW) { 1966 tone(0, NOTE_AS6);} 1967 else if(buttonState10 == LOW) { 1968 tone(0, NOTE_B6);} 1969 else if(buttonState11 == LOW) { 1970 tone(0, NOTE_C7);} 1971 else if(buttonState12 == LOW) { 1972 tone(0, NOTE_CS7);} 1973 else if(buttonState13 == LOW) { 1974 tone(0, NOTE_D7);} 1975 else { 1976 noTone(0); } 1977 } 1978 1979else if (dip1state == LOW // 34 in HEX DS6 1980 && dip2state == LOW 1981 && dip3state == HIGH 1982 && dip4state == LOW 1983 && dip5state == HIGH 1984 && dip6state == HIGH) 1985 { if (buttonState1 == LOW) { 1986 tone(0, NOTE_DS6);} 1987 else if (buttonState2 == LOW) { 1988 tone(0, NOTE_E6);} 1989 else if(buttonState3 == LOW) { 1990 tone(0, NOTE_F6);} 1991 else if(buttonState4 == LOW) { 1992 tone(0, NOTE_FS6);} 1993 else if(buttonState5 == LOW) { 1994 tone(0, NOTE_G6);} 1995 else if(buttonState6 == LOW) { 1996 tone(0, NOTE_GS6);} 1997 else if(buttonState7 == LOW) { 1998 tone(0, NOTE_A6);} 1999 else if(buttonState8 == LOW) { 2000 tone(0, NOTE_AS6);} 2001 else if(buttonState9 == LOW) { 2002 tone(0, NOTE_B6);} 2003 else if(buttonState10 == LOW) { 2004 tone(0, NOTE_C7);} 2005 else if(buttonState11 == LOW) { 2006 tone(0, NOTE_CS7);} 2007 else if(buttonState12 == LOW) { 2008 tone(0, NOTE_D7);} 2009 else if(buttonState13 == LOW) { 2010 tone(0, NOTE_DS7);} 2011 else { 2012 noTone(0); } 2013 } 2014 2015 else if (dip1state == HIGH // 35 in HEX; E6 2016 && dip2state == LOW 2017 && dip3state == HIGH 2018 && dip4state == LOW 2019 && dip5state == HIGH 2020 && dip6state == HIGH) 2021 2022 { if (buttonState1 == LOW) { 2023 tone(0, NOTE_E6);} 2024 else if (buttonState2 == LOW) { 2025 tone(0, NOTE_F6);} 2026 else if(buttonState3 == LOW) { 2027 tone(0, NOTE_FS6);} 2028 else if(buttonState4 == LOW) { 2029 tone(0, NOTE_G6);} 2030 else if(buttonState5 == LOW) { 2031 tone(0, NOTE_GS6);} 2032 else if(buttonState6 == LOW) { 2033 tone(0, NOTE_A6);} 2034 else if(buttonState7 == LOW) { 2035 tone(0, NOTE_AS6);} 2036 else if(buttonState8 == LOW) { 2037 tone(0, NOTE_B6);} 2038 else if(buttonState9 == LOW) { 2039 tone(0, NOTE_C7);} 2040 else if(buttonState10 == LOW) { 2041 tone(0, NOTE_CS7);} 2042 else if(buttonState11 == LOW) { 2043 tone(0, NOTE_D7);} 2044 else if(buttonState12 == LOW) { 2045 tone(0, NOTE_DS7);} 2046 else if(buttonState13 == LOW) { 2047 tone(0, NOTE_E7);} 2048 else { 2049 noTone(0); } 2050 } 2051else if (dip1state == LOW // 36 in HEX; F6 2052 && dip2state == HIGH 2053 && dip3state == HIGH 2054 && dip4state == LOW 2055 && dip5state == HIGH 2056 && dip6state == HIGH) 2057 { if (buttonState1 == LOW) { 2058 tone(0, NOTE_F6);} 2059 else if (buttonState2 == LOW) { 2060 tone(0, NOTE_FS6);} 2061 else if(buttonState3 == LOW) { 2062 tone(0, NOTE_G6);} 2063 else if(buttonState4 == LOW) { 2064 tone(0, NOTE_GS6);} 2065 else if(buttonState5 == LOW) { 2066 tone(0, NOTE_A6);} 2067 else if(buttonState6 == LOW) { 2068 tone(0, NOTE_AS6);} 2069 else if(buttonState7 == LOW) { 2070 tone(0, NOTE_B6);} 2071 else if(buttonState8 == LOW) { 2072 tone(0, NOTE_C7);} 2073 else if(buttonState9 == LOW) { 2074 tone(0, NOTE_CS7);} 2075 else if(buttonState10 == LOW) { 2076 tone(0, NOTE_D7);} 2077 else if(buttonState11 == LOW) { 2078 tone(0, NOTE_DS7);} 2079 else if(buttonState12 == LOW) { 2080 tone(0, NOTE_E7);} 2081 else if(buttonState13 == LOW) { 2082 tone(0, NOTE_F7);} 2083 else { 2084 noTone(0); } 2085 } 2086 else if (dip1state == HIGH // 37 in HEX; FS6 2087 && dip2state == HIGH 2088 && dip3state == HIGH 2089 && dip4state == LOW 2090 && dip5state == HIGH 2091 && dip6state == HIGH) 2092 2093 { if (buttonState1 == LOW) { 2094 tone(0, NOTE_FS6);} 2095 else if (buttonState2 == LOW) { 2096 tone(0, NOTE_G6);} 2097 else if(buttonState3 == LOW) { 2098 tone(0, NOTE_GS6);} 2099 else if(buttonState4 == LOW) { 2100 tone(0, NOTE_A6);} 2101 else if(buttonState5 == LOW) { 2102 tone(0, NOTE_AS6);} 2103 else if(buttonState6 == LOW) { 2104 tone(0, NOTE_B6);} 2105 else if(buttonState7 == LOW) { 2106 tone(0, NOTE_C7);} 2107 else if(buttonState8 == LOW) { 2108 tone(0, NOTE_CS7);} 2109 else if(buttonState9 == LOW) { 2110 tone(0, NOTE_D7);} 2111 else if(buttonState10 == LOW) { 2112 tone(0, NOTE_DS7);} 2113 else if(buttonState11 == LOW) { 2114 tone(0, NOTE_E7);} 2115 else if(buttonState12 == LOW) { 2116 tone(0, NOTE_F7);} 2117 else if(buttonState13 == LOW) { 2118 tone(0, NOTE_FS7);} 2119 else { 2120 noTone(0); } 2121 } 2122 2123 else if (dip1state == LOW // 38 in HEX; G6 2124 && dip2state == LOW 2125 && dip3state == LOW 2126 && dip4state == HIGH 2127 && dip5state == HIGH 2128 && dip6state == HIGH) 2129 2130 { if (buttonState1 == LOW) { 2131 tone(0, NOTE_G6);} 2132 else if (buttonState2 == LOW) { 2133 tone(0, NOTE_GS6);} 2134 else if(buttonState3 == LOW) { 2135 tone(0, NOTE_A6);} 2136 else if(buttonState4 == LOW) { 2137 tone(0, NOTE_AS6);} 2138 else if(buttonState5 == LOW) { 2139 tone(0, NOTE_B6);} 2140 else if(buttonState6 == LOW) { 2141 tone(0, NOTE_C7);} 2142 else if(buttonState7 == LOW) { 2143 tone(0, NOTE_CS7);} 2144 else if(buttonState8 == LOW) { 2145 tone(0, NOTE_D7);} 2146 else if(buttonState9 == LOW) { 2147 tone(0, NOTE_DS7);} 2148 else if(buttonState10 == LOW) { 2149 tone(0, NOTE_E7);} 2150 else if(buttonState11 == LOW) { 2151 tone(0, NOTE_F7);} 2152 else if(buttonState12 == LOW) { 2153 tone(0, NOTE_FS7);} 2154 else if(buttonState13 == LOW) { 2155 tone(0, NOTE_G7);} 2156 else { 2157 noTone(0); } 2158 } 2159else if (dip1state == HIGH // 39 in HEX; GS6 2160 && dip2state == LOW 2161 && dip3state == LOW 2162 && dip4state == HIGH 2163 && dip5state == HIGH 2164 && dip6state == HIGH) 2165 { if (buttonState1 == LOW) { 2166 tone(0, NOTE_GS6);} 2167 else if (buttonState2 == LOW) { 2168 tone(0, NOTE_A6);} 2169 else if(buttonState3 == LOW) { 2170 tone(0, NOTE_AS6);} 2171 else if(buttonState4 == LOW) { 2172 tone(0, NOTE_B6);} 2173 else if(buttonState5 == LOW) { 2174 tone(0, NOTE_C7);} 2175 else if(buttonState6 == LOW) { 2176 tone(0, NOTE_CS7);} 2177 else if(buttonState7 == LOW) { 2178 tone(0, NOTE_D7);} 2179 else if(buttonState8 == LOW) { 2180 tone(0, NOTE_DS7);} 2181 else if(buttonState9 == LOW) { 2182 tone(0, NOTE_E7);} 2183 else if(buttonState10 == LOW) { 2184 tone(0, NOTE_F7);} 2185 else if(buttonState11 == LOW) { 2186 tone(0, NOTE_FS7);} 2187 else if(buttonState12 == LOW) { 2188 tone(0, NOTE_G7);} 2189 else if(buttonState13 == LOW) { 2190 tone(0, NOTE_GS7);} 2191 else { 2192 noTone(0); } 2193 } 2194 else if (dip1state == LOW // 3A in HEX; A6 2195 && dip2state == HIGH 2196 && dip3state == LOW 2197 && dip4state == HIGH 2198 && dip5state == HIGH 2199 && dip6state == HIGH) 2200 2201 { if (buttonState1 == LOW) { 2202 tone(0, NOTE_A6);} 2203 else if (buttonState2 == LOW) { 2204 tone(0, NOTE_AS6);} 2205 else if(buttonState3 == LOW) { 2206 tone(0, NOTE_B6);} 2207 else if(buttonState4 == LOW) { 2208 tone(0, NOTE_C7);} 2209 else if(buttonState5 == LOW) { 2210 tone(0, NOTE_CS7);} 2211 else if(buttonState6 == LOW) { 2212 tone(0, NOTE_D7);} 2213 else if(buttonState7 == LOW) { 2214 tone(0, NOTE_DS7);} 2215 else if(buttonState8 == LOW) { 2216 tone(0, NOTE_E7);} 2217 else if(buttonState9 == LOW) { 2218 tone(0, NOTE_F7);} 2219 else if(buttonState10 == LOW) { 2220 tone(0, NOTE_FS7);} 2221 else if(buttonState11 == LOW) { 2222 tone(0, NOTE_G7);} 2223 else if(buttonState12 == LOW) { 2224 tone(0, NOTE_GS7);} 2225 else if(buttonState13 == LOW) { 2226 tone(0, NOTE_A7);} 2227 else { 2228 noTone(0); } 2229 } 2230 else if (dip1state == HIGH // 3B in HEX; AS6 2231 && dip2state == HIGH 2232 && dip3state == LOW 2233 && dip4state == HIGH 2234 && dip5state == HIGH 2235 && dip6state == HIGH) 2236 { if (buttonState1 == LOW) { 2237 tone(0, NOTE_AS6);} 2238 else if (buttonState2 == LOW) { 2239 tone(0, NOTE_B6);} 2240 else if(buttonState3 == LOW) { 2241 tone(0, NOTE_C7);} 2242 else if(buttonState4 == LOW) { 2243 tone(0, NOTE_CS7);} 2244 else if(buttonState5 == LOW) { 2245 tone(0, NOTE_D7);} 2246 else if(buttonState6 == LOW) { 2247 tone(0, NOTE_DS7);} 2248 else if(buttonState7 == LOW) { 2249 tone(0, NOTE_E7);} 2250 else if(buttonState8 == LOW) { 2251 tone(0, NOTE_F7);} 2252 else if(buttonState9 == LOW) { 2253 tone(0, NOTE_FS7);} 2254 else if(buttonState10 == LOW) { 2255 tone(0, NOTE_G7);} 2256 else if(buttonState11 == LOW) { 2257 tone(0, NOTE_GS7);} 2258 else if(buttonState12 == LOW) { 2259 tone(0, NOTE_A7);} 2260 else if(buttonState13 == LOW) { 2261 tone(0, NOTE_AS7);} 2262 else { 2263 noTone(0); } 2264 } 2265 else if (dip1state == LOW // 3C in HEX; B6 2266 && dip2state == LOW 2267 && dip3state == HIGH 2268 && dip4state == HIGH 2269 && dip5state == HIGH 2270 && dip6state == HIGH) 2271 { if (buttonState1 == LOW) { 2272 tone(0, NOTE_B6);} 2273 else if (buttonState2 == LOW) { 2274 tone(0, NOTE_C7);} 2275 else if(buttonState3 == LOW) { 2276 tone(0, NOTE_CS7);} 2277 else if(buttonState4 == LOW) { 2278 tone(0, NOTE_D7);} 2279 else if(buttonState5 == LOW) { 2280 tone(0, NOTE_DS7);} 2281 else if(buttonState6 == LOW) { 2282 tone(0, NOTE_E7);} 2283 else if(buttonState7 == LOW) { 2284 tone(0, NOTE_F7);} 2285 else if(buttonState8 == LOW) { 2286 tone(0, NOTE_FS7);} 2287 else if(buttonState9 == LOW) { 2288 tone(0, NOTE_G7);} 2289 else if(buttonState10 == LOW) { 2290 tone(0, NOTE_GS7);} 2291 else if(buttonState11 == LOW) { 2292 tone(0, NOTE_A7);} 2293 else if(buttonState12 == LOW) { 2294 tone(0, NOTE_AS7);} 2295 else if(buttonState13 == LOW) { 2296 tone(0, NOTE_B7);} 2297 else { 2298 noTone(0); } 2299 } 2300 2301 2302 2303 2304 2305 2306else { 2307//turn off sound 2308noTone(0); 2309} 2310} 2311
Downloadable files
Truth Table
Truth Table
Pushbutton Schematic
Pushbutton Schematic
Truth Table
Truth Table
Powerpoint Presentation of Pushbutton Piano
Powerpoint Presentation of Pushbutton Piano
Pushbutton Schematic
Pushbutton Schematic
Comments
Only logged in users can leave comments
fillu08
0 Followers
•0 Projects
Table of contents
Intro
3
0