

function playTone(pitch, instrument) {
  
    var tone = new Audio();
    
   
    var path = "../../data/instruments/";
    
   
    switch (instrument) {
        case "a_guitar":
            path += "guitar/acoustic/";
            break;
        case "e_guitar":
            path += "guitar/electric/";
            break;
        default:
            path += instrument + "/";
    }
    
  
    tone.src = path+pitch+".ogg";
    
    
    tone.play();
    
  
    tone.addEventListener("ended", function() { 
        document.getElementById("ledValue").innerHTML = " "; 
    }, true);
    
}