From 59d65727758032f3286b0cfe5f301a9c30b36a2a Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Tue, 12 Oct 2021 03:10:39 +0000 Subject: [PATCH] Inverse the change speed to be based on -60 decibels. Co-authored-by: sigonasr2 --- LLSIG/src/main/java/LLSIG/SpectrographBar.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LLSIG/src/main/java/LLSIG/SpectrographBar.java b/LLSIG/src/main/java/LLSIG/SpectrographBar.java index 226d3ca..93bec57 100644 --- a/LLSIG/src/main/java/LLSIG/SpectrographBar.java +++ b/LLSIG/src/main/java/LLSIG/SpectrographBar.java @@ -6,6 +6,7 @@ import java.awt.Color; public class SpectrographBar { final float NO_UPDATE = 999f; float current_magnitude = 0.0f; + final double CHANGE_SPD = 1.05d; SpectrographBar() { this(0f); } @@ -17,10 +18,10 @@ public class SpectrographBar { } public void update(float value) { if (value==NO_UPDATE) { - if (Math.abs(current_magnitude)>1f) { - current_magnitude/=1.01f; + if (current_magnitude>-59.7f) { + current_magnitude=(float)(CHANGE_SPD/(-60-current_magnitude)+current_magnitude); } else { - current_magnitude=0; + current_magnitude=-60f; } } else { current_magnitude=value;