forked from jonobr1/Patatap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpe.html
389 lines (359 loc) · 14.8 KB
/
mpe.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
<!doctype html>
<html prefix="og: http://ogp.me/ns#" itemscope itemtype="http://schema.org/CreativeWork">
<head>
<meta charset="utf-8">
<title>Patatap</title>
<meta name="keywords" content="patatap, neuronal synchrony, music, audio, visual, app, 2d, jonobr1, lullatone, synesthesia">
<meta name="author" content="jonobr1">
<!-- Sharing -->
<meta name="name" content="Patatap">
<meta name="image" content="http://www.patatap.com/images/thumbnail.png">
<meta name="description" content="Patatap is a portable animation and sound kit. With the touch of a finger create melodies charged with moving shapes. Warning: contains flashing images.">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Patatap">
<meta name="twitter:description" content="Patatap is a portable animation and sound kit. With the touch of a finger create melodies charged with moving shapes. Warning: contains flashing images.">
<meta name="twitter:creator" content="@jonobr1">
<meta name="twitter:image:src" content="http://www.patatap.com/images/thumbnail.png">
<meta name="twitter:app:name:iphone" content="Patatap">
<meta name="twitter:app:name:ipad" content="Patatap">
<meta name="twitter:app:url:iphone" content="https://itunes.apple.com/us/app/patatap/id880626868?mt=8">
<meta name="twitter:app:url:ipad" content="https://itunes.apple.com/us/app/patatap/id880626868?mt=8">
<meta name="twitter:app:id:iphone" content="id880626868">
<meta name="twitter:app:id:ipad" content="id880626868">
<meta name="twitter:app:name:googleplay" content="Patatap">
<meta name="twitter:app:id:googleplay" content="com.jonobr1.Patatap">
<meta name="twitter:app:url:googleplay" content="https://play.google.com/store/apps/details?id=com.jonobr1.Patatap">
<meta itemprop="name" content="Patatap">
<meta itemprop="description" content="Patatap is a portable animation and sound kit. With the touch of a finger create melodies charged with moving shapes. Warning: contains flashing images.">
<meta itemprop="image" src="http://www.patatap.com/images/thumbnail.png">
<meta property="og:title" content="Patatap">
<meta property="og:type" content="website">
<meta property="og:image" content="http://www.patatap.com/images/thumbnail.png"/>
<meta property="og:site_name" content="Patatap">
<meta property="og:description" content="Patatap is a portable animation and sound kit. With the touch of a finger create melodies charged with moving shapes. Warning: contains flashing images.">
<!-- iOS specific catches -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<!-- icons -->
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png"/>
<link rel="icon" href="/images/favicon.ico" />
<!-- styles -->
<link href='//fonts.googleapis.com/css?family=Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" media="screen" type="text/css" href="/styles/main.css" />
</head>
<body>
<h1 style="width: 0; height: 0; overflow: hidden;">
Patatap is a portable animation and sound kit. With the touch of a finger create melodies charged with moving shapes. Warning: contains flashing images.
</h1>
<div id="credits" style="display: none;">
<ul>
<li>
<a href="http://patatap.com" target="_blank" style="border-bottom: 0;"><strong>Patatap</strong></a>
</li>
<li>
<a href="http://typatone.com" target="_blank">Typatone</a>
</li>
<li>
<a href="mailto:[email protected]">Inquiries</a>
</li>
<li>
<a id="embed-button" href="#" title="Embed Patatap on your site">Embed</a>
</li>
<li>
<a id="merchandise-button" href="#" title="Support the creators of Patatap">Merchandise</a>
</li>
<li>
<a id="jonobr1" href="http://jonobr1.com/" target="_blank">jonobr1</a> + <a id="lullatone" href="http://lullatone.com/" target="_blank">lullatone</a>
</li>
</ul>
</div>
<div id="content"></div>
<div id="hint" style="display: none;">
<p class="message"></p>
<a class="ios-app-store" href="https://itunes.apple.com/us/app/patatap/id880626868?ls=1&mt=8" target="_blank"></a>
<a class="play-store" href="https://play.google.com/store/apps/details?id=com.jonobr1.Patatap" target="_blank"></a>
</div>
<div id="embed" style="display: none;">
<textarea><iframe src="//patatap.com/" style="border: 3px solid #ccc" width="640" height="480"></iframe></textarea>
</div>
<div id="merchandise" style="z-index: -1; opacity: 0.0;">
<div class="container">
<div id="close-merchandise">×</div>
<div class="vimeo">
<iframe src="//player.vimeo.com/video/95057507?title=0&byline=0&portrait=0&color=e34d73" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<ul>
<li class="music">
<iframe style="border: 0; width: 170px; height: 313px;" src="//bandcamp.com/EmbeddedPlayer/album=2161956980/size=large/bgcol=ffffff/linkcol=333333/tracklist=false/transparent=true/" seamless><a href="http://lullatone.bandcamp.com/album/soundtracks-for-everyday-adventures">Soundtracks for Everyday Adventures by Lullatone</a></iframe>
</li>
<li class="poster">
<a href="https://www.behance.net/gallery/Synesthesia/8354443" target="_blank">
<div id="synesthesia" class="thumbnail"></div>
</a>
<div class="information">
<p class="title">
<a href="https://www.behance.net/gallery/Synesthesia/8354443" target="_blank"><strong>Synesthesia</strong></a>
</p>
<p class="artist">
by jonobr1
</p>
<p class="description">
Take home a 27"x40" poster made with Patatap — $50.00
</p>
<p class="action">
<a href="http://society6.com/jonobr1/Synesthesia-Zbs_Print#1=3" target="_blank">buy</a> <a href="https://www.behance.net/gallery/Synesthesia/8354443" target="_blank">share</a>
</p>
</div>
</li>
<li class="music">
<iframe style="border: 0; width: 170px; height: 313px;" src="//bandcamp.com/EmbeddedPlayer/album=3832398802/size=large/bgcol=ffffff/linkcol=333333/tracklist=false/transparent=true/" seamless><a href="http://lullatone.bandcamp.com/album/while-winter-whispers">while winter whispers by Lullatone</a></iframe>
</li>
<li class="poster">
<a href="https://www.behance.net/gallery/Anatomy-of-a-Polygon/12715463" target="_blank">
<div id="two-polygon" class="thumbnail"></div>
</a>
<div class="information">
<p class="title">
<a href="https://www.behance.net/gallery/Anatomy-of-a-Polygon/12715463" target="_blank"><strong>Anatomy of a Polygon</strong></a>
</p>
<p class="artist">
by jonobr1
</p>
<p class="description">
Support open-source, with a poster for <a href="http://jonobr1.github.com/two.js" target="_blank">Two.js</a> — $50.00
</p>
<p class="action">
<a href="http://society6.com/jonobr1/Anatomy-of-a-Polygon_Print#1=3" target="_blank">buy</a> <a href="https://www.behance.net/gallery/Anatomy-of-a-Polygon/12715463" target="_blank">share</a>
</p>
</div>
</li>
<li class="music">
<iframe style="border: 0; width: 170px; height: 313px;" src="//bandcamp.com/EmbeddedPlayer/album=1238287256/size=large/bgcol=ffffff/linkcol=333333/tracklist=false/transparent=true/" seamless><a href="https://lullatone.bandcamp.com/album/thinking-about-thursdays">Thinking About Thursdays by Lullatone</a></iframe>
</li>
</ul>
<!-- Insert iOS App Store Button here -->
<div class="app-cta-container">
<a class="ios-app-store" href="https://itunes.apple.com/us/app/patatap/id880626868?ls=1&mt=8" target="_blank"></a>
<a class="play-store" href="https://play.google.com/store/apps/details?id=com.jonobr1.Patatap" target="_blank"></a>
</div>
<div class="attribution">
<p>
If you like Patatap you might like our other project <a href="http://typatone.com" target="_blank">Typatone</a>.
</p>
<p class="nb">
<a href="http://lullatone.com/" target="_blank">lullatone</a> · <a href="http://about.jonobr1.com/" target="_blank">jonobr1</a> · <a class="mailto" href="mailto:[email protected]">inquiries</a> · <a href="/privacy-policy.html" target="_blank">terms</a>
</p>
<p class="nb">
© 2014
</p>
</div>
</div>
</div>
<div id="lobby">
<div id="loader"></div>
<div id="asset-info">
<span id="loaded">0</span> / <span id="total-assets">26</span>
</div>
</div>
<div class="scripts" style="display: none;">
<script src="/node_modules/mpe/lib/mpe.js"></script>
<script src="/third-party/has.js"></script>
<script src="/third-party/url.js"></script>
<script src="/third-party/jquery.js"></script>
<script>
/**
* Check before loading JavaScript that we have the necessary features
* in order to run the project. If we don't throw an error and display
* the error page.
*/
if (!Object.defineProperty || !(window.AudioContext || window.webkitAudioContext)) {
$(function() {
$('#lobby').fadeOut();
$('#merchandise').css({
opacity: 1.0,
display: 'none',
zIndex: 0
}).fadeIn();
$('#close-merchandise').css('display', 'none');
});
throw 'Oof, I cannot load this application because it will break...';
}
</script>
<script src="/third-party/tween.js"></script>
<script src="/third-party/two.js"></script>
<script src="/src/sound.js"></script>
<script src="/src/animations.js"></script>
<script src="/src/main.js"></script>
<script>
$(function() {
var $window = $(window);
var instrument = window.mpe();
var notes = {
'49': false,
'51': false,
'54': false,
'56': false,
'58': false,
'61': false,
'63': false,
'66': false,
'68': false,
'70': false,
'48': false,
'50': false,
'52': false,
'53': false,
'55': false,
'57': false,
'59': false,
'60': false,
'62': false,
'64': false,
'65': false,
'67': false,
'69': false,
'71': false
};
instrument.subscribe(_.throttle(function(e) {
var touches = {};
for (var i = 0; i < e.length; i++) {
var data = e[i];
var index = 81;
var note = data.noteNumber;
var velocity = data.noteOnVelocity;
var pressure = data.pressure;
touches[note] = true;
}
for (var note in notes) {
if (notes[note] !== touches[note]) {
notes[note] = touches[note];
if (notes[note]) {
var index = convertNoteToIndex(note);
$window.trigger('keydown', index);
}
}
}
}, 1000 / 32));
function convertNoteToIndex(noteNumber) {
var index = 81;
switch (noteNumber) {
case 49:
case '49':
index = 71;
break;
case 51:
case '51':
index = 72;
break;
case 54:
case '54':
index = 74;
break;
case 56:
case '56':
index = 75;
break;
case 58:
case '58':
index = 76;
break;
case 61:
case '61':
index = 90;
break;
case 63:
case '63':
index = 88;
break;
case 66:
case '66':
index = 67;
break;
case 68:
case '68':
index = 86;
break;
case 70:
case '70':
index = 66;
break;
case 48:
case '48':
index = 81;
break;
case 50:
case '50':
index = 87;
break;
case 52:
case '52':
index = 69;
break;
case 53:
case '53':
index = 82;
break;
case 55:
case '55':
index = 84;
break;
case 57:
case '57':
index = 89;
break;
case 59:
case '59':
index = 85;
break;
case 60:
case '60':
index = 73;
break;
case 62:
case '62':
index = 79;
break;
case 64:
case '64':
index = 80;
break;
case 65:
case '65':
index = 65;
break;
case 67:
case '67':
index = 83;
break;
case 69:
case '69':
index = 68;
break;
case 71:
case '71':
index = 70;
break;
}
return index;
}
navigator.requestMIDIAccess().then(function(access) {
access.inputs.forEach(function(midiInput) {
midiInput.addEventListener('midimessage',function(e) {
instrument.processMidiMessage(e.data);
});
});
});
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48525045-1', 'patatap.com');
ga('send', 'pageview');
</script>
</div>
</body>
</html>