
// include the library code:
#include <LiquidCrystal.h>
#include "pitches.h"
#include <Keypad.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {38, 40, 42, 44}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {46, 48, 50, 52}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 


int melody[] = {NOTE_A5};
int duration = 100;  // 100 miliseconds
 

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  
  lcd.print("Pitch Set 1"); //Top Row 
 Serial.begin(9600);
}

void loop() {
  lcd.setCursor(0, 1); //Botom Row
  lcd.print("EDM");
   
char customKey = customKeypad.getKey();
  

 if (customKey=='1') {tone(31, NOTE_DS8, duration); delay(125); tone(31, NOTE_DS8, duration); delay(125); tone(31, NOTE_DS8, duration);}
 if (customKey=='2') {tone(31, NOTE_D8, duration);} 
 if (customKey=='3') {tone(31, NOTE_CS8, duration);}
 if (customKey=='4') {tone(31, NOTE_C8, duration);}
 if (customKey=='5') {tone(31, NOTE_B7, duration);} 
 if (customKey=='6') {tone(31, NOTE_AS7, duration);}
 if (customKey=='7') {tone(31, NOTE_A7, duration);}
 if (customKey=='8') {tone(31, NOTE_GS7, duration);}
 if (customKey=='9') {tone(31, NOTE_G7, duration);}
 if (customKey=='0') {tone(31, NOTE_CS1, duration); delay(125); tone(31, NOTE_, duration);}

}

