Spectral "Compensation"?

Ok, a bit of a (short) breakthrough, followed by some sadness and disappointment.

After inquiring over on the cycling forum about a way to create filters quickly and on-the-fly and someone suggested (quite helpfully) to try out fffb~, and on the surface this seems like a perfect solution. In the patch, the way things work at the moment is that the fluid.part~ of the patch generates a list of frequencies and decibels, and then the hiss.part~ of the patch creates an IR from that.

So if I just convert the dB output from the analysis/stats part of the process into linear amplitude I should be able to feed that right into fffb~ right!?..

Well, when I did that, it didn’t sound right at all. Because I had things like this:

Those dB values don’t correspond with the filter I’m seeing at all.

So after tracing the patch I realized that a part of the old patch that is pretty important is the maxgain message to irstats~. This takes the filter output from fluid.bufmelbands~fluid.bufstats~ and scales it so I have more-or-less unity gain from the resultant filter.

Bypassing irstats~ ends up giving me filters that are waay too quiet for the most part.

I tried taking the normalization bit from @jamesbradbury’s automatic spectral compensation patch and that gives me better results, but I don’t know/think that’s the way to go about that.

Now, bypassing hiss.stuff~ means I don’t have the smoothing and other nice bells and whistles of that approach, but I was hoping to at least be able to implement a rough EQ quickly, but I’m not sure how to go about approximating the maxgain of an EQ curve.

The helpfile for irstats~ has this to say about maxgain:

Estimated maximum gain within any octave of the IR in dB

Is there a specific formula for this, and is it possible to calculate it using a list of frequencies and gain settings?

Here’s an example of one of the curves:

221.833218 -33.454389 362.220601 -36.311383 523.987791 -38.297038 710.390753 -39.677351 925.181305 -41.060575 1172.682637 -43.307582 1457.876324 -45.938757 1786.50259 -42.903525 2165.17585 -45.6 2601.517837 -47.113147 3104.311008 -47.386607 3683.675316 -45.473278 4351.271895 -49.073143 5120.537773 -47.560681 6006.95632 -51.866266 7028.368896 -49.935765 8205.333946 -47.85 9561.540794 -50.37641 11124.286444 -48.3 12925.025005 -48.543471

Also, and I guess this is something I can try to test out, but if I’m using fffb~ would I then need to specify the “outer” frequencies and give them a gain of 1 so the overall filter is shaped correctly? (as in 20 Hz @ 1.0 and 20k Hz @ 1.0, which it seems like iruser~ is doing something along those lines)