-
Notifications
You must be signed in to change notification settings - Fork 6
/
wml.html
63 lines (59 loc) · 1.82 KB
/
wml.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
<!doctype html>
<html lang="en" data-bs-theme="auto">
<head>
<meta charset="utf-8" />
<meta http-equiv="Access-Control-Allow-Origin" content="*" />
<meta http-equiv="Access-Control-Allow-Methods" content="GET" />
<meta http-equiv="Access-Control-Allow-Headers" content="*" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" />
<meta name="color-scheme" content="light dark" />
<title>Web Midi Link</title>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-2Y2FW3QEG4"
></script>
<!-- Google Tag Manager -->
<script type="module">
if (import.meta.env.VITE_GOOGLE_ANALYTICS_ID) {
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', import.meta.env.VITE_GOOGLE_ANALYTICS_ID);
}
</script>
</head>
<body>
<div class="container-fluid">
<main>
<div id="placeholder"></div>
</main>
</div>
<script type="module">
import SoundFont from '@logue/sf2synth';
import '@logue/sf2synth/dist/style.css';
/** sf2synth.js Option */
const options = {
// Show Keyboard
drawSynth: true,
// Target dom id
placeholder: 'placeholder',
// Color Mode (auto, dark, light)
colorMode: 'auto',
};
console.log(options);
document.addEventListener(
'DOMContentLoaded',
event => {
/** @type {typeof import("./src/wml").WebMidiLink } WebMidiLink */
const wml = new SoundFont.WebMidiLink(options);
wml.setup(import.meta.env.VITE_SOUNDFONT_URL);
},
false
);
</script>
</body>
</html>