spectrogram on the scope

This commit is contained in:
minjaesong
2023-12-21 20:51:00 +09:00
parent fefdf44e3e
commit 3a814955d0
2 changed files with 79 additions and 11 deletions

View File

@@ -414,6 +414,13 @@ class BasicDebugInfoWindow : UICanvas() {
val FILTER_NAME_ACTIVE = Color(0xeeeeee_bf.toInt())
val FILTER_BYPASSED = Color(0xf1b934_bf.toInt())
fun getSmoothingFactor(sampleCount: Int) = (1.0 - (256.0 / sampleCount))
val PEAK_SMOOTHING_FACTOR = getSmoothingFactor(640)
val FFT_SMOOTHING_FACTOR = getSmoothingFactor(960)
val LAMP_SMOOTHING_FACTOR = getSmoothingFactor(3200)
val RMS_SMOOTHING_FACTOR = getSmoothingFactor(12000)
}
private val halfStripW = STRIP_W / 2
@@ -466,11 +473,6 @@ class BasicDebugInfoWindow : UICanvas() {
private val oldRMS = Array(trackCount) { arrayOf(0.0, 0.0) }
private val oldComp = Array(trackCount) { arrayOf(0.0, 0.0) }
private fun getSmoothingFactor(sampleCount: Int) = 1.0 - (AUDIO_BUFFER_SIZE.toDouble() / sampleCount)
private val PEAK_SMOOTHING_FACTOR = getSmoothingFactor(640)
private val LAMP_SMOOTHING_FACTOR = getSmoothingFactor(3200)
private val RMS_SMOOTHING_FACTOR = getSmoothingFactor(12000)
val miniW = 28
val miniH = 35
private val LAMP_OVERRANGE = Color(0xff6666aa.toInt())