index.html 25.3 KB
Newer Older
1
2
<!DOCTYPE html>
<html>
3
4
5
6
7
8
9
  <head>
    <meta charset="utf-8" />
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Purr Data</title>
    <meta name="description" content="Purr Data compiled for web with Emscripten" />
    <meta name="keywords" content="purr-data" />
    <meta name="generator" content="emsripten" />
10
11
	
	<link rel="shortcut icon" type="image/jpg" href="./purr.png"/>
12
13
14
15
16
17
18
    <link rel="stylesheet" type="text/css" href="./css/dejavu.css" />
    <link id="page_style" rel="stylesheet" type="text/css" href="./css/default.css" />
    <link rel="stylesheet" type="text/css" href="./css/webapp/webapp.css" />
    <link rel="stylesheet" href="libs/bootstrap/bootstrap.min.css" />
  </head>

  <body id="container">
19
    <!-- Loading Modal -->
20
21
22
23
24
25
26
27
28
29
30
31
32
    <div class="modal fade" id="loading-modal" tabindex="-1" role="dialog" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
          <div class="modal-body text-center">
            <div class="spinner-border text-primary mt-2" style="width: 3rem; height: 3rem;" role="status">
              <span class="sr-only">Loading...</span>
            </div>
            <h3 class="mt-4">Loading Purr Data...</h3>
          </div>
        </div>
      </div>
    </div>

33
    <!-- Dialog Modal -->
34
    <div class="modal fade" id="dialog-modal" tabindex="-1" role="dialog" aria-hidden="true">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
35
      <div class="modal-dialog modal-dialog-centered" role="document" style="width: fit-content;">
36
37
38
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="dialog-title"></h5>
39
            <button type="button" class="close" onClick="cancel()" aria-label="Close">
40
41
42
43
44
45
46
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body" id="dialog-body">
          </div>
        </div>
      </div>
47
48
49
    </div>

    <!-- Message Modal -->
Prakhar Agarwal's avatar
Prakhar Agarwal committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    <div class="modal fade" id="message-modal" tabindex="-1" role="dialog" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">New message</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <form>
              <div class="form-group">
                <label for="message-text" class="col-form-label">Message:</label>
                <textarea class="form-control" id="message-text"></textarea>
              </div>
            </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
Prakhar Agarwal's avatar
Prakhar Agarwal committed
69
            <button type="button" id="send-message-btn" class="btn btn-primary" onclick="pdbundle.pdgui.web_menu_send()">Send message</button>
Prakhar Agarwal's avatar
Prakhar Agarwal committed
70
71
72
73
          </div>
        </div>
      </div>
    </div>
74

75
76
77
78
79
80
81
82
    <div id="container-app" class="container-fluid">
      <!-- Menu -->
      <nav id="menu"></nav>

      <!-- Content -->
      <div class="d-flex content-webapp" id="content">
        <!-- Sidebar -->

83
        <div class="card collapse show" id="sidebar">
84
85
86
          <div class="card-body text-center" id="sidebar-body">
            <!-- Pd logo -->
            <div id="pd-info">
87
              <img src="./purr.png" alt="purr-data-logo" />
88
89
90
91
92
93
94
95
              <h4>Purr Data</h4>
            </div>
            <div id="sidebar-body-dialog"></div>
            <hr />
            <!-- DSP section -->
            <div class="d-flex ml-3">
              <i class="fa fa fa-volume-up text-primary" aria-hidden="true"></i>
              <h5>DSP</h5>
96
              <label class="dsp_toggle align-self-center ml-5">
97
98
99
100
101
102
103
                <input type="checkbox" id="dsp_control" name="dsp_control" value="on" />
                <span></span>
              </label>
            </div>
            <hr />
            <!-- Files section -->
            <div>
Prakhar Agarwal's avatar
Prakhar Agarwal committed
104
105
106
107
108
109
              <div>
                <div class="d-flex ml-3 float-left">
                  <i class="fa fa-folder-open-o text-primary" aria-hidden="true"></i>
                  <h5>Files</h5>
                </div>
                <i class="fa fa-refresh ml-5 mt-1 text-primary inline-block" id="reload-i" aria-hidden="true" onclick="pdbundle.pdgui.update_file_ls()"></i>
