mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
spectrometer slope is now 10dB/decade, which makes pink noise to appear flat
This commit is contained in:
@@ -1203,7 +1203,7 @@ class MusicPlayerControl(private val ingame: TerrarumIngame) : UICanvas() {
|
||||
// apply slope to the fft bins, also converts fullscale to decibels
|
||||
for (bin in binHeights.indices) {
|
||||
val freqR = (TerrarumAudioMixerTrack.SAMPLING_RATED / FFTSIZE) * (bin + 1)
|
||||
val magn0 = fftOut.reim[2 * bin].absoluteValue / FFTSIZE * (freqR / 20.0) // apply slope
|
||||
val magn0 = fftOut.reim[2 * bin].absoluteValue / FFTSIZE * freqR.sqrt() // apply slope
|
||||
val magn = FastMath.interpolateLinear(FFT_SMOOTHING_FACTOR, magn0, oldFFTmagn[bin])
|
||||
val magnLog = fullscaleToDecibels(magn) - dbOffset
|
||||
|
||||
|
||||
Reference in New Issue
Block a user