-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArduinoToneComposer.html
More file actions
175 lines (166 loc) · 5.5 KB
/
Copy pathArduinoToneComposer.html
File metadata and controls
175 lines (166 loc) · 5.5 KB
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
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<style>
:root{
--bg-color:#222;
--draw-color:#bbb;
}
body{
background-color:var(--bg-color);
color:var(--draw-color);
font-size: 20;
}
a{
color:var(--draw-color);
}
button {
font-size: 15px;
margin: 5px;
cursor: pointer;
background-color:var(--draw-color);
color: var(--bg-color);
padding: 10px 20px;
}
table,td,th{
font-size:20;
}
input{
padding: 5px 10px;
border: 2px solid var(--draw-color);
border-radius: 10px;
background-color: var(--bg-color);
color: var(--draw-color);
}
input:focus{
background-color: var(--draw-color);
color:var(--bg-color);
}
.checkboxcontainer {
display: block;
position: relative;
padding-left: 40px;
padding-bottom: 10px;
cursor: pointer;
font-size: 20px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.checkboxcontainer input {
position: absolute;
opacity: 0;
height: 0;
width: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 30px;
width: 30px;
background-color: var(--draw-color);
}
.checkboxcontainer:hover input ~ .checkmark {
background-color: var(--draw-color);
}
.checkboxcontainer input:checked ~ .checkmark {
background-color: var(--draw-color);
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.checkboxcontainer input:checked ~ .checkmark:after {
display: block;
}
.checkboxcontainer .checkmark:after {
left: 11px;
top: 7px;
width: 5px;
height: 10px;
border: solid #000000;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.checkboxtextcenter{
position:relative;
top:3px;
}
.slideinp {
-webkit-appearance: none;
width: 75%;
height: 1px;
background: #bbbbbb;
opacity: 0.75;
-webkit-transition: .4s;
transition: opacity .4s;
}
.slideinp:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
background: #222222;
cursor: pointer;
}
.slideinp::-moz-range-thumb {
width: 20px;
height: 20px;
background: #222222;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Arduino tone() composer</h1>
<p>This is a small javascript based webapp by <a href="https://baut.club/">Baut</a> to compose melodies with a graphical user interface.
You can find the repository with the code <a href="https://github.com/IAmBaut/ArduinoToneComposer">on github</a> or <a href="https://gitlab.com/Baut/arduinotonecomposer">on gitlab</a>. You can also download it locally as a .html file from the repo, to allow for easy modification of code and to use the webapp locally/offline.
</p>
<p>It needs JavaScript to run, so while most of the site has optional JavaScript, this webapp does not.
If you want to use it and have JavaScript disabled with extensions or similar, please turn it on again.</p>
<p>The webapp might struggle/misbehave with mobile devices or any devices that have weird aspect ratios.</p>
<hr>
<br>
<table style="width:100%">
<tr>
<td>Volume: <input type="range" class="slideinp" min="1" max="100" value="50" id="volsliderinp"></td>
<td>Note duration[ms]: <input id="notedurinp" ></td>
<td>Amount of notes: <input id="repsinp" ></td>
</tr>
<tr>
</table>
<br style="line-height: 20px;">
<table style="width:100%">
<tr>
<td><button type="button" id="resetbt">RESET</button></td>
<td><button type="button" id="expbt">ExportSong</button></td>
<td><button type="button" id="impbt">ImportSong</button></td>
<td><button type="button" id="expcbt">Export Code</button></td>
<td><button type="button" id="playbt">Play Audio</button></td>
<td><label class="checkboxcontainer"><div class="checkboxtextcenter">LOOP</div><input type="checkbox" id="loopbool" ><span class="checkmark"></span></label></td>
<td><label class="checkboxcontainer"><div class="checkboxtextcenter">Combine tones</div><input type="checkbox" id="combinebool"><span class="checkmark"></span></label></td>
</tr>
</table><br>
<canvas id="toneoverlay" width="32" height="800" style="border:1px solid #000000;position:absolute;float: left;z-index:4;">
It seems like your browser does not support the HTML canvas tag. Sorry.
</canvas>
<div class="wrapper" id="toolwrapper" style="overflow-x: auto;overflow-y: hidden; position: relative; width: 100%; height:820px;">
<canvas id="gridcanv" width="1600" height="800" style="border:1px solid #000000;position: absolute; top: 0px; left: 0px;z-index:2;">
It seems like your browser does not support the HTML canvas tag. Sorry.
</canvas>
<canvas id="tonecompcanv" width="1600" height="800" style="border:1px solid #000000;position: absolute; top: 0px; left: 0px;z-index:3;">
It seems like your browser does not support the HTML canvas tag. Sorry.
</canvas>
</div>
<script src="ArduinoToneComposer_optimized.js"></script>
</body>
</html>