Files
mm-d-flat/index.html
T
MindfulMinun d4fcdb5f12 Fixed a handful of audio glitches!!
Glitches mainly caused by assuming output array is empty.
It's not empty, it contains the samples of the previous chunk

- Integral and derivative processors no longer "click"
- Overlap no longer screams.
- Zero processor
2020-08-05 01:18:21 -05:00

232 lines
9.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<!--
Made with love by MindfulMinun
https://benjic.xyz
-->
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
<title>D♭</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#1e1e1e">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<style media="screen">
*, *::before, *::after { box-sizing: border-box; }
:root {
--input-color: rgb(255 255 255 / .52);
--input-border: #424242;
}
html, body {
font-family: "Roboto", Helvetica, Arial, sans-serif;
line-height: 1.15;
height: 100%;
margin: 0;
color: white;
background-color: black;
}
body { display: flex; }
a[href] { color: var(--accent); }
input, audio {
display: block;
margin: 1em 0;
}
audio {
width: 100%;
}
button {
/* display: inline-block;
background: 0; border: 0; font: inherit; color: inherit;
border: 1px solid #727272;
padding: .25em .5em;
cursor: pointer; */
background: 0; border: 0; font: inherit;
color: var(--input-color);
font-size: 87.5%;
border: 2px solid var(--input-border);
outline: 0;
padding: .5em .75em;
}
select {
/* background: 0; border: 0; font: inherit; color: inherit; */
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background: 0;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzU0NTQ1NCI+PHBhdGggZD0iTTcgMTBsNSA1IDUtNXoiPjwvcGF0aD48L3N2Zz4=);
background-position: right 50%;
background-repeat: no-repeat;
outline: 0;
border: 2px solid var(--input-border);
border-radius: 0;
color: var(--input-color);
font: inherit;
font-size: 87.5%;
/* padding: .5em 1.5em .5em 1em; */
padding: .5em 1.5em .5em .5em;
min-width: 120px;
}
option { color: initial; }
option[disabled] { color: rgb(0 0 0 / .3); }
button:focus,
select:focus {
border-color: #448aff;
}
button, select {
backdrop-filter: blur(2px);
}
canvas {
position: fixed;
top: 0; left: 0; bottom: 0; right: 0;
width: 100%;
height: 100%;
background-color: #000;
}
.container {
width: 840px;
max-width: 100%;
margin: 0 auto;
padding: 1em;
z-index: 1;
}
.warn {
border: 2px solid red;
padding: 0 1em;
}
.spacer {
/* height: 90vh; */
height: 1000px;
height: 90vh;
height: calc(100vh - 6rem);
}
.credits {
text-align: center;
font-style: italic;
margin: 3rem auto;
opacity: .5;
}
</style>
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
onload="renderMathInElement(document.body, {
fleqn: true,
delimiters: [
{ left: '$$', right: '$$', display: true },
{ left: '$', right: '$', display: false }
]
});"></script> -->
</head>
<body>
<canvas></canvas>
<div class="container">
<div class="warn">
<p>
There’s currently a bug in Chrome that causes the <code>subtract-overlap</code> filter to glitch and scream.
Refrain from using it, it’ll hurt your years X(
</p>
<p>(This glitch doesn’t occur in Firefox, so maybe try that instead :) )</p>
</div>
<p>
Drag and drop an audio file anywhere or <button id="choose">choose one from your filesystem.</button>
</p>
<p>
<label>
Filter:
<select id="processorSelect">
<option value="noop" selected>noop</option>
<option value="derivative">derivative</option>
<option value="integral">integral</option>
<option value="subtract-overlap">subtract-overlap</option>
<option value="isolate-overlap" disabled>isolate-overlap</option>
<option value="bit-crusher-sr8">bit-crusher-sr8 (Sample-rate reduction)</option>
<option value="bit-crusher-res">bit-crusher-res (bit-depth reduction)</option>
<option value="bit-crusher-both">bit-crusher-both</option>
<option value="mono">mono</option>
<option value="zeroes">zeroes</option>
</select>
</label>
<label>
Visualizer:
<select id="visualizerSelect">
<option value="0" selected>Oscilloscope</option>
<option value="1">Linear spectrogram</option>
</select>
</label>
</p>
<audio controls></audio>
<ul>
<li>
<code>noop</code>
<p>Leaves the audio unchanged.</p>
</li>
<li>
<code>derivative</code>
<p>
Approximates the first derivative of the audio as a function respect to time.
Sounds like a <strong>high-pass filter</strong>.
</p>
</li>
<li>
<code>integral</code>
<p>
Approximates the first integral of the audio as a function respect to time. Plus C of zero. Sounds like a <strong>low-pass filter</strong>.
</p>
</li>
<li>
<code>subtract-overlap</code>
<p>Inverts the amplitude of every even-numbered channel and merges all channels to mono. This effectively cancels the sounds the left and right channels share in common. Quick-and-dirty way of removing vocals.</p>
</li>
<li>
<code>isolate-overlap</code>
<p>The opposite of subtract-overlap. You think it'd be simple but I can't get it to work :/</p>
</li>
<!-- bit-crusher-sr8
bit-crusher-res -->
<li>
<code>bit-crusher-sr8</code>
<p>Bitcrusher. Works by taking the average of 8 samples of the input and setting that average as the output for those 8 samples, effectively <strong>reducing the sampling rate</strong>.</p>
</li>
<li>
<code>bit-crusher-res</code>
<p>Bitcrusher. Works by <strong>reducing the resolution of each sample</strong> from a 32-bit float to a 8-bit float.</p>
</li>
<li>
<code>bit-crusher-both</code>
<p>Bitcrusher. Combines the output of bit-crusher-sr8 and bit-crusher-res.</p>
</li>
<li>
<code>mono</code>
<p>
Converts the audio to mono by taking the arithmetic average of the samples of each channel.
</p>
</li>
<li>
<code>zeroes</code>
<p>Outputs no sound.</p>
</li>
</ul>
<p class="credits">
Made with :3c by <a href="https://benjic.xyz">MindfulMinun</a>
•
<a href="https://github.com/MindfulMinun/d-flat">Source code</a>
</p>
<div class="spacer"></div>
</div>
<input id="file" type="file" hidden>
<script src="./dist/main.js"></script>
</body>
</html>