-
Notifications
You must be signed in to change notification settings - Fork 85
/
index.html
523 lines (493 loc) · 18.1 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
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<!-- Copyright 2020 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1 />
<meta property="og:title" content="Lo-Fi Player" />
<meta property="og:description" content="Interactive lofi beat player." />
<meta
property="og:image"
content="https://magenta.github.io/lofi-player/assets/screenshots/screenshot_v.1.0.png"
/>
<meta property="og:url" content="https://magenta.github.io/lofi-player/" />
<meta name="twitter:card" content="summary_large_image" />
<!-- Non-Essential, But Recommended -->
<meta property="og:site_name" content="Lo-Fi Player" />
<meta name="twitter:image:alt" content="interactive lofi room" />
<title>Lo-Fi Player</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-80107903-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-80107903-4');
</script>
<!-- import the webpage's stylesheet -->
<link
href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap"
rel="stylesheet"
/>
<link href="https://unpkg.com/[email protected]/css/nes.min.css" rel="stylesheet" />
<link rel="stylesheet" href="./style.css" />
<!-- favicon -->
<link
rel="icon"
type="image/png"
sizes="32x32"
href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/237/fire_1f525.png"
/>
<!-- import the webpage's javascript file -->
<script src="https://unpkg.com/[email protected]/build/Tone"></script>
<script src="https://unpkg.com/@tonejs/[email protected]/build/Midi"></script>
<script src="./third_party/Tonejs-Instruments.js"></script>
<script src="./script.js" defer></script>
</head>
<body>
<div id="container">
<div id="warning-overlay">
<div id="warning-div" class="nes-balloon from-left">
<p>
Your screen is a little bit small for the optimal experience. It's recommended to play on desktop
with window wider than 700px. Do you want to proceed courageously or watch the demo on YouTube?
</p>
<div>
<a href="https://www.youtube.com/watch?v=lyCfSQzWg-o" target="_blank">
<button id="youtube-button" class="nes-btn">YouTube</button>
</a>
<button id="whatever-button" class="nes-btn is-error" onclick="onClickWhatever()">
Play
</button>
</div>
</div>
</div>
<div id="canvas-div">
<div id="bubble-div" class="nes-balloon from-left">Hi there</div>
<img src="./assets/rooom-0.png" alt="room" id="background-image" />
<canvas id="main-canvas"> </canvas>
<div id="canvas-overlay">
<h1 id="title">Lo-Fi Player</h1>
<button id="start-button" class="nes-btn disabled">loading...</button>
</div>
<div id="melody-panel-div">
<div id="melody-panel">
<div class="panel" id="master-div">
<h3 class="title">Master</h3>
<div class="panel-control-div">
<div>
<label>bpm</label>
<input
type="range"
class="nes-progress"
id="bpm-input"
value="75"
min="60"
max="100"
step="5"
/>
</div>
<div>
<label>tone</label>
<input
id="master-tone-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>volume</label>
<input
id="master-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="30"
/>
</div>
<div>
<label>reverb</label>
<input
id="master-reverb-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="0"
/>
</div>
<div>
<label
>auto random <br />
change sometimes</label
>
<label>
<input type="checkbox" id="masterAutoBreakCheckbox" class="nes-checkbox" />
<span></span>
</label>
</div>
</div>
</div>
<div class="panel" id="interpolation-div">
<h3 class="nes-text">Melody Interpolation</h3>
<p>
Create your melodies by mixing two melodies together!
<a href="https://magenta.tensorflow.org/music-vae" target="_blank">
How does this work?</a
>
<a
href="https://magenta.tensorflow.org/2016/06/10/recurrent-neural-network-generation-tutorial"
target="_blank"
>
What is RNN?</a
>
</p>
<p></p>
<div>
<!-- <span>1st</span> -->
<select id="first-melody-select">
<option value="0">chill</option>
<option value="1">dense</option>
<option value="2">sad</option>
<option value="3">moody</option>
<option value="4">RNN</option>
</select>
<input
id="interpolation-slider"
type="range"
class="nes-progress"
min="0"
max="4"
step="1"
value="0"
/>
<input
id="interpolation-slider-2"
type="range"
class="nes-progress"
min="0"
max="4"
step="1"
value="0"
/>
<select id="second-melody-select">
<option value="0">chill</option>
<option value="1" selected>dense</option>
<option value="2">sad</option>
<option value="3">moody</option>
</select>
<!-- <span>2nd</span> -->
</div>
<canvas id="melody-canvas"></canvas>
</div>
<div class="panel" id="bass-div">
<h3>Bass</h3>
<div class="panel-control-div">
<div>
<label>on/off</label>
<label>
<input type="checkbox" id="bassMuteCheckbox" class="nes-checkbox" />
<span></span>
</label>
</div>
<div>
<label>volume</label>
<input
id="bass-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>tone</label>
<input
id="bass-tone-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
</div>
</div>
<div class="panel" id="melody-div">
<h3>Melody</h3>
<div class="panel-control-div">
<div>
<label>on/off</label>
<label>
<input type="checkbox" id="melodyMuteCheckbox" class="nes-checkbox" checked />
<span></span>
</label>
</div>
<div>
<label>sound</label>
<select id="melody-instrument-select">
<option value="0">synths</option>
<option value="1" selected>piano</option>
<option value="2">acoustic guitar</option>
<option value="3">electric guitar</option>
</select>
</div>
<div>
<label>volume</label>
<input
id="melody-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>swing</label>
<input
id="melody-swing-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="0"
/>
</div>
</div>
</div>
<div class="panel" id="chords-div">
<h3>Chords</h3>
<div class="panel-control-div">
<div>
<label>on/off</label>
<label>
<input type="checkbox" id="chordsMuteCheckbox" class="nes-checkbox" checked />
<span></span>
</label>
</div>
<div>
<label>vibe</label>
<select name="chords" id="chords-select">
<option value="0">mellow</option>
<option value="1">sad</option>
<option value="2">basic</option>
</select>
</div>
<div>
<label>sound</label>
<select name="chords-instrument" id="chords-instrument-select">
<option value="0">synths</option>
<option value="1">piano</option>
<option value="2">acoustic guitar</option>
<option value="3">electric guitar</option>
</select>
</div>
<div>
<label>volume</label>
<input
id="chords-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>swing</label>
<input
id="chords-swing-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="0"
/>
</div>
</div>
</div>
<div class="panel" id="background-div">
<h3>Background Sounds</h3>
<div class="panel-control-div">
<div>
<label>on/off</label>
<label>
<input
type="checkbox"
id="backgroundSoundsMuteCheckbox"
class="nes-checkbox"
checked
/>
<span></span>
</label>
</div>
<div>
<label>sound</label>
<select id="background-samples-select">
<option value="0">Raindrops</option>
<option value="1">Waves</option>
<option value="2">City Street</option>
<option value="3">People</option>
</select>
</div>
<div>
<label>volume</label>
<input
id="background-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>tone</label>
<input
id="background-tone-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
</div>
</div>
<div class="panel" id="drum-div">
<h3>Drum</h3>
<div class="panel-control-div">
<div>
<label>on/off</label>
<label>
<input type="checkbox" id="drum-toggle" class="nes-checkbox" checked />
<span></span>
</label>
</div>
<div>
<label>volume</label>
<input
id="drum-volume-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>tone</label>
<input
id="drum-tone-slider"
type="range"
class="nes-progress"
min="0"
max="100"
value="100"
/>
</div>
<div>
<label>pattern</label>
<select id="drum-patterns-select">
<option value="0">classic</option>
<option value="1">lazy</option>
<option value="2">dense</option>
</select>
</div>
</div>
</div>
<div class="panel" id="info-div">
<h3>Lo-Fi Player</h3>
<p>
Welcome to our magical room! By interacting with elements in the room, you can build
your own custom music stream. Built by
<a href="https://vibertthio.com/portfolio/" target="_blank">Vibert Thio</a>, intern
on the Google Brain team. Powered by magic from
<a href="https://magenta.tensorflow.org/" target="_blank">Magenta</a>.
</p>
<br />
<p>
Read our
<a href="https://g.co/magenta/lofi-player" target="_blank">blog</a> for more info.
Or, play it on
<a href="https://goo.gl/magenta/lofi-stream" target="_blank">YouTube</a> with
others.
</p>
<br />
<h3>Credits</h3>
<p>
Thanks
<a href="https://soundcloud.com/cone-head" target="_blank">Conehead</a>
and
<a href="https://soundcloud.com/eveyichenmusic" target="_blank">E V E</a>
for the counsel on music. Thanks
<a href="https://stiong124.wixsite.com/shynha/animation" target="_blank"
>@Sheena Tiong</a
>
for the sunset animated gif.
</p>
</div>
<button class="melody-panel-button" id="melody-panel-close">X</button>
<button class="melody-panel-button disabledbutton" id="melody-panel-right">></button>
<button class="melody-panel-button disabledbutton" id="melody-panel-left"><</button>
</div>
</div>
<div id="shareButtonDiv">
<button id="shareButton" class="nes-btn">Share</button>
<p id="shareButtonHint">link copied to clipboard</p>
<input type="text" value="https://magenta.github.io/lofi-player/" id="hiddenUrlInput" />
</div>
</div>
<footer>
<span style="color: white">v.1.3</span>
</footer>
</div>
<div id="youtube-div">
<h3>
<a href="https://www.youtube.com/channel/UCizuHuCAHmpTa6EFeZS2Hqg/live" target="_blank"
>Youtube Live</a
>
</h3>
<div id="youtube-buttons">
<button id="connect-youtube-button" class="nes-btn is-success" onclick="onClickConnect()">
connect
</button>
<a
href="https://studio.golightstream.com/projects/5f1f9dc90d0f3262372d3118"
target="_blank"
>
<button class="nes-btn">stream</button>
</a>
</div>
<div id="youtube-content-div">
<p id="youtube-prompt-text">[wait...]</p>
<div id="youtube-prompt-div">
<p>
You can get api key from youtube service and connect this project to your youtube
stream, and this block will show the live comments real-time. Hope you enjoy this.
</p>
<p>Regards,</p>
<p>Vibert</p>
</div>
</div>
<button id="collapse-youtube-div-button" onclick="onClickCloseYoutube()">X</button>
</div>
</body>
</html>