110
              </div>
Prakhar Agarwal's avatar
Prakhar Agarwal committed
111
              
112
              <div class="text-left" id="sidebar-files">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
113
                <ul class="ml-3 mt-2" id="file_ls"></ul>
114
                <div class="text-secondary text-center" id="file_ls_empty">
Gunjan Yadu's avatar
Gunjan Yadu committed
115
                  <p><i>No files found yet</i></p>
116
117
118
119
120
121
                </div>
              </div>
            </div>
          </div>
        </div>

122
		<a id="sidebar-collapse" class="m-2" data-toggle="collapse" data-target="#sidebar">
123
			<i class="fa fa-angle-double-left rotate-transition" id="sidebar-col-icon" onclick="rotate(this)"></i>
124
125
		</a>

126
127
128
129
130
131
132
133
        <!-- Canvas/Pd Windows -->
        <div class="d-flex flex-column flex-fill" id="windows">
          <!-- Canvas Container -->
          <div class="flex-grow-1 card" id="canvas-content">
            <div class="d-flex" id="canvas-container"></div>
          </div>

          <!-- Console window -->
134
          <div class="card d-flex justify-content-between" id="console-window">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
135
136
            <div class="card-header d-flex justify-content-between align-items-center" id="console-header">
              <h5 class="d-flex align-items-center" id= "console-heading" onclick="rotate(this)">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
137
138
                <a data-toggle="collapse" data-parent="#windows" href="#console_bottom" class="text-dark d-flex align-items-center">Console
                  <i class="ml-2 fa fa-angle-double-down text-primary rotate-transition" id="open-icon"></i>
139
                </a>
140
141
              </h5>

Prakhar Agarwal's avatar
Prakhar Agarwal committed
142
              <div class="console-find-webapp mr-3" id="console_find" style="display: none;">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
143
                <div class="d-flex justify-content-end align-items-center">
144
145
                  <i class="fa fa-long-arrow-up text-primary" id="find_above" style="cursor: pointer;"></i>
                  <i class="fa fa-long-arrow-down text-primary" id="find_below" style="cursor: pointer;"></i>
146
                  <label><input type="text" id="console_find_text" name="console_find_text" defaultValue="Search in Console" style="width: 15em;" placeholder="Search in Console" /> </label>
147
                  <label class="highlight-find d-flex align-items-center">
148
                    Highlight All
Prakhar Agarwal's avatar
Prakhar Agarwal committed
149
                    <input class="m-1" type="checkbox" id="console_find_highlight" name="console_find_highlight" onchange="console_find_highlight_all(this);" />
150
151
152
                  </label>
                </div>
              </div>
Prakhar Agarwal's avatar
Prakhar Agarwal committed
153
              <div class="d-flex justify-content-end align-items-center">
Prakhar Agarwal's avatar
Prakhar Agarwal committed
154
                <i class="fa fa-clone text-primary" id="cons_copy" unselectable="on" style="cursor: pointer;" data-toggle="tooltip" title="Copy Console"></i>
155
156
                <i class='fa fa-trash ml-3 text-primary' style='cursor:pointer' id='clear' data-toggle="tooltip" title="Clear Console"></i>
              </div>
157
158
159
160
161
            </div>

            <div class="collapse show" id="console_bottom">
              <div class="card-block">
                <div id="printout">
