visualizer tuning
This commit is contained in:
parent
c70d161337
commit
08fb879b1f
@ -38,7 +38,7 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
pixmap.setColor(Color.WHITE);
|
||||
pixmap.fill();
|
||||
barCount = 70;
|
||||
smoothRange = 2;
|
||||
smoothRange = 3;
|
||||
angleRot = new Vector2(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation));
|
||||
bars = new Sprite[barCount];
|
||||
barHeights = new float[barCount];
|
||||
@ -91,9 +91,9 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
barHeights[i] = avg;
|
||||
currentAvg += barHeights[i];
|
||||
if (bars[i].getHeight() > barHeights[i]) {
|
||||
bars[i].setSize(barWidth, bars[i].getHeight() - (20f*delta*(bars[i].getHeight()-barHeights[i])));
|
||||
bars[i].setSize(barWidth, bars[i].getHeight() - (15f*delta*(bars[i].getHeight()-barHeights[i])));
|
||||
} else {
|
||||
bars[i].setSize(barWidth, bars[i].getHeight() + (27f*delta*(barHeights[i] - bars[i].getHeight())));
|
||||
bars[i].setSize(barWidth, bars[i].getHeight() + (20f*delta*(barHeights[i] - bars[i].getHeight())));
|
||||
}
|
||||
}
|
||||
currentAvg /= barHeights.length;
|
||||
@ -106,7 +106,7 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
public void setMM(MusicManager mm) {
|
||||
maxAvgHeight = 0;
|
||||
currentAvg = 0;
|
||||
float validBins = (5000/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
|
||||
float validBins = (1700/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
|
||||
Gdx.app.debug("Visualizer", "valid frequency bins " + validBins);
|
||||
binsPerBar = MathUtils.round((validBins/barCount));
|
||||
barHeights = new float[barCount];
|
||||
@ -120,7 +120,7 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
}
|
||||
|
||||
public void updatePositionInfo() {
|
||||
barHeightMultiplier = height*0.032f;
|
||||
barHeightMultiplier = height*0.03f;
|
||||
int barSpace = 0;
|
||||
angleRot.set(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user