-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathindex.html
More file actions
361 lines (359 loc) · 19 KB
/
Copy pathindex.html
File metadata and controls
361 lines (359 loc) · 19 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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!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=2025121200">
<link rel="modulepreload" href="./build/audio-processor.mjs?version=2025121200">
<script type="module" async src="./build/index.js?version=2025121200"></script>
<script src="./build/theme.js?version=2025121200"></script>
</head>
<body>
<main id="content">
<section id="container-fixed">
<div id="editor-container" aria-label="Code editor">
<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">
<span id="control-lag" class="control-text" title="Computing lag (freezes) factor">---</span>
</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.">1/32</div>
<button id="control-scaleup" class="control-button" title="Zoom out the scope">
<svg><use xlink:href="#symbol-scaleup"></use></svg>
</button>
</div>
<div class="controls-group">
<select id="control-drawmode" class="control-select controls-grow" title="Drawing mode">
<option value="Points">Points</option>
<option value="Waveform">Waveform</option>
<option value="Diagram">Diagram</option>
<option value="Combined" selected>Combined</option>
<option value="FFT">FFT</option>
</select>
</div>
<div class="controls-group">
<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>
<div class="controls-group controls-grow">
<input type="text" id="control-samplerate" class="control-text" value="8000" title="Set the sample rate (in Hz) then press Enter">
<select id="control-samplerate-select" class="control-select" title="Select the sample rate (in Hz)">
<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>
<span id="control-srdivisor" class="control-text" title="Sample rate divisor">1</span>
<div id="control-srdivisor-buttons">
<button id="control-srdivisor-up" class="control-button" title="Increase the sample rate divisor">^</button>
<button id="control-srdivisor-down" class="control-button" title="Decrease the sample rate divisor">^</button>
</div>
</div>
<div class="controls-group">
<button id="control-link" class="control-button" title="Copy the song link">
<svg><use xlink:href="#symbol-link"></use></svg>
</button>
<button id="control-rec" class="control-button" title="Record to the file">
<svg><use xlink:href="#symbol-rec"></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>
<pre id="error"></pre>
<div id="canvas-container" title="Click to play">
<canvas id="canvas-main" width="1024" height="256" aria-label="Oscillioscope"></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">
<section>
<p>Bytebeat music was invented in September 2011.</p>
<p>
Classic simple bytebeats are generally a piece of rhythmic and somewhat melodic music with no score, no instruments, and no real oscillators.
It's simply an expression 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 expression 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.
</p>
<p>Initially, expressions were typically written in C or were C-compatible, written in JavaScript. But bytebeat music has evolved over the years, and modern songs with complex JavaScript code are now popular. You'll find examples in the library on this site.</p>
</section>
<section>
<p><a href="http://canonical.org/~kragen/bytebeat/" target="_blank">History of bytebeat</a></p>
<p>
Original blog posts and videos from Viznut:
<ul>
<li><a href="http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html" target="_blank">Blog posts #1</a></li>
<li><a href="http://countercomplex.blogspot.com.au/search/label/algorithmic%20music" target="_blank">Blog posts #2</a></li>
<li><a href="https://www.youtube.com/watch?v=GtQdIYUtAHg" target="_blank">YouTube video #1</a></li>
<li><a href="https://www.youtube.com/watch?v=qlrs2Vorw2Y" target="_blank">YouTube video #2</a></li>
<li><a href="https://www.youtube.com/watch?v=tCRPUv8V22o" target="_blank">YouTube video #3</a></li>
<ul>
</p>
</section>
<section>
<p>This website is a live editing bytebeats player, it has a collection of bytebeat music. Online JavaScript players:</p>
<ul>
<li><a href="https://wurstcaptures.untergrund.net/music/" target="_blank">by Bemmu and Rarefluid</a> — this is one of the first players.</li>
<li><a href="http://entropedia.co.uk/generative_music/" target="_blank">by Paul Hayes</a> — also is one of the first. Dollchan Player is a very deeply modified fork of it.</li>
<li><a href="https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html" target="_blank">by Greggman</a> — a source of inspiration for creating Dollchan Player, but in turn, Greggman took the songs library from here.</li>
<li><a href="https://bytebeat.ficial.net/" target="_blank">by SArpnt</a> — a fork of Dollchan Player, but in turn Dollchan took many technologies and ideas from SArpnt.</li>
</ul>
</section>
<section>
<p>Playback modes are:</p>
<ul>
<li><b>Bytebeat</b> — output is an unsigned 8bit integer from 0 to 255, values outside this are wrapped, and non-integers are floored.</li>
<li><b>Signed Bytebeat</b> — output is a signed 8bit integer from -127 to 128, values outside this are wrapped, and non-integers are floored.</li>
<li><b>Floatbeat</b> — output is -1.0 to 1.0. Allows higher quality audio since it is not limited to 255 values, unlike the previous ones.</li>
<li><b>Funcbeat</b> — the code is run only once and is not an expression, it expects the function to return. The returned function is ran with time in seconds, output is -1.0 to 1.0.
</ul>
</section>
<section>
<p>This project is made by SthephanShi, and is a fork of <a href="http://entropedia.co.uk/generative_music/" target="_blank">8-bit Generative Composer by Paul Hayes</a>.</p>
</section>
</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>Recent</h1> – recently added, sorted by authors
<svg class="loading-wait hidden"><use xlink:href="#symbol-wait"></use></svg>
</summary>
<div id="library-recent" 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 Dark" selected>Default Dark</option>
<option value="Blue Dark">Blue Dark</option>
<option value="Cake Dark">Cake Dark</option>
<option value="Dusk Dark">Dusk Dark</option>
<option value="Green Dark">Green Dark</option>
<option value="Orange Dark">Orange Dark</option>
<option value="Purple Dark">Purple Dark</option>
<option value="Teal Dark">Teal Dark</option>
<option disabled>──────────</option>
<option value="Default Light">Default Light</option>
<option value="Blue Light">Blue Light</option>
<option value="Green Light">Green Light</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="Github Dark">Github Dark</option>
<option value="Github v2 Dark">Github v2 Dark</option>
<option value="Monokai">Monokai</option>
<option value="One Dark">One Dark</option>
<option value="Retro Green">Retro Green</option>
<option value="VSCode Dark">VSCode Dark</option>
<option disabled>──────────</option>
<option value="Atom Light">Atom Light</option>
<option value="Github Light">Github Light</option>
<option value="Github v2 Light">Github v2 Light</option>
<option value="One Light">One Light</option>
<option value="VSCode Light">VSCode Light</option>
</select>
Code highlight 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>