again, more tuning
This commit is contained in:
parent
4646032e60
commit
dbaaf3edb4
@ -67,7 +67,7 @@ public class AudioAnalyzer {
|
||||
bassThresholdMultiplier = 2.6f;
|
||||
umThresholdMultiplier = 2f;
|
||||
|
||||
bassBinBegin = 7;
|
||||
bassBinBegin = 1;
|
||||
bassBinEnd = 20;
|
||||
|
||||
UMBinBegin = 300;
|
||||
@ -110,8 +110,13 @@ public class AudioAnalyzer {
|
||||
//bass detection
|
||||
fluxVal = 0;
|
||||
for (int i = bassBinBegin; i < bassBinEnd && work; i++) {
|
||||
fluxVal += ((spectrum[i] - lastSpectrum[i])) < 0
|
||||
? 0 : (spectrum[i] - lastSpectrum[i]);
|
||||
if (spectrum[i] >= 0) {
|
||||
fluxVal += ((spectrum[i] - lastSpectrum[i])) < 0
|
||||
? 0 : (spectrum[i] - lastSpectrum[i]);
|
||||
} else {
|
||||
fluxVal += ((spectrum[i] - lastSpectrum[i])) < 0
|
||||
? 0 : (spectrum[i] - lastSpectrum[i]);
|
||||
}
|
||||
}
|
||||
bassSpectralFlux.add(fluxVal);
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
int warningTime = (int) ((3/speedMod)*windowPerSecond);
|
||||
if ((index+warningTime <= bassPeaks.size) && bassPeaks.get(index + warningTime) >= avgBass) {
|
||||
//TODO basic void circle spawning
|
||||
float endRadius = overlappedPeaks.get(index + warningTime)*Polyjet.GAME_AREA_HEIGHT;
|
||||
float endRadius = overlappedPeaks.get(index + warningTime)*Polyjet.GAME_AREA_HEIGHT/4;
|
||||
|
||||
map.addToMap(Entities.VOID_CIRCLE,
|
||||
endRadius,
|
||||
@ -77,8 +77,6 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
Polyjet.GAME_AREA_HEIGHT-0.25f,
|
||||
180*rand.nextFloat()+90,
|
||||
speedMod*(1f/avgBPS));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user