Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(args){
  2.     return function(){
  3.         if (soundNumber != 0) return;
  4.         for(var i in args) {
  5.             if (args[0].buttonToggle == true){
  6.                 console.log(args[2]);
  7.                 args[1].currentTime = 0;
  8.                 args[1].play();
  9.             }
  10.         }
  11.     }
  12. })([[buttonC_1, soundC, "c note"]
  13.   , [buttonD_1, soundD, "d note"]
  14.   , [buttonF_1, soundF, "f note"]
  15.   , [buttonG_1, soundG, "g note"]
  16.   , [buttonA_1, soundA, "a note"]]);
  17.  
  18. /*    function playNote1(){
  19.       if (soundNumber == 0){
  20.         if (buttonC_1.buttonToggle == true){
  21.         console.log("c note");
  22.         soundC.currentTime = 0;
  23.         soundC.play();
  24.         }
  25.         if (buttonD_1.buttonToggle == true){
  26.         console.log("d note");
  27.         soundD.currentTime = 0;
  28.         soundD.play();
  29.         }
  30.         if (buttonF_1.buttonToggle == true){
  31.         console.log("f note");
  32.         soundF.currentTime = 0;
  33.         soundF.play();
  34.         }
  35.         if (buttonG_1.buttonToggle == true){
  36.         console.log("g note");
  37.         soundG.currentTime = 0;
  38.         soundG.play();
  39.         }
  40.         if (buttonA_1.buttonToggle == true){
  41.         console.log("a note");
  42.         soundA.currentTime = 0;
  43.         soundA.play();
  44.         }
  45.       }
  46.     }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement