-
Notifications
You must be signed in to change notification settings - Fork 53
/
part13a2.html
43 lines (29 loc) · 881 Bytes
/
part13a2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<title>Creative Coding Yea!</title>
<head>
<meta charset="utf-8">
<script language="javascript" src="js/creative_coding.js"></script>
<script language="javascript" src="js/canvas.js"></script>
<script language="javascript" src="js/mic.js"></script>
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
</head>
<body>
<script>
var ctx = createCanvas("canvas1");
function draw(){
if (chance(20)) ctx.background(235);
var s = Mic.getBassVol(10, 255);
ctx.fillStyle = rgb(s);
ctx.HfillEllipse(w/4, h/2, s, s);
var s = Mic.getMidsVol(10, 255);
ctx.fillStyle = rgb(s);
ctx.HfillEllipse(w/2, h/2, s, s);
var s = Mic.getHighsVol(10, 255);
ctx.fillStyle = rgb(s);
ctx.HfillEllipse(w - w/4, h/2, s, s);
}
</script>
</body>
</html>