channel strip visualiser for highpass

This commit is contained in:
minjaesong
2023-11-26 14:37:22 +09:00
parent cc4fac7dca
commit 3b38958a08
3 changed files with 26 additions and 5 deletions

View File

@@ -130,12 +130,14 @@ object AudioMixer: Disposable {
it.addSidechainInput(sfxMixTrack, 1.0)
}
convolveBusOpen.filters[0] = Convolv(ModMgr.getFile("basegame", "audio/convolution/EchoThief - Cranbrook Art Museum.bin"))
convolveBusOpen.filters[1] = Gain(decibelsToFullscale(21.0).toFloat())
convolveBusOpen.filters[0] = Highpass(80f)
convolveBusOpen.filters[1] = Convolv(ModMgr.getFile("basegame", "audio/convolution/EchoThief - Cranbrook Art Museum.bin"))
convolveBusOpen.filters[2] = Gain(decibelsToFullscale(18.0).toFloat())
convolveBusOpen.volume = 0.5
convolveBusCave.filters[0] = Convolv(ModMgr.getFile("basegame", "audio/convolution/EchoThief - CedarCreekWinery.bin"))
convolveBusCave.filters[1] = Gain(decibelsToFullscale(18.0).toFloat())
convolveBusCave.filters[0] = Highpass(80f)
convolveBusCave.filters[1] = Convolv(ModMgr.getFile("basegame", "audio/convolution/EchoThief - CedarCreekWinery.bin"))
convolveBusCave.filters[2] = Gain(decibelsToFullscale(18.0).toFloat())
convolveBusCave.volume = 0.5
fadeBus.addSidechainInput(sumBus, 1.0 / 3.0)
@@ -187,6 +189,14 @@ object AudioMixer: Disposable {
it.pan = (it.pan - 0.001f).coerceIn(-1f, 1f)
}
}*/
if (Gdx.input.isKeyPressed(Input.Keys.UP)) {
convolveBusOpen.volume = (convolveBusOpen.volume + 0.001).coerceIn(0.0, 1.0)
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
}
else if (Gdx.input.isKeyPressed(Input.Keys.DOWN)) {
convolveBusOpen.volume = (convolveBusOpen.volume - 0.001).coerceIn(0.0, 1.0)
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
}

View File

@@ -20,7 +20,7 @@ class TerrarumAudioMixerTrack(val name: String, val isMaster: Boolean = false, v
const val SAMPLING_RATE = 48000
const val SAMPLING_RATEF = 48000f
const val SAMPLING_RATED = 48000.0
const val BUFFER_SIZE = 16384 // n ms -> 384 * n
const val BUFFER_SIZE = 65536 // n ms -> 384 * n
}
val hash = getHashStr()

View File

@@ -600,6 +600,7 @@ class BasicDebugInfoWindow : UICanvas() {
private val paramViewHeight = hashMapOf(
"Lowpass" to 16,
"Highpass" to 16,
"Buffer" to 16,
"BinoPan" to 32,
"Convolv" to 16,
@@ -622,6 +623,16 @@ class BasicDebugInfoWindow : UICanvas() {
batch.color = FILTER_NAME_ACTIVE
App.fontSmallNumbers.draw(batch, "F:${filter.cutoff.toInt()}", x+3f, y+1f)
}
is Highpass -> {
val perc = 1f - linToLogPerc(filter.cutoff, 2.0, 24000.0).toFloat()
batch.color = COL_METER_GRAD2
Toolkit.fillArea(batch, x.toFloat() + stripW, y.toFloat(), -stripW * perc, 14f)
batch.color = COL_METER_GRAD
Toolkit.fillArea(batch, x.toFloat() + stripW, y+14f, -stripW * perc, 2f)
batch.color = FILTER_NAME_ACTIVE
App.fontSmallNumbers.draw(batch, "F:${filter.cutoff.toInt()}", x+3f, y+1f)
}
is BinoPan -> {
val w = filter.pan * 0.5f * stripW
batch.color = COL_METER_GRAD2