-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.html
200 lines (187 loc) · 12.6 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
<!-- 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.
============================================================================-->
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-80107903-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-80107903-3', { 'anonymize_ip': true });
</script>
<title>Listen To Transformer</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- OpenGraph data -->
<meta property="og:image" content="https://magenta.github.io/listen-to-transformer/assets/logo.png">
<meta property="og:title" content="Listen to Transformer">
<meta property="og:description" content="An app to make it easier to explore and curate output from a music transformer">
<meta property="og:url" content="https://magenta.github.io/listen-to-transformer/">
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Listen to Transformer">
<meta name="twitter:description" content="An app to make it easier to explore and curate output from a music transformer">
<meta name="twitter:image" content="https://magenta.github.io/listen-to-transformer/assets/logo.png">
<!-- PWA stuff -->
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#00ebc7">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="listen-to-transformer">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="listen-to-transformer">
<link rel="apple-touch-icon" href="assets/icon-512.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/icon-144.png">
<link rel="apple-touch-icon" sizes="192x192" href="assets/icon-192.png">
<meta name="msapplication-TileImage" content="assets/icon-144.png">
<meta name="msapplication-TileColor" content="#00ebc7">
<meta name="msapplication-tap-highlight" content="no">
<link rel="shortcut icon" href="assets/icon-64.png" />
<!-- Actual useful things -->
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:400,700&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.min.js"></script>
</head>
<body>
<section class="splash">
<div class="vertical box long">
<div class="content">
<h1>Listen to Transformer</h1>
<p><a href="https://magenta.tensorflow.org/piano-transformer">Music Transformer</a> is an open source machine learning model from the
<a href="http://magenta.tensorflow.org/">Magenta</a> research group at Google that can generate musical
performances with some long-term structure.
We find it interesting to see what these models can and can’t do,
so we made this app to make it easier to explore and curate the model’s output.
</p>
<button class="square" id="btnCloseHelp">start listening</button>
<p>If you listen to a bunch of samples, you’ll probably discover that most
compositions (like a lot of fully AI-generated music)
are nowhere near as good and interesting as what people compose.
And that’s okay! We just thought it would be fun for more people to be able
to hear them, think about them, or remix them in their own music. So here is
a radio station of 100,000 random, not cherry-picked, samples.
They are all downloadable as MIDI files under a CC0 (“No Rights Reserved”)
license, so if you want to take one of the pieces and make it your own,
do it -- we’d love to hear all about it!
</p>
<p>For those interested in all the ones and zeros of this work, you
can read more about the model in the
<a href="https://magenta.tensorflow.org/music-transformer">blog post</a> announcing it,
the <a href="https://arxiv.org/abs/1809.04281">research paper</a> it was published in,
or the <a href="https://github.com/magenta/listen-to-transformer">blog post</a>
about this app.
</p>
<p>When you favourite a song, it is only stored locally, in your browser's cache,
and not on any external server. In order to understand a bit better which pieces
people like, skip over, or keep going back to, we are collecting some
anonymous click analytics from this app in accordance with Google’s
<a href="https://policies.google.com/privacy?hl=en&gl=us">privacy policy</a>.
</p>
</div>
</div><!-- /help -->
</section>
<section class="main" hidden>
<div class="box horizontal">
<h1 class="outside">
<span>Listen to Transformer</span>
<button title="about this" id="btnHelp">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"/></svg>
</button>
</h1>
<div class="album canvas-container"></div>
<div class="vertical" style="width:100%">
<div class="horizontal">
<div class="song-title"> </div>
<button title="share this song" id="btnShare">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/></svg>
share
</button>
</div>
<div class="vertical progress">
<progress></progress>
<div class="horizontal">
<div class="current-time">0:00</div>
<div class="total-time">0:00</div>
</div>
</div>
<div class="horizontal controls">
<button title="go to the previous song" id="btnPrevious" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/></svg>
</button>
<button title="play/pause" id="btnPlay">
<svg class="no" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>
<svg class="yes" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>
</button>
<button title="go to the next song" id="btnNext">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg>
</button>
<button title="favorite this song" id="btnFave">
<svg class="no" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>
<svg class="yes" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
</button>
<button title="view your saved songs" id="btnPlaylist">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 10h12v2H4zm0-4h12v2H4zm0 8h8v2H4zm10 0v6l5-3z"/></svg>
</button>
</div> <!-- /controls -->
</div> <!-- /vertical -->
<div class="vertical popup playlist">
<div class="content"><ul></ul></div>
</div> <!-- /playlist -->
<div class="vertical popup share">
<div class="content">
<a class="button twitter" target="_blank">
<svg class="twitter" xmlns="http://www.w3.org/2000/svg" id="Logo_FIXED" data-name="Logo — FIXED" viewBox="0 0 400 400"><defs><style>.cls-1{fill:none;}.cls-2{fill:currentColor;}</style></defs><title>Twitter_Logo_Blue</title><rect class="cls-1" width="400" height="400"/><path class="cls-2" d="M153.62,301.59c94.34,0,145.94-78.16,145.94-145.94,0-2.22,0-4.43-.15-6.63A104.36,104.36,0,0,0,325,122.47a102.38,102.38,0,0,1-29.46,8.07,51.47,51.47,0,0,0,22.55-28.37,102.79,102.79,0,0,1-32.57,12.45,51.34,51.34,0,0,0-87.41,46.78A145.62,145.62,0,0,1,92.4,107.81a51.33,51.33,0,0,0,15.88,68.47A50.91,50.91,0,0,1,85,169.86c0,.21,0,.43,0,.65a51.31,51.31,0,0,0,41.15,50.28,51.21,51.21,0,0,1-23.16.88,51.35,51.35,0,0,0,47.92,35.62,102.92,102.92,0,0,1-63.7,22A104.41,104.41,0,0,1,75,278.55a145.21,145.21,0,0,0,78.62,23"/></svg>
Share on Twitter
</a>
<a class="button fb" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" viewBox="-40 -40 400 400">
<path id="Blue_1_" d="M248.082,262.307c7.854,0,14.223-6.369,14.223-14.225V18.812 c0-7.857-6.368-14.224-14.223-14.224H18.812c-7.857,0-14.224,6.367-14.224,14.224v229.27c0,7.855,6.366,14.225,14.224,14.225 H248.082z"/>
<path id="f" fill="#FFFFFF" d="M182.409,262.307v-99.803h33.499l5.016-38.895h-38.515V98.777c0-11.261,3.127-18.935,19.275-18.935 l20.596-0.009V45.045c-3.562-0.474-15.788-1.533-30.012-1.533c-29.695,0-50.025,18.126-50.025,51.413v28.684h-33.585v38.895h33.585 v99.803H182.409z"/>
</svg>
Share on Facebook
</a>
<button id="btnSave">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32"><path d="M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"/></svg>
Download current song
</button>
<div>
All samples are released under a <a href="https://creativecommons.org/share-your-work/public-domain/cc0/">CC0</a> "No Rights Reserved" license.
</div>
</div>
</div> <!-- /share -->
</div> <!-- box -->
</section>
<div class="waves">
<svg viewbox="0 0 100 20">
<path opacity="0.5" d="M0 25V10C35.5 -10.5 61.5 6.5 100 10V25H0Z" fill="black"/>
<path d="M0 25V7C20 10.3333 38.3333 10.3333 55 7C71.6667 3.66667 86.6667 3.33333 100 6V25H0Z" fill="#FF0000" fill-opacity="0.5"/>
</svg>
</div>
</body>
<script>
if (typeof(Storage) !== 'undefined') {
const hasShownSplash = window.localStorage.getItem('has_shown_splash');
if (hasShownSplash === 'true') {
document.querySelector('.splash').hidden = true;
document.querySelector('.main').hidden = false;
} else {
document.querySelector('.splash').hidden = false;
document.querySelector('.main').hidden = true;
window.localStorage.setItem('has_shown_splash', true);
}
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.7.58/Tone.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@magenta/music@^1.0.0/es6/core.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js" defer></script>
<script src="script.js"></script>
</html>