Inverse the change speed to be based on -60 decibels.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
857d0a4cf2
commit
59d6572775
@ -6,6 +6,7 @@ import java.awt.Color;
|
|||||||
public class SpectrographBar {
|
public class SpectrographBar {
|
||||||
final float NO_UPDATE = 999f;
|
final float NO_UPDATE = 999f;
|
||||||
float current_magnitude = 0.0f;
|
float current_magnitude = 0.0f;
|
||||||
|
final double CHANGE_SPD = 1.05d;
|
||||||
SpectrographBar() {
|
SpectrographBar() {
|
||||||
this(0f);
|
this(0f);
|
||||||
}
|
}
|
||||||
@ -17,10 +18,10 @@ public class SpectrographBar {
|
|||||||
}
|
}
|
||||||
public void update(float value) {
|
public void update(float value) {
|
||||||
if (value==NO_UPDATE) {
|
if (value==NO_UPDATE) {
|
||||||
if (Math.abs(current_magnitude)>1f) {
|
if (current_magnitude>-59.7f) {
|
||||||
current_magnitude/=1.01f;
|
current_magnitude=(float)(CHANGE_SPD/(-60-current_magnitude)+current_magnitude);
|
||||||
} else {
|
} else {
|
||||||
current_magnitude=0;
|
current_magnitude=-60f;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_magnitude=value;
|
current_magnitude=value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user