-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
143 lines (127 loc) · 3.99 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>MIDI-CH Guitar</title>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style media="screen">
#FileDrop {
position: relative;
left: 0;
width: 75%;
height: 100px;
border: 2px dashed black;
color: black;
margin: 20px auto;
}
#FileDrop.Hover {
background-color: black;
color: white;
}
#FileDrop input {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
left: 0px;
top: 0px;
}
#FileDrop #Text {
position: absolute;
width: 100%;
height: 20px;
line-height: 20px;
left: 0px;
top: 50%;
transform: translate(0, -50%);
text-align: center;
}
textarea {
font-family: monospace;
height: 300px;
width: 100%;
display: inline-block;
position: relative;
float: left;
}
#Results {
position: relative;
width: 100%;
margin: 10px auto;
}
#container {
position: fixed;
width: 75%;
left: 0;
top: 0;
height: 100%;
overflow-y: scroll;
}
button {
margin-bottom: 0.2em;
}
canvas {
position: fixed;
top: 0;
right: 0;
}
.notesPreview {
position: relative;
}
#help {
padding-left: 1em;
font-size: 1.2em;
position: absolute;
top: 1em;
}
</style>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tone/13.0.1/Tone.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/@tonejs/midi"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.2/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js"></script>
<div id='container'>
<div id='help'><a target="_blank" href='https://github.com/efhiii/midi-ch/'><b>Help</b></a><br><a target="_blank" href='https://efhiii.github.io/midi-ch/drums/'><b>Drums</b></a><br><a target="_blank" href='https://efhiii.github.io/midi-ch/lyrics/'><b>Lyrics</b></a><br><a target="_blank" href='https://discord.gg/jepY2DkJkZ'><img src='Discord-Logo-Color.svg' style='width: 2em'></a></div>
<div id="FileDrop">
<div id="Text">
Drop a midi file here
</div>
<input type="file" accept="audio/midi">
</div>
<div id='htmlContent' class='container'></div>
</div>
<script>
let MINIMAL = false;
// run this ASAP to improve user experience (sets form fields based on URL parameters)
(new URL(window.location.href)).searchParams.forEach((x, y) =>
y === 'minimal' ? MINIMAL = true : '')
//if(MINIMAL){
// document.getElementById('help').innerHTML+="<br><a href='?'><b>Normal</b>";
//}
//else{
// document.getElementById('help').innerHTML+="<br><a href='?minimal'><b>Minimal</b>";
//}
</script>
<!--p5.js code-->
<script src="script.js" type="text/javascript"></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', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-104506442-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>