-
Notifications
You must be signed in to change notification settings - Fork 5
/
shell.html
187 lines (175 loc) · 6.09 KB
/
shell.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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=920, initial-scale=0.25, maximum-scale=2, minimum-scale=0.25, user-scalable=yes" />
<meta name="description" content="Online DSP lookup table generator">
<meta name="keywords" content="sine, dsp, lut, lookup, table, online, generator, c, cpp, array, tool, waveform, wave">
<meta name="author" content="ppelikan">
<meta name="google-site-verification" content="8eScz_wnJqW2UHdCMY4pfsz7Txo16U7EEElYnk7noVA" />
<title>Dr LUT</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<style>
body {
margin: 0;
background-color: #141d22;
color: #56a7dd;
font: normal 14px Arial, sans-serif;
}
a:link,
a:visited {
color: #669;
}
.emscripten {
position: inherit;
overflow: hidden;
display: block;
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
image-rendering: crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
z-index: 1000;
}
.description {
width: max-content;
}
#forkongithub a {
background: #669;
color: #fff;
text-decoration: none;
font: bold 0.8rem Arial, sans-serif;
text-align: center;
padding: 5px 40px;
line-height: 1.5rem;
position: relative;
transition: 0.15s;
}
#forkongithub a:hover {
background: #0a0;
color: #fff;
padding: 5px 40px;
font-size: 0.95rem;
}
#forkongithub a::before,
#forkongithub a::after {
content: "";
width: 100%;
display: block;
position: absolute;
top: 3px;
left: 0;
height: 1px;
background: #bbb;
}
#forkongithub a::after {
bottom: 3px;
top: auto;
}
@media screen and (min-width:800px) {
#forkongithub {
position: fixed;
display: block;
top: 0;
right: 0;
width: 200px;
overflow: hidden;
height: 200px;
z-index: 9999;
}
#forkongithub a {
width: 150px;
position: absolute;
top: 38px;
right: -65px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.8);
padding: 2px 40px;
}
}
</style>
</head>
<body>
<textarea id="clipboard_text_aera" type=hidden
style="width:0;height:0;border:0;resize:none;margin-top:-60px;position:absolute;" aria-hidden="true"></textarea>
<span id="forkongithub"><a href="https://github.com/ppelikan/drlut">Fork me on GitHub</a></span>
<center>
<h1>Dr LUT</h1>
<h2>Online DSP Lookup Table Generator<br>
<small>(sine wave LUT calculator)</small></h2>
Write any math expression to get a generated C/C++ file with the data array inside.<br><br>
<div class="emscripten_border">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" width="900" height="600"></canvas>
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: [],
print: (function () {
return function (text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
};
})(),
printErr: function (text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function () {
var canvas = document.getElementById('canvas');
//canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
return canvas;
})(),
setStatus: function (text) {
console.log("status: " + text);
},
monitorRunDependencies: function (left) {
// no run dependencies to log
}
};
window.onerror = function () {
console.log("onerror: " + event);
};
</script>
{{{ SCRIPT }}}
</div>
<br><br>
<div class="description" align="left">
<center><big><b>Tips:</b></big></center><br>
When composing complex formulas, switch to the<code> float </code>data type first to avoid confusion.<br><br>
Use the <code> Ctrl </code> key while clicking a<code> + </code>or<code> - </code>buttons for a bigger increment or decrement
step.<br><br>
Right click on the plot to see more options.<br>
When the auto fit option is disabled, double click on the plot to auto fit the view.<br><br>
Use negative amplitude values to mirror vertically the wave shape.<br><br><br>
<center><big><b>Supported formula expressions:</b></big></center><br>
<b>Variables:</b><br>
<code>t </code>- current sample index (from<code> 0 </code>to array size-1)<br>
<code>T </code>- number of samples per one period<br>
<code>rand </code>- fresh random number (from<code> -1.0 </code>to<code> 1.0</code>)<br><br>
<b>Constants:</b><br>
<code>pi, e</code><br><br>
<b>Functions:</b><br>
<code>abs(x), acos(x), asin(x), atan(x), atan2(x,y), ceil(x), cos(x),<br>
cosh(x), exp(x), fac(x), floor(x), ln(x), log(x), log10(x), ncr(x,y),<br>
npr(x,y), pow(x,y), sin(x), sinh(x), sqrt(x), step(x), tan(x), tanh(x)</code>.<br><br>
<b>Operators:</b><br>
<code>+, -, *, /, ^, %, (, ), , </code><br><br>
</div>
<br>
<br>
<a target="_blank" rel="noopener noreferrer"
href="https://github.com/ppelikan/drlut">https://github.com/ppelikan/drlut</a>
<small><br><br>
Copyright (c) <script>document.write(new Date().getFullYear())</script> by ppelikan
</small><br><br>
</center>
</body>
</html>