forked from elgehelge/Browserbased-Random-Music-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (36 loc) · 1.22 KB
/
Copy pathindex.html
File metadata and controls
44 lines (36 loc) · 1.22 KB
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
44
<html>
<head>
<script src="sylvester.js"></script> <!-- Matrix manipulation -->
<script src="wavepot-runtime.js"></script> <!-- Wavepot runtime -->
<script src="wavepot-composition.js"></script> <!-- Object to represents a piece of music -->
<script src="jquery-1.11.1.min.js"></script>
<link rel="stylesheet" href="bootstrap.min.css">
</head>
<body>
<div class="container-fluid" id="container">
</div>
<script>
var make_new_songs = function() {
var row = $('#container').prepend('<row>');
var compositions = [];
var runtimes = [];
for (var i = 0; i < 5; i++) {
var button = row.append('<button>PLAY</button>');
compositions[i] = new WavepotComposition();
compositions[i].randomize(1);
runtimes[i] = new WavepotRuntime(compositions[i].dsp);
button.mouseover(function() {
runtimes[i].play();
});
button.mouseout(function() {
runtimes[i].stop();
});
button.click(function() {
make_new_songs();
});
}
}
make_new_songs();
</script>
</body>
</html>