-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (77 loc) · 3.3 KB
/
index.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<title>AutoMusex - Nimja</title>
</head>
<body>
<div>
<h3>AutoMusex</h3>
<div>
<button id="toy-play" class="btn btn-default">Play/pause</button>
<button id="toy-step" class="btn btn-default">Step</button>
<button id="toy-clear" class="btn btn-default">Clear</button>
<button id="toy-store" class="btn btn-default">Store</button>
<button id="toy-restore" class="btn btn-default">Restore</button>
</div>
<br />
<div class="toy-settings">
<div>
<label><input type="radio" name="toy-field" value="0"> Hexagon</label>
<label><input type="radio" name="toy-field" value="1"> Square</label>
<label><input type="radio" name="toy-field" value="2"> Octagon</label>
</div>
<div>
<label for="toy-size">Size</label>
<input type="range" min="3" max="6" value="4" id="toy-size">
</div>
<div>
<label for="toy-bpm">BPM</label>
<input type="range" min="90" max="480" step="10" value="200" id="toy-bpm">
</div>
<div>
<label for="toy-note-length">Note length</label>
<input type="range" min="1" max="10" value="4" id="toy-note-length">
</div>
<div>
<label for="toy-note-type">Note type</label>
<input type="range" min="1" max="6" value="1" id="toy-note-type">
</div>
<div>
<label for="toy-note-key">Note key</label>
<input type="range" min="0" max="11" value="0" id="toy-note-key">
</div>
</div>
<canvas style="width: 100%; height: auto; max-width: 600px;" id="toy-canvas"></canvas>
<div>
<h3>How does it work?</h3>
<p>Tap/click to set add/change/remove arrow in a cell.</p>
<p>Play does automatic steps according to BPM.</p>
<p>You can share the url with your current 'song'. Changing size will randomize the field.</p>
<p>Advanced: Hold an arrow key or del/backspace while clicking.</p>
<h3>The rules</h3>
<ul>
<li>A filled cell will move in the direction it points.</li>
<li>Edge: Bounce off</li>
<li>Collision: If it lands in a cell with another arrow, they both turn clockwise.</li>
<li>Edge + Collision: Turn around.</li>
</ul>
<p>This was inspired by <a href="http://earslap.com/page/otomata.html">Otomata</a> - Completely re-done, hex
grid and with web-audio that is generated on the fly!</p>
</div>
</div>
<!-- Load all the classes -->
<script src="js/manager.js"></script>
<script src="js/encoder.js"></script>
<script src="js/audio.js"></script>
<script src="js/canvas_drawer.js"></script>
<script src="js/machine_square.js"></script>
<script src="js/renderer_square.js"></script>
<script src="js/machine_hex.js"></script>
<script src="js/renderer_hex.js"></script>
<script src="js/machine_oct.js"></script>
<script src="js/renderer_oct.js"></script>
<script>
// And let's go!
new CellManager();
</script>
</body>
</html>