-
Notifications
You must be signed in to change notification settings - Fork 1
/
metro.html
117 lines (93 loc) · 3.24 KB
/
metro.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>metro</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/uboot.css">
<link rel="stylesheet" href="css/gh-fork-ribbon.css">
<script src="js/bluescreen.js"></script>
<script src="js/uboot.js"></script>
<script src="js/JZZ.js"></script>
<script src="js/JZZ.input.Kbd.js"></script>
<script src="js/JZZ.gui.Select.js"></script>
<script src="js/wavy-jones.js"></script>
<script src="js/heartbeat.js"></script>
<style>
body {
font-family: "Lucida Console", monospace;
background-color: plum;
}
.ub-box {
background-color: lightyellow;
}
a { color: black; text-decoration-style: dashed; text-decoration-thickness: 1px; }
#scope {
padding: 0;
width: 100%;
height: 80px;
background-color: #000;
}
#recording_download {
color: black;
text-decoration-style: dashed;
}
</style>
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/severak/cyber-music-studio" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
<div class="ub-container">
<div class="ub-box" id="box_welcome">
<img src="img/preview.png" class="ub-fit-img">
<p>This is part of beta version of Cyber Music Studio™. It's not finished yet and can be broken at any moment.</p>
<p>Feel free to test it and report bugs <a href="https://github.com/severak/cyber-music-studio/issues" target="_blank">here</a>.</p>
<center><button id="power" class="ub-button"><big>OK</big></button></center>
</div>
<br><br>
<form class="ub-form ub-hidden ub-box" id="form">
<h1>metro</h1>
<input type="number" min="30" max="180" value="120" id="bpm"> BMP /
<input type="number" min="30" max="180" value="4" id="div">
<br>
<button id="start">start</button>
<button id="stop">stop</button>
<p>part of <a href="index.html">Cyber Music Studio™</a></p>
</form>
</div>
<script>
ub.on("power","click", function(ev){
ub.stop(ev);
ub.addClass("box_welcome", 'ub-hidden');
ub.delClass("form", 'ub-hidden');
ub.gebi('form').reset();
hb.start();
var noise = hb.makeNoiseOsc();
var amp = hb.makeGain(0);
hb.chain(noise, amp, hb.ac.destination);
var tik = function() {
hb.adsrStart(amp.gain, {
attack: 0.01,
decay: 0.1,
sustain: 0,
max: 0.2
});
};
metro = hb.makeMetronome(tik);
ub.on('start', 'click', function (ev) {
ub.stop(ev);
metro.start();
});
ub.on('stop', 'click', function (ev) {
ub.stop(ev);
metro.stop();
});
function setBpm() {
metro.setBpm(ub.gebi('bpm').value, ub.gebi('div').value);
}
ub.on('bpm', 'change', setBpm);
ub.on('div', 'change', setBpm);
});
</script>
<script src="//million.svita.cz/millions_v1.js"></script>
</body>
</html>