162
                  <pre id="p1" class='ml-2' style="white-space: pre-wrap; overflow: hidden;"></pre>
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script>
      //--------------------- emscripten ----------------------------
      var Module = {
        preRun: [],
        postRun: [],
        print: function (e) {
          1 < arguments.length && (e = Array.prototype.slice.call(arguments).join(" "));
          console.log(e);
        },
        printErr: function (e) {
          1 < arguments.length && (e = Array.prototype.slice.call(arguments).join(" "));
          console.error(e);
        },
        pd: {}, // make pd object accessible from outside of the scope
        mainInit: function () {
          // called after Module is ready
          Module.pd = new Module.Pd(); // instantiate Pd object
          // Remove modal after everything loaded
          $(document).ready(function () {
            $("#loading-modal").modal("hide");
          });

          if (typeof Module.pd != "object") {
            alert("Pd: failed to instantiate pd object");
            console.error("Pd: failed to instantiate pd object");
            Module.mainExit();
            return;
          }
          var pd = Module.pd;
          pd.setNoGui(false); // set to true if you don't use the pd's gui
          // initializing webapp
          initialize_webapp();

          // create an AudioContext
          var isWebAudioSupported = false;
          var audioContextList = [];
          (function () {
            var AudioContext = self.AudioContext || self.webkitAudioContext || false;
            if (AudioContext) {
              isWebAudioSupported = true;
              self.AudioContext = new Proxy(AudioContext, {
                construct(target, args) {
                  var result = new target(...args);
                  audioContextList.push(result);
                  return result;
                },
              });
            }
          })();
          if (isWebAudioSupported) {
            console.log("Audio: successfully enabled");
          } else {
            alert("The Web Audio API is not supported in this browser.");
            console.error("Audio: failed to use the web audio");
            Module.mainExit();
            return;
          }

          // check if the web midi library exists and is supported
          var isWebMidiSupported = false;
          if (typeof WebMidi != "object") {
            alert("Midi: failed to find the 'WebMidi' object");
            console.error("Midi: failed to find the 'WebMidi' object");
            Module.mainExit();
            return;
          }

          // array of enabled midi device ids (without duplicates)
          var midiInIds = [];
          var midiOutIds = [];

          // 10 input, 10 output device numbers to send with "pd midi-dialog"
          // 0: no device, 1: first available device, 2: second available device...
          var midiarr = [];

          // enable midi
          WebMidi.enable(function (err) {
            if (err) {
              // if the browser doesn't support web midi, one can still use pd without it
              console.error("Midi: failed to enable midi", err);
            } else {
              isWebMidiSupported = true;
              console.log("Midi: successfully enabled");

              // select all available input/output devices as default
              midiInIds = [];
              midiOutIds = [];
              for (var i = 0; i < WebMidi.inputs.length; i++) {
                midiInIds.push(WebMidi.inputs[i].id);
              }
              for (var i = 0; i < WebMidi.outputs.length; i++) {
                midiOutIds.push(WebMidi.outputs[i].id);
              }
              midiarr = [];
              for (var i = 0; i < 10; i++) {
                var devno = i < midiInIds.length ? i + 1 : 0;
                midiarr.push(devno);
              }
              for (var i = 0; i < 10; i++) {
                var devno = i < midiOutIds.length ? i + 1 : 0;
                midiarr.push(devno);
              }
              // called whenever input/output devices connection status changes
              function onConnectionChanged() {
                console.log("Midi: connection status changed");
                pdbundle.pdgui.pdsend("pd midi-dialog", midiarr.join(" ")); // send message to pd
              }
              // make sure we get only one callback at a time
              var timerId;
              WebMidi.addListener("connected", function (e) {
                clearTimeout(timerId);
                timerId = setTimeout(() => onConnectionChanged(), 100);
              });
              WebMidi.addListener("disconnected", function (e) {
                clearTimeout(timerId);
                timerId = setTimeout(() => onConnectionChanged(), 100);
              });
            }
          }, false); // not use sysex

          // reinit pd (called by "pd audio-dialog" message)
          Module.Pd.reinit = function (newinchan, newoutchan, newrate) {
            if (pd.init(newinchan, newoutchan, newrate, pd.getTicksPerBuffer())) {
              // print obtained settings
              console.log("Pd: successfully reinitialized");
              console.log("Pd: audio input channels: " + pd.getNumInChannels());
              console.log("Pd: audio output channels: " + pd.getNumOutChannels());
              console.log("Pd: audio sample rate: " + pd.getSampleRate());
              console.log("Pd: audio ticks per buffer: " + pd.getTicksPerBuffer());
            } else {
              // failed to reinit pd
              alert("Pd: failed to reinitialize pd");
              console.error("Pd: failed to reinitialize pd");
              Module.mainExit();
            }
          };

          // open midi (called by "pd midi-dialog" message)
          // receives input/output arrays of only selected devices
          // 0: first available device, 1: second available device...
          Module.Pd.openMidi = function (midiinarr, midioutarr) {
            if (!isWebMidiSupported) return;

            // if the selected device doesn't exist, use first available device instead
            midiinarr = midiinarr.map((item) => (item >= WebMidi.inputs.length || item < 0 ? 0 : item));
            midioutarr = midioutarr.map((item) => (item >= WebMidi.outputs.length || item < 0 ? 0 : item));

            // save this settings so we can check again later when connection status changes
            midiarr = [];
            for (var i = 0; i < 10; i++) {
              var devno = i < midiinarr.length ? midiinarr[i] + 1 : 0;
              midiarr.push(devno);
            }
            for (var i = 0; i < 10; i++) {
              var devno = i < midioutarr.length ? midioutarr[i] + 1 : 0;
              midiarr.push(devno);
            }
            // remove duplicates and convert device numbers to ids
            midiinarr = Array.from(new Set(midiinarr));
            midioutarr = Array.from(new Set(midioutarr));
            midiInIds = midiinarr.map((item) => WebMidi.inputs[item].id);
            midiOutIds = midioutarr.map((item) => WebMidi.outputs[item].id);

            // print all selected devices to the console
            for (var i = 0; i < midiInIds.length; i++) {
              var input = WebMidi.getInputById(midiInIds[i]);
              console.log("Midi: input" + (i + 1) + ": " + input.name);
            }
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              console.log("Midi: output" + (i + 1) + ": " + output.name);
            }
            // receive midi messages from WebMidi and forward them to pd input
            function receiveNoteOn(e) {
              pd.sendNoteOn(e.channel, e.note.number, e.rawVelocity);
            }

            function receiveNoteOff(e) {
              pd.sendNoteOn(e.channel, e.note.number, 0);
            }

            function receiveControlChange(e) {
              pd.sendControlChange(e.channel, e.controller.number, e.value);
            }

            function receiveProgramChange(e) {
              pd.sendProgramChange(e.channel, e.value + 1);
            }

            function receivePitchBend(e) {
              // [bendin] takes 0 - 16383 while [bendout] returns -8192 - 8192
              pd.sendPitchBend(e.channel, e.value * 8192 + 8192);
            }

            function receiveAftertouch(e) {
              pd.sendAftertouch(e.channel, e.value * 127);
            }

            function receivePolyAftertouch(e) {
              pd.sendPolyAftertouch(e.channel, e.note.number, e.value * 127);
            }

            for (var i = 0; i < midiInIds.length; i++) {
              var input = WebMidi.getInputById(midiInIds[i]);
              if (input) {
                input.removeListener(); // remove all added listeners
                input.addListener("noteon", "all", receiveNoteOn);
                input.addListener("noteoff", "all", receiveNoteOff);
                input.addListener("controlchange", "all", receiveControlChange);
                input.addListener("programchange", "all", receiveProgramChange);
                input.addListener("pitchbend", "all", receivePitchBend);
                input.addListener("channelaftertouch", "all", receiveAftertouch);
                input.addListener("keyaftertouch", "all", receivePolyAftertouch);
              }
            }
          };

          // get midi in device name
          Module.Pd.getMidiInDeviceName = function (devno) {
            if (!isWebMidiSupported) return;
            if (devno >= WebMidi.inputs.length || devno < 0) {
              devno = 0;
            }
            var name = WebMidi.inputs[devno].name;
            var lengthBytes = lengthBytesUTF8(name) + 1;
            var stringOnWasmHeap = _malloc(lengthBytes);
            stringToUTF8(name, stringOnWasmHeap, lengthBytes);
            return stringOnWasmHeap;
          };

          // get midi out device name
          Module.Pd.getMidiOutDeviceName = function (devno) {
            if (!isWebMidiSupported) return;
            if (devno >= WebMidi.inputs.length || devno < 0) {
              devno = 0;
            }
            var name = WebMidi.outputs[devno].name;
            var lengthBytes = lengthBytesUTF8(name) + 1;
            var stringOnWasmHeap = _malloc(lengthBytes);
            stringToUTF8(name, stringOnWasmHeap, lengthBytes);
            return stringOnWasmHeap;
          };

          // receive gui commands (only called in gui mode)
          Module.Pd.receiveCommandBuffer = function (data) {
            var command_buffer = {
              next_command: "",
            };
            pdbundle.pdgui.perfect_parser(data, command_buffer);
          };

          // receive print messages (only called in no gui mode)
          Module.Pd.receivePrint = function (s) {
            console.log(s);
          };

          // receive from pd's subscribed sources
          Module.Pd.receiveBang = function (source) {};

          Module.Pd.receiveFloat = function (source, value) {};

          Module.Pd.receiveSymbol = function (source, symbol) {};

          Module.Pd.receiveList = function (source, list) {};

          Module.Pd.receiveMessage = function (source, symbol, list) {};

          // receive midi messages from pd and forward them to WebMidi output
          Module.Pd.receiveNoteOn = function (channel, pitch, velocity) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                output.playNote(pitch, channel, { rawVelocity: true, velocity: velocity });
              }
            }
          };

          Module.Pd.receiveControlChange = function (channel, controller, value) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                output.sendControlChange(controller, value, channel);
              }
            }
          };

          Module.Pd.receiveProgramChange = function (channel, value) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                output.sendProgramChange(value, channel);
              }
            }
          };

          Module.Pd.receivePitchBend = function (channel, value) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                // [bendin] takes 0 - 16383 while [bendout] returns -8192 - 8192
                output.sendPitchBend(value / 8192, channel);
              }
            }
          };

          Module.Pd.receiveAftertouch = function (channel, value) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                output.sendChannelAftertouch(value / 127, channel);
              }
            }
          };

          Module.Pd.receivePolyAftertouch = function (channel, pitch, value) {
            for (var i = 0; i < midiOutIds.length; i++) {
              var output = WebMidi.getOutputById(midiOutIds[i]);
              if (output) {
                output.sendKeyAftertouch(pitch, channel, value / 127);
              }
            }
          };

          Module.Pd.receiveMidiByte = function (port, byte) {};

          // default audio settings
          var numInChannels = 0; // supported values: 0, 1, 2
          var numOutChannels = 2; // supported values: 1, 2
          var sampleRate = 44100; // might change depending on browser/system
          var ticksPerBuffer = 32; // supported values: 4, 8, 16, 32, 64, 128, 256

          // open audio devices, init pd
          if (pd.init(numInChannels, numOutChannels, sampleRate, ticksPerBuffer)) {
            // print obtained settings
            console.log("Pd: successfully initialized");
            console.log("Pd: audio input channels:", pd.getNumInChannels());
            console.log("Pd: audio output channels:", pd.getNumOutChannels());
            console.log("Pd: audio sample rate:", pd.getSampleRate());
            console.log("Pd: audio ticks per buffer:", pd.getTicksPerBuffer());

            // add internals/externals help/search paths
            var helpPath = "purr-data/doc/5.reference";
            var extPath = "purr-data/extra";
            pd.addToHelpPath(helpPath);
            pd.addToSearchPath(extPath);
            pd.addToHelpPath(extPath);
            var dir = FS.readdir(extPath);
            for (var i = 0; i < dir.length; i++) {
              var item = dir[i];
              if (item.charAt(0) != ".") {
                var path = extPath + "/" + item;
                pd.addToSearchPath(path); // externals can be created without path prefix
                pd.addToHelpPath(path);
              }
            }
          } else {
            // failed to init pd
            alert("Pd: failed to initialize pd");
            console.error("Pd: failed to initialize pd");
            Module.mainExit();
          }
        },
        mainLoop: function () {
          // called every frame (use for whatever)
        },
        mainExit: function () {
          // this won't be called from emscripten
          console.error("quiting emscripten...");
          if (typeof Module.pd == "object") {
            Module.pd.clear(); // clear pd, close audio devices
            Module.pd.unsubscribeAll(); // unsubscribe all subscribed sources
            Module.pd.delete(); // quit SDL, emscripten
          }
          if (typeof WebMidi == "object") {
            WebMidi.disable(); // disable all midi devices
          }
        },
      };
