-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
301 lines (299 loc) · 15.4 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Bytebeat player with a collection of many formulas from around the internet">
<meta name="author" content="SthephanShi">
<title>Bytebeat composer</title>
<link rel="canonical" href="https://dollchan.net/bytebeat/">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" type="text/css" href="style.css?version=2024122300">
<link rel="modulepreload" href="./build/audio-processor.mjs?version=2024122300">
<script type="module" async src="./build/index.js?version=2024122300"></script>
</head>
<body>
<main id="content">
<section id="container-fixed">
<div id="editor-container">
<div id="editor-default">
<svg><use xlink:href="#symbol-wait"></svg>
</div>
</div>
<div class="controls">
<div class="controls-group controls-grow">
<button id="control-counter-units" class="control-button" title="Time units">t</button>
<input type="text" id="control-counter" class="control-text" value="0" title="Set time to jump along the timeline then press Enter">
</div>
<div class="controls-group">
<button id="control-stop" class="control-button" title="Stop and reset">
<svg><use xlink:href="#symbol-stop"></use></svg>
</button>
<button id="control-reset" class="control-button" title="Reset time to 0">
<svg><use xlink:href="#symbol-reset"></use></svg>
</button>
</div>
<div class="controls-group">
<button id="control-play-backward" class="control-button control-play" title="Play reverse">
<span class="control-fast-multiplier">1</span>
<svg class="svg-fast"><use xlink:href="#symbol-fast"></use></svg>
<svg class="svg-play"><use xlink:href="#symbol-play"></use></svg>
</button>
<button id="control-pause" class="control-button" title="Pause">
<svg><use xlink:href="#symbol-pause"></use></svg>
</button>
<button id="control-play-forward" class="control-button control-play" title="Play forward">
<span class="control-fast-multiplier">1</span>
<svg class="svg-fast"><use xlink:href="#symbol-fast"></use></svg>
<svg class="svg-play"><use xlink:href="#symbol-play"></use></svg>
</button>
</div>
<div class="controls-group">
<button id="control-scaledown" class="control-button" title="Zoom in the scope">
<svg><use xlink:href="#symbol-scaledown"></use></svg>
</button>
<div id="control-scale" class="control-button" title="Scope zoom factor. Click to reset."></div>
<button id="control-scaleup" class="control-button" title="Zoom out the scope">
<svg><use xlink:href="#symbol-scaleup"></use></svg>
</button>
</div>
<select id="control-drawmode" class="control-select controls-grow" title="Drawing mode">
<option value="Points" selected>Points</option>
<option value="Waveform">Waveform</option>
<option value="Diagram">Diagram</option>
<option value="Combined">Combined</option>
</select>
<select id="control-mode" class="control-select controls-grow" title="Sound mode">
<option value="Bytebeat" selected>Bytebeat</option>
<option value="Signed Bytebeat">Signed Bytebeat</option>
<option value="Floatbeat">Floatbeat</option>
<option value="Funcbeat">Funcbeat</option>
</select>
<div class="controls-group controls-grow">
<input type="text" id="control-samplerate" class="control-text" title="Set sample rate (in Hz) then press Enter">
<select id="control-samplerate-select" class="control-select" title="Sample rate">
<option value="8000">8000Hz</option>
<option value="11025">11025Hz</option>
<option value="16000">16000Hz</option>
<option value="22050">22050Hz</option>
<option value="32000">32000Hz</option>
<option value="44100">44100Hz</option>
<option value="48000">48000Hz</option>
</select>
</div>
<div class="controls-group">
<button id="control-rec" class="control-button" title="Record to the file">
<svg><use xlink:href="#symbol-rec"></use></svg>
</button>
<button id="control-link" class="control-button" title="Copy the song link">
<svg><use xlink:href="#symbol-link"></use></svg>
</button>
<button id="control-expand" class="control-button" title="Expand the code editor">
<svg><use xlink:href="#symbol-expand"></use></svg>
</button>
<span id="control-codesize" class="control-text" title="Code size in bytes"></span>
</div>
<div class="controls-group controls-grow">
<input id="control-volume" type="range" min="0" max="1" value=".5" step="any" title="Volume">
</div>
</div>
<div id="error"></div>
<div id="canvas-container" title="Click to play">
<canvas id="canvas-main" width="1024" height="256"></canvas>
<div id="canvas-timecursor"></div>
<div id="canvas-play" class="canvas-initial canvas-play">
<svg id="svg-canvas-play"><use xlink:href="#symbol-play"></use></svg>
<svg id="svg-canvas-pause"><use xlink:href="#symbol-pause"></use></svg>
</div>
</div>
</section>
<section id="container-scroll">
<details class="library-content">
<summary class="library-header">
<h1>Info</h1> – about bytebeat
</summary>
<article id="info" class="library-container entry loaded">
Bytebeat music (or one-liner music) was invented in September 2011.
They're generally a piece of rhythmic and somewhat melodic music with no score, no instruments, and no real oscillators.
It's simply a single-line formula that defines a waveform as a function of time, processed (usually) 8000 times per second, resulting in an audible waveform with a 256-step resolution from silence (0) to full amplitude (256).
If you put that formula into a program with a loop that increments time variable (t), you can generate the headerless unsigned 8 bit mono 8kHz audio stream on output, like in this application.
Since these directly output a waveform, they have great performance in compiled languages and can often be ran on even the weakest embedded devices.<br>
<a href="http://canonical.org/~kragen/bytebeat/" target="_blank">History of bytebeat</a><br>
<br>
Original blog posts and videos from Viznut:<br>
<a href="http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html" target="_blank">Blog posts #1</a><br>
<a href="http://countercomplex.blogspot.com.au/search/label/algorithmic%20music" target="_blank">Blog posts #2</a><br>
<a href="https://www.youtube.com/watch?v=GtQdIYUtAHg" target="_blank">YouTube video #1</a><br>
<a href="https://www.youtube.com/watch?v=qlrs2Vorw2Y" target="_blank">YouTube video #2</a><br>
<a href="https://www.youtube.com/watch?v=tCRPUv8V22o" target="_blank">YouTube video #3</a><br>
<br>
This website is a live editing bytebeats player. It has a collection of bytebeat music I found on the internet, and also the music I created.<br>
You can choose between bytebeat, signed bytebeat and floatbeat formats. Bytebeat expects output is an unsigned 8bit value (0 to 255). Signed bytebeat assumes output is a signed 8bit value (-127 to 128). Floatbeat assumes output is -1.0 to 1.0.<br>
<br>
This website is the fork of <a href="http://entropedia.co.uk/generative_music/" target="_blank">8-bit Generative Composer</a> by <a href="http://twitter.com/paul_hayes/" target="_blank">@paul_hayes</a>.<br>
Forked by SthephanShi aka Viraya.
</article>
</details>
<details class="library-content">
<summary class="library-header">
<h1>Classic</h1> – C-compatible Bytebeat, one variable (t)
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-classic" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>JS-256</h1> – JS Bytebeat code under 256 bytes
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-js-256" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>JS-1k</h1> – JS Bytebeat code under 1 KB
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-js-1k" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>JS-big</h1> – JS Bytebeat code larger than 1 KB
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-js-big" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>Floatbeat</h1> – assumes output is -1 to 1
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-floatbeat" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>Floatbeat-big</h1> – Floatbeat code larger than 1 KB
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-floatbeat-big" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>Funcbeat</h1> – statement based mode
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></svg>
</summary>
<div id="library-funcbeat" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>All</h1> – all songs sorted by authors
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></use></svg>
</summary>
<div id="library-all" class="library-container"></div>
</details>
<details class="library-content">
<summary class="library-header">
<h1>Settings</h1>
</summary>
<article id="settings" class="library-container entry loaded">
<label class="settings-block">
<select id="control-theme-style" class="control-select" title="Player theme style">
<option value="Default" selected>Default</option>
<option value="Blue">Blue</option>
<option value="Cake">Cake</option>
<option value="Dusk">Dusk</option>
<option value="Green">Green</option>
<option value="Orange">Orange</option>
<option value="Purple">Purple</option>
<option value="Teal">Teal</option>
</select>
Theme style
</label>
<label class="settings-block">
<select id="control-code-style" class="control-select" title="Code highlight style">
<option value="Atom Dark" selected>Atom Dark</option>
<option value="One Dark">One Dark</option>
<option value="SArpnt">SArpnt</option>
</select>
Code style
</label>
<label class="settings-block">
<input type="color" id="control-color-timecursor" class="control-color" title="Click to pick the time cursor color">
Time cursor color in the scope
</label>
<label class="settings-block">
<input type="color" id="control-color-waveform" class="control-color" title="Click to pick the Waveform color">
Waveform color in the scope.
<span id="control-color-waveform-info"></span>
</label>
<label class="settings-block">
<input type="color" id="control-color-diagram" class="control-color" title="Click to pick the Diagram color">
Diagram color in the scope.
<span id="control-color-diagram-info"></span>
</label>
<label class="settings-block">
<select id="control-color-stereo" class="control-select" title="Color channels for waveform and diagram">
<option value="0">Left=R, Right=G+B</option>
<option value="1" selected>Left=G, Right=R+B</option>
<option value="2">Left=B, Right=R+G</option>
</select>
Colors for stereo channels
</label>
<label class="settings-block">
<a href="bytebeat.php?manage">Manage library</a>
</label>
</article>
</details>
<footer>
<a class="link" href="/btb/" title="Bytebeat discussion threads" target="_blank">Discussion board</a><br>
<a class="link" href="https://github.com/SthephanShinkufag/bytebeat-composer" title="Github repo" target="_blank">Source code</a>
</footer>
</section>
</main>
<!-- SVG BUTTONS -->
<div id="svg-icons" style="height: 0; width: 0; overflow: hidden;">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<symbol viewBox="0 0 32 32" id="symbol-play">
<path d="m23 14.3-9-5.2c-1.3-.8-3 .2-3 1.7v10.4c0 1.5 1.7 2.5 3 1.7l9-5.2c1.3-.7 1.3-2.7 0-3.4z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-fast">
<path d="M17.3 11.7v8.6c0 1.7 2 2.6 3.3 1.5l5.3-4.3c1-.8 1-2.3 0-3.1l-5.3-4.3c-1.3-1-3.3-.1-3.3 1.6" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-pause">
<path d="M12.5 23c-1.1 0-2-.9-2-2V11c0-1.1.9-2 2-2s2 .9 2 2v10c0 1.1-.9 2-2 2zm7 0c-1.1 0-2-.9-2-2V11c0-1.1.9-2 2-2s2 .9 2 2v10c0 1.1-.9 2-2 2z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-stop">
<path d="M20.3 22.3h-8.5c-1.1 0-2-.9-2-2v-8.5c0-1.1.9-2 2-2h8.5c1.1 0 2 .9 2 2v8.5c0 1.1-.9 2-2 2z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-reset">
<path d="M11.8 22.3c-1.1 0-2-.9-2-2v-8.5c0-1.1.9-2 2-2s2 .9 2 2v8.5c0 1.1-.9 2-2 2zm10.5-10.6v8.6c0 1.7-2 2.6-3.3 1.6l-5.3-4.3c-1-.8-1-2.3 0-3.1l5.3-4.3c1.3-1.1 3.3-.2 3.3 1.5z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-rec">
<circle cx="16" cy="16" r="6.3" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-scaledown">
<path d="M16.5 24h-1c-1.1 0-2-.9-2-2V10c0-1.1.9-2 2-2h1c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2zM8 16.5v-1c0-1.1.9-2 2-2h12c1.1 0 2 .9 2 2v1c0 1.1-.9 2-2 2H10c-1.1 0-2-.9-2-2z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-scaleup">
<path d="M8 16.5v-1c0-1.1.9-2 2-2h12c1.1 0 2 .9 2 2v1c0 1.1-.9 2-2 2H10c-1.1 0-2-.9-2-2z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-link">
<path d="M17 22.5H8c-1.7 0-3-1.3-3-3v-4c0-1.7 1.3-3 3-3h2v3H9c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h7c.6 0 1-.4 1-1V15h3v4.5c0 1.7-1.3 3-3 3zm7-3h-2v-3h1c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-7c-.6 0-1 .4-1 1V17h-3v-4.5c0-1.7 1.3-3 3-3h9c1.7 0 3 1.3 3 3v4c0 1.7-1.3 3-3 3z" />
</symbol>
<symbol viewBox="0 0 32 32" id="symbol-expand">
<path d="M10.5 7.5H13c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5h-2.5V13c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5v-2.5c0-1.7 1.3-3 3-3zm11 17H19c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5h2.5V19c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5v2.5c0 1.7-1.3 3-3 3zm3-14V13c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5v-2.5H19c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5h2.5c1.7 0 3 1.3 3 3zm-17 11V19c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5v2.5H13c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5h-2.5c-1.7 0-3-1.3-3-3z" />
</symbol>
<symbol viewBox="0 0 16 16" id="symbol-wait">
<circle fill="#929087" cx="8" cy="2" r="2" />
<circle fill="#C5C2BA" cx="8" cy="14" r="2" />
<circle fill="#ACAAA0" cx="2" cy="8" r="2" />
<circle fill="#79766C" cx="14" cy="8" r="2" />
<circle fill="#D2CFC6" cx="12.25" cy="12.25" r="2" />
<circle fill="#9F9C93" cx="3.75" cy="3.75" r="2" />
<circle fill="#B9B6AE" cx="3.75" cy="12.25" r="2" />
<circle fill="#868379" cx="12.25" cy="3.75" r="2" />
</symbol>
</svg>
</div>
<a id="downloader" class="hidden"></a>
</body>
</html>