From e159b76e0d615e015a0863dd3c380216a952512b Mon Sep 17 00:00:00 2001 From: Armin Date: Mon, 6 Jul 2026 18:09:41 +0200 Subject: [PATCH] Add peak hold decay rate selector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new dropdown to control how fast the peak-hold line decays on the live spectrum. Options: Off — peaks never decay (manual reset only) Slow — slow fade (0.005/frame) Medium — moderate fade (0.015/frame, matches previous fixed rate) Fast — quick fade (0.03/frame) Previously the decay rate was hardcoded at 0.015/frame. --- index.html | 6 ++++++ js/app.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 5f08161..17f4aea 100644 --- a/index.html +++ b/index.html @@ -32,6 +32,12 @@ 0:00.0 / 0:00.0 +
diff --git a/js/app.js b/js/app.js index 0943fce..2960e9f 100644 --- a/js/app.js +++ b/js/app.js @@ -616,7 +616,9 @@ const App = { ctx.stroke(); if (this.holdPeaks) { - const decay = 0.015; + const decaySel = document.getElementById('peakHoldDecay'); + const decayMap = { off: 0, slow: 0.005, medium: 0.015, fast: 0.03 }; + const decay = decaySel ? (decayMap[decaySel.value] ?? 0.015) : 0.015; ctx.beginPath(); let started = false; for (let x = 0; x < chartW; x++) {