Prakhar Agarwal's avatar
Prakhar Agarwal committed
549

Akash Negi's avatar
Akash Negi committed
550
    //Rotate Icon
Prakhar Agarwal's avatar
Prakhar Agarwal committed
551
    function rotate(elmnt) {
552
553
554
555
556
557
558
      switch (elmnt.id) {
        case "console-heading":
          document.getElementById("open-icon").classList.toggle("rotate");
          break;
        case "sidebar-col-icon":
          elmnt.classList.toggle("rotate");
          break;
Prakhar Agarwal's avatar
Prakhar Agarwal committed
559
      }
Akash Negi's avatar
Akash Negi committed
560
561
    }

562
563

      // Add pd module to pd
564

Prakhar Agarwal's avatar
Prakhar Agarwal committed
565
      // Clear Console
566
567
568
569
      document.getElementById("clear").addEventListener("click", function() {
      document.getElementById("p1").innerHTML="";
      });

570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
    </script>

    <!-- Pd Bundle -->
    <script src="dist/bundle.js"></script>

    <script src="index.js"></script>

    <script src="/utils/console_search.js"></script>

    <!-- Emscripten backend -->
    <script src="main.js"></script>

    <!-- Utils -->
    <script src="utils/actions.js"></script>
    <!-- <script src="utils/audio_ctx.js"></script>  -->
    <script src="utils/console_find.js"></script>

    <!-- Components -->
    <script src="components/menu/menu.js"></script>
    <script src="components/canvas/canvas.js"></script>

    <!-- Libs -->
    <!-- Webmidi -->
    <script src="libs/webmidi/webmidi.min.js"></script>

    <!-- jQuery -->
    <script src="libs/jquery/jquery-3.6.0.min.js"></script>
    <!-- jQuery UI -->
    <script src="libs/jquery/jquery-ui.js"></script>

    <!-- Fontawesome -->
    <script src="libs/fa/fontawesome_1b8a796d74.js"></script>

    <!-- Bootstrap -->
    <script src="libs/bootstrap/popper.min.js"></script>
    <script src="libs/bootstrap/bootstrap.min.js"></script>

    <!-- Show modal on load -->
    <script>
      $(document).ready(function () {
        $("#loading-modal").modal("show", { backdrop: "static", keyboard: false });
      });
Prakhar Agarwal's avatar
Prakhar Agarwal committed
612
613
614
615
616
617
618

      var counter = 0;
      $('#reload-i').click(function () {

      counter += 360;
      $('#reload-i').css('transform', 'rotate(' + counter + 'deg)')
      });
619
620
    </script>

621
622
623
624
625
626
627
628
    <script>
      $(document).ready(function(){
        $(document).click(function(){
          var popup = document.getElementById("popup");
          if (popup) {
            popup.parentNode.removeChild(popup);
          }
        });
629
      });
630
    </script>
631

Prakhar Agarwal's avatar
Prakhar Agarwal committed
632
633
634
635
636
637
638
639
640
641
642
643
644
<script>
  $(document).ready(function(){
    // Rearrangable patches
    $("#canvas-container").sortable({
      axis: "x",
      cursor: "move",
      handle: ".patch-filename",
      scroll: false,
      revert: true,
    });
  });
</script>

645
  </body>
Akash Negi's avatar
Akash Negi committed
646
</html>