comparison 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
comparison
equal deleted inserted replaced
4:e1e53574e68d 5:9070b2a7ca65
1 //var socket = io.connect();
2
3 //socket.on("metroPulse", metronomeTick);
4
5 function metroCss(beat, beatcolor,text){
6 var color = beatcolor;
7
8 $(".metrocase > div").each(function(){$(this).stop()});
9 $(".metrocase > div").each(function(){$(this).css('background-color', beatcolor)});
10 $(".metrocase > div").each(function(){$(this).text(" ")});
11 $(".metrocase > div").each(function(){$(this).animate({opacity: 0.5},
12 50,
13 function() { $(this).animate({opacity:0.0}); }
14 );
15 })
16 }
17
18
19
20 function metronomeTick(pulse, voice,metrobeat) {
21 console.log( voice+ " metronome tick" + metrobeat)
22 var color = "gray"
23
24 metroCss(0, "red", "4")
25
26 //if (metrobeat == 0) {
27 // metroCss(0, "gray", "1")
28 // }
29
30 //if (metrobeat == 3) {
31 // metroCss(0, "white", "4")
32 // }
33
34 // if (metrobeat == 1||metrobeat == 2){
35 // $("#metronome"+metrobeat).stop();
36 // $("#metronome"+metrobeat).css('background-color', color);
37 // $("#metronome"+metrobeat).text(" ");
38 //$("#metronome"+metrobeat).text(metrobeat+1);
39 // $("#metronome"+metrobeat).animate({opacity: 1},
40 // 50,
41 // function() { $(this).animate({opacity:0.0}); }
42 // );
43 // }
44 };