annotate www/m/js/metronome.js @ 5:9070b2a7ca65

nodescore magicsquare example web files commited
author tzara <rc-web@kiben.net>
date Wed, 04 Jul 2012 13:10:04 +0000
parents
children 33e6dc370ef7
rev   line source
rc-web@5 1 //var socket = io.connect();
rc-web@5 2
rc-web@5 3 //socket.on("metroPulse", metronomeTick);
rc-web@5 4
rc-web@5 5 function metroCss(beat, beatcolor,text){
rc-web@5 6 var color = beatcolor;
rc-web@5 7
rc-web@5 8 $(".metrocase > div").each(function(){$(this).stop()});
rc-web@5 9 $(".metrocase > div").each(function(){$(this).css('background-color', beatcolor)});
rc-web@5 10 $(".metrocase > div").each(function(){$(this).text(" ")});
rc-web@5 11 $(".metrocase > div").each(function(){$(this).animate({opacity: 0.5},
rc-web@5 12 50,
rc-web@5 13 function() { $(this).animate({opacity:0.0}); }
rc-web@5 14 );
rc-web@5 15 })
rc-web@5 16 }
rc-web@5 17
rc-web@5 18
rc-web@5 19
rc-web@5 20 function metronomeTick(pulse, voice,metrobeat) {
rc-web@5 21 console.log( voice+ " metronome tick" + metrobeat)
rc-web@5 22 var color = "gray"
rc-web@5 23
rc-web@5 24 metroCss(0, "red", "4")
rc-web@5 25
rc-web@5 26 //if (metrobeat == 0) {
rc-web@5 27 // metroCss(0, "gray", "1")
rc-web@5 28 // }
rc-web@5 29
rc-web@5 30 //if (metrobeat == 3) {
rc-web@5 31 // metroCss(0, "white", "4")
rc-web@5 32 // }
rc-web@5 33
rc-web@5 34 // if (metrobeat == 1||metrobeat == 2){
rc-web@5 35 // $("#metronome"+metrobeat).stop();
rc-web@5 36 // $("#metronome"+metrobeat).css('background-color', color);
rc-web@5 37 // $("#metronome"+metrobeat).text(" ");
rc-web@5 38 //$("#metronome"+metrobeat).text(metrobeat+1);
rc-web@5 39 // $("#metronome"+metrobeat).animate({opacity: 1},
rc-web@5 40 // 50,
rc-web@5 41 // function() { $(this).animate({opacity:0.0}); }
rc-web@5 42 // );
rc-web@5 43 // }
rc-web@5 44 };