stuerp / foo_vis_spectrum_analyzer

A foobar2000 component that displays a spectrum analyzer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uneven gap between bars, my OCD is killing me.

Jimmy-Z opened this issue · comments

I guess this is best explained by a screen shot:
uneven-gap

Also the peak bars flickers a lot, I'm guessing it's a similar cause.

for comparison this is AnSpec from Voxengo
anspec
It looks like they rendered in a higher resolution and scaled down, it's not as sharp but looks perfectly even.

Oh, and thank you for your work, I love this!

I don't get it. The bars are simply a brush used to paint the bars. Direct2D uses sub-pixel coordinates so depending on the DPI settings you can get rounding errors. I could make the gaps between the 'LED's smaller, 1 pixel f.e.

As for the flickering, you may be experiencing some 'jumpy' peaks. Which peak mode are you using?

I'm not sure what do you mean by "I don't get it", I mean, some vertical gaps are thicker than others, as marked here:
uneven-gap
I just noticed the background grid lines also have uneven thickness.

By flickering I meant the brightness changes when the peak bar is falling, it could be just the thickness is changing, or is this a feature? I'm using the "Classic" peak mode.

  1. OK, I see. I thought you meant the thickness of the 'LED'. I'll look into it but I think it's caused by rounding errors. The width of the graph area is divided by the number of bands and floating-point is used as long as possible.

  2. The peak is rendered using the same gradient as the bar. The color changes but is also anti-aliased. If enough pixels are available, the yellow makes the peak seem brighter next to the anti-aliased colors. If you zoom in on the pixel in the PNG you'll see what I mean. Again, I'll see if I can ease your OCD ;-)

Beta 3 has a tweak.

Sorry for the delay, just tried beta 4.

Unfortunately it's still there, it's just they're now evenly distributed: every 4th of them are thicker:

1in4

I tried to change the width of the window, in some width setting, the unevenness would seemingly disappear, but when they do show, it's always every 4th.

And the peak still has changing thickness when they're falling.

I just noticed the background grid lines also have uneven thickness.

You probably missed this, it also varies with the window size, but the pattern also change, not like the every 4th thing with the gap between bars.

And again, thanks :D

I have tried multiple window sizes which resulted in multiple LED bar widths, and I haven't found any rounding errors. Everything is nicely spaced and has the same width. The only remaining conclusion is that you're looking at rounding errors in your GPU driver.