Edit in JSFiddle

document.getElementById("play").onclick = function(){
  var notes = [
    659.26, //E5
    659.26, //E5
    659.26, //E5
    523.25, //C5
    659.26, //E5
    783.99, //G5
    392.00, //G4
    523.25, //C5
    392.00, //G4
    329.63, //E4
    440.00, //A4
    493.88, //B4
    493.88, //B4
    466.16, //A#4
    440.00, //A4
    392.00, //G4
    659.26, //E5
    783.99, //G5
    880.00, //A5
    698.46, //F5
    783.99, //G5
    659.26, //E5
    523.25, //C5
    587.33, //D5
    493.88, //B4
    523.25, //C5
    392.00, //G4
    329.63, //E4
    440.00, //A4
    493.88, //B4
    493.88, //B4
    466.16, //A#4
    440.00, //A4
    392.00, //G4
    659.26, //E5
    783.99, //G5
    880.00, //A5
    698.46, //F5
    783.99, //G5
    659.26, //E5
    523.25, //C5
    587.33, //D5
    493.88, //B4
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    392.00, //G#4
    440.00, //A4
    523.25, //C5
    440.00, //A4
    523.25, //C5
    587.33, //D5
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    1046.50, //C6
    1046.50, //C6
    1046.50, //C6
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    392.00, //G#4
    440.00, //A4
    523.25, //C5
    440.00, //A4
    523.25, //C5
    587.33, //D5
    622.25, //D#5
    587.33, //D5
    523.25, //C5
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    392.00, //G#4
    440.00, //A4
    523.25, //C5
    440.00, //A4
    523.25, //C5
    587.33, //D5
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    1046.50, //C6
    1046.50, //C6
    1046.50, //C6
    783.99, //G5
    739.99, //F#5
    698.46, //F5
    622.25, //D#5
    659.26, //E5
    392.00, //G#4
    440.00, //A4
    523.25, //C5
    440.00, //A4
    523.25, //C5
    587.33, //D5
    622.25, //D#5
    587.33, //D5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    587.33, //D5
    659.26, //E5
    523.25, //C5
    440.00, //A4
    392.00, //G4
    523.25, //C5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    587.33, //D5
    659.26, //E5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    523.25, //C5
    587.33, //D5
    659.26, //E5
    523.25, //C5
    440.00, //A4
    392.00, //G4
    659.26, //E5
    659.26, //E5
    659.26, //E5
    523.25, //C5
    659.26, //E5
    783.99, //G5
    392.00, //G4
    392.00, //G4
    523.25, //C5
    392.00, //G4
    329.63, //E4
    440.00, //A4
    493.88, //B4
    493.88, //B4
    466.16, //A#4
    440.00, //A4
    392.00, //G4
    659.26, //E5
    783.99, //G5
    880.00, //A5
    698.46, //F5
    783.99, //G5
    659.26, //E5
    523.25, //C5
    587.33, //D5
    493.88, //B4
    523.25, //C5
    392.00, //G4
    523.25, //C5
    440.00, //A4
    493.88, //B4
    493.88, //B4
    466.16, //A#4
    440.00, //A4
    392.00, //G4
    659.26, //E5
    783.99, //G5
    880.00, //A5
    698.46, //F5
    783.99, //G5
    659.26, //E5
    466.16, //A#4
    783.99, //G5
    783.99, //G5
    /*1046.50,
    falta corregir estas dos notas
    1046.50*/
  ];

  var tempo = [
    120,
    180,
    210,
    300,
    200,
    300,
    500,
    700,
    500,
    500,
    150,
    400,
    130,
    130,
    130,
    250,
    200,
    200,
    200,
    200,
    200,
    150,
    200,
    400,
    150,
    250,
    400,
    300,
    500,
    300,
    130,
    130,
    130,
    250,
    200,
    200,
    200,
    200,
    200,
    200,
    150,
    200,
    600,
    120,
    120,
    120,
    120,
    300,
    120,
    120,
    200,
    120,
    120,
    200,
    700,
    120,
    120,
    120,
    300,
    200,
    200,
    200,
    700,
    120,
    120,
    120,
    120,
    150,
    200,
    150,
    700,
    500,
    180,
    180,
    400,
    300,
    500,
    120,
    120,
    120,
    120,
    150,
    200,
    150,
    500,
    300,
    200,
    200,
    120,
    120,
    120,
    200,
    200,
    200,
    500,
    200,
    120,
    120,
    120,
    200,
    200,
    200,
    200,
    150,
    500,
    300,
    150,
    200,
    350,
    700,
    150,
    200,
    300,
    150,
    150,
    200,
    200,
    500,
    180,
    180,
    150,
    150,
    200,
    350,
    700,
    180,
    150,
    150,
    200,
    150,
    150,
    700,
    110,
    170,
    200,
    290,
    190,
    250,
    300,
    700,
    300,
    500,
    300,
    200,
    200,
    150,
    300,
    300,
    300,
    200,
    130,
    500,
    300,
    200,
    200,
    150,
    200,
    200,
    200,
    700,
    500,
    200,
    150,
    300,
    300,
    300,
    200,
    130,
    500,
    300,
    200,
    200,
    150,
    200,
    200,
    200,
  ]

  var AudioContext = window.AudioContext || window.webkitAudioContext;
  var context = new AudioContext;

  var counter = 0;

  function music(){

    var oscillator = context.createOscillator();

    oscillator.connect(context.destination);
    oscillator.frequency.value = notes[counter];
    oscillator.start(0);
    console.log("playing...");

    function stop(){
      oscillator.stop(0);
      oscillator.disconnect();
      console.log("stoping...");
    }

    if(++counter == notes.length){
      stop();
      return;
    }

    window.setTimeout(music, tempo[counter]);
    window.setTimeout(function(){stop();}, 100);
  }
  music();

}
<button id="play" type="button" name="button">PLAY ME!</button>
#play {
    padding: 25px;
    font-weight: 700;
    margin-left: auto;
    margin-right: auto;
    display: block;
    }