diff --git a/index.html b/index.html index 17f4aea..2929eed 100644 --- a/index.html +++ b/index.html @@ -38,6 +38,12 @@ +
diff --git a/js/app.js b/js/app.js index 2960e9f..1ee761b 100644 --- a/js/app.js +++ b/js/app.js @@ -668,6 +668,13 @@ const App = { const nyquist = sr / 2; const cutoffHz = (cutoffBin / len) * nyquist; if (cutoffHz > this.cutoffMaxHz) this.cutoffMaxHz = cutoffHz; + const falloffSel = document.getElementById('cutoffFalloff'); + if (falloffSel && falloffSel.value !== 'off' && this.isPlaying && cutoffHz < this.cutoffMaxHz) { + const falloffMap = { slow: 0.01, medium: 0.03, fast: 0.08 }; + const rate = falloffMap[falloffSel.value] ?? 0; + const gap = this.cutoffMaxHz - cutoffHz; + if (gap > 1) this.cutoffMaxHz -= gap * rate; + } const displayHz = this.cutoffHold && this.cutoffMaxHz > 0 ? this.cutoffMaxHz : cutoffHz; const displayBin = Math.round((displayHz / nyquist) * len);