/* 
 * Title: guitar tuner web edition 
 * Author: Liam Howard
 * Date:
 * Purpose:
 */// 

 
        
        
        
        
const buttonE = document.getElementById("btnE"); 
const buttonA = document.getElementById("btnA");
const buttonD = document.getElementById("btnD");
const buttonG = document.getElementById("btnG"); 
const buttonB = document.getElementById("btnB");      //initialize button variables. they get value from each respective button's ID
const buttonLittle = document.getElementById("btnLittle");

const stopPlay = document.getElementById("stop");

const noteE = new Audio("noteE.wav");    
const noteA = new Audio("noteA.wav");
const noteD = new Audio("noteD.wav");
const noteG = new Audio("noteG.wav");
const noteB = new Audio("noteB.wav");
const noteLittle = new Audio("noteLittle.wav");
     
  buttonE.onclick = () => {
 
    

    
    noteA.loop = false;
    noteD.loop = false;
    noteG.loop = false;
    noteB.loop = false;
    noteLittle.loop = false;
    
    noteE.currentTime = 0;
    noteE.play();
    noteE.loop = true;
};

 buttonA.onclick = () => {
     
    

   
    noteE.pause();
    noteD.pause();
    noteG.pause();
    noteB.pause();
    noteLittle.pause();
    
    noteA.currentTime = 0;
    noteA.play();
    noteA.loop = true;
};
  buttonD.onclick = () => {
 
   

    
    noteE.pause();
    noteA.pause();
    noteG.pause();
    noteB.pause();
    noteLittle.pause();
    
    noteD.currentTime = 0;
    noteD.play();
    noteD.loop = true;

};

 buttonG.onclick = () => {
 
    

    
    noteE.pause();
    noteD.pause();
    noteA.pause();
    noteB.pause();
    noteLittle.pause();
    
    noteG.currentTime = 0;
    noteG.play();
    noteG.loop = true;

};
  buttonB.onclick = () => {
 
    

    
    noteE.pause();
    noteD.pause();
    noteG.pause();
    noteA.pause();
    noteLittle.pause();
    noteE.currentTime = 0;
   
    noteB.currentTime = 0;
    noteB.play();
    noteB.loop = true;

};

 buttonLittle.onclick = () => {
 
  

   
    noteE.pause();
    noteD.pause();
    noteG.pause();
    noteB.pause();
    noteA.pause();
     
    noteLittle.currentTime = 0;
    noteLittle.play();
    noteLittle.loop = true;

};
stopPlay.onclick = () => {
 
  

   
    noteE.pause();
    noteD.pause();
    noteG.pause();
    noteB.pause();
    noteA.pause();
    noteLittle.pause();
 
};



    



    
