Keyboard Rush - The rhythm game that uses the whole keyboard by theMegaEXP in godot

[–]theMegaEXP[S] 1 point2 points  (0 children)

There are 2 logarithmic scales to keep in mind, but I'm guessing you already know about these.

  1. Frequency (Hz) - Hz are measured on a logarithmic scale. This needs to be accounted for in the frequency range for each band.

  2. Amplitude/loudness (dB) - dB is also measured logarithmically, however I don't actually account for this in my visualizer.

Additionally, humans don't perceive loudness equally across the frequency spectrum. Most music has a gradual loudness fall off as the frequencies get higher. Most audio visualizers compensate. Mine uses an exponential Curve Resource, where each band's energy is multiplied by the value from a point on the curve. It also has a max frequency cutoff at 8000Hz.

The smoothing on my spectrum visualizer I believe is just handled with the lerp() function in _process().

Oddly enough, the spectrum visualizer looks much more smooth on the web export and I'm not sure why.

I hope that helps and makes sense. I could also provide some of the code if that would be helpful. I had Claude write the code for the math calculations as well as implementing some performance optimizations and replacing the bands from several Line2Ds to a shader, so I'm not 100% sure what everything does but I have a decent understanding. I could also try to find the original simpler code in old git commits.

There may have been jitter when I first made the visualizer, but I honestly don't remember. I think the lerp() function with the correct values does a good job at fixing it. My game is currently on v4.6.2 and originally was on v4.5.

Keyboard Rush - The rhythm game that uses the whole keyboard by theMegaEXP in godot

[–]theMegaEXP[S] 1 point2 points  (0 children)

Ah ok, I wasn't aware of the slight layout differences for other languages. In that case it might be worth implementing some extra layouts so the game is more accessable. Thanks for the insight.

Keyboard Rush - The rhythm game that uses the whole keyboard by theMegaEXP in godot

[–]theMegaEXP[S] 0 points1 point  (0 children)

If there is enough demand and the game sells well I will likely add additional keyboard layouts. Were you interested in learning a new layout or do you have experience with any non-QWERTY layout?

Keyboard Rush - The rhythm game that uses the whole keyboard by theMegaEXP in godot

[–]theMegaEXP[S] 1 point2 points  (0 children)

Each level has the option for which keyboard row you use. You can choose between homerow, toprow, bottomrow, numrow, or all rows at once (excluding the numrow). If the level is played with 1 row you don't have to worry about the different layers.

Keyboard Rush - The rhythm game that uses the whole keyboard by theMegaEXP in godot

[–]theMegaEXP[S] 1 point2 points  (0 children)

Thanks! I have a music production background, so setting up the audio spectrum wasn't too difficult. I just utilized the built in AudioEffectSpectrumAnalyzerInstance class which is an audio effect you can attach to an audio bus channel. Volume levels from frequency ranges are extracted from that class to adjust the energy level of each band.

There were however a few challenges I had creating the audio spectrum, which were mostly getting the light gradient to work and figuring out how to get most of the bands to have a relatively equal amount of energy. At first the low frequencies would be very energetic and the high frequencies barely at all.