Hi all!
I’m working on a custom audio system for an isometric game, and I’m trying to figure out the cleanest way to handle low-pass filtering with multiple parameters (for example with Multiband EQ)
The game has 2D pixel art visuals in a 3D isometric environment. We are not using FMOD’s normal 3D Spatializer for these sounds. Instead, the sounds plays in 2D and the programmer calculates several parameters that describe where an emitter is relative to the player/screen, such as:
- screen_pos_x
- screen_pos_y
- offscreen_distance
For example, screen_pos_x and screen_pos_y are roughly in a -1 and +1 range, where 0 is around the center/player position and the extremes represent positions further toward the edges of the screen. offscreen_distance tells us whether/how far something has moved offscreen.
I currently have these parameters automating the same Gain property.
For example, both screen_pos_x and screen_pos_y can have curves where the sound is loudest around the center and gets quieter toward the extremes.
This works fine even though several parameters are automating the same Gain knob and screen_pos_x and screen_pos_y even have the same automation curves on the Gain. So I wanted to do exactly the same, but instead this time, I want to add and move a low pass filter depending on the values of the parameters (since this is for the waterfall SFX)
But now the problem: The problem only occurs whenever I want to add automation the same way as with Gain, but with Multiband EQ instead.
I set one band to a Lowpass filter and automate its Frequency.
With only one parameter 1 (screen_pos_x) automating the frequency, it works exactly as expected. But once I add parameter 2 (screen_pos_y), The curve from screen_pos_x seems to barely low pass, the frequency value is barely changing?
For example:
- Parameter 1 has an upwards curve going from 22 kHz to 20 Hz.
- Parameter 2 doesn’t even have a similar curve, I only added a point on 22 kHz to test.
Now Parameter 1 can no longer close the filter nearly as much. Even though Parameter 1’s automation curve says it should reach a very low frequency, the actual resulting cutoff stays much higher.
What makes this particularly noticeable is that if I change Parameter 2’s starting point from 22 khZ to something very low, such as 650 hz or 20hz, Parameter 1 suddenly appears to control the filter normally again.
So it seems like the two Frequency automation values are being combined/averaged in some way,
Conceptually I want all of these parameters (screen_pos_x, screen_pos_y and offscreen_distance) to be capable of making the sound more muffled. Which worked perfectly for gain, but not for automating Multiband EQ.
What would be a good practice way of solving this? I have been working on my own for such a long time I am not sure if what I am doing is bad or good practice.
So I was thinking to solve it this way:
- Calculating one combined value in game code, for example a parameter called spatial_muffle, and then letting that single parameter automate the Multiband EQ Frequency? (this means the programmer has to calculate a value on their side using the screen_pos_x and screen_pos_y values, store the result in another variable such as spatial_muffle and then send that value to FMOD)
What do you guys think? I would really appreciate any tips/advice.