From 01ef1e7571ad7d2474c9091a895334694e7e5af3 Mon Sep 17 00:00:00 2001 From: Oleh Lafoks Date: Fri, 7 Aug 2026 15:14:51 +0200 Subject: [PATCH] MicGrid: the driver fills the height; even out the cm ladder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Speaker radius 0.40 -> half the height. At 0.40 a tenth of the box was empty above and below the driver — dead space in a component whose whole job is the picture. Distance ladder in cm: 0 1 2 3 5 8 10 15 -> 0 1 2 3 5 7 10 15. The steps now grow monotonically (1 1 1 2 2 3 5); the old one swelled to 3 at the 8 and shrank back to 2, and distance is heard in ratios, so the lumpy rung read as a mistake. Inches are untouched — that ladder was already even. --- include/felitronics/appkit/MicGrid.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/felitronics/appkit/MicGrid.h b/include/felitronics/appkit/MicGrid.h index cbb09c2..f52bbcc 100644 --- a/include/felitronics/appkit/MicGrid.h +++ b/include/felitronics/appkit/MicGrid.h @@ -146,7 +146,9 @@ class MicGrid : public juce::Component { if (dots[(size_t)hits[k]].active) return hits[(k + 1) % hits.size()]; return hits[0]; } - float speakerR() const { return (float)getHeight() * 0.40f; } + // The driver fills the component's height. At 0.40 it left a tenth of the box empty above and + // below it — space that says nothing, in a component whose whole job is the picture. + float speakerR() const { return juce::jmax(1.0f, (float)getHeight() * 0.5f - 3.0f); } float rowY(int r) const { return (float)getHeight() * 0.5f - frac[r] * speakerR(); } float colX(int c) const { const auto& L = ladder(); const float x0 = speakerR() * 2.0f + 96.0f, x1 = (float)getWidth() - 24.0f; return x0 + (float)c / (float)(L.size() - 1) * (x1 - x0); } bool fancy = true; // realistic driver (drawn by Fable 5); set false for the flat fallback @@ -273,7 +275,10 @@ class MicGrid : public juce::Component { } const std::vector& ladder() const { static const std::vector in { 0, .5, 1, 2, 3, 4, 5, 6 }; - static const std::vector cm { 0, 1, 2, 3, 5, 8, 10, 15 }; + // Steps grow monotonically: 1 1 1 2 2 3 5. The old ladder went ...3 5 8 10..., where the + // gap swelled to 3 and then shrank back to 2 — distance is heard in ratios, and the lumpy + // rung read as a mistake. + static const std::vector cm { 0, 1, 2, 3, 5, 7, 10, 15 }; return unit == "in" ? in : cm; } juce::String distLabel(double v) const {