stuerp / foo_vis_spectrum_analyzer

A foobar2000 component that displays a spectrum analyzer.
MIT License
20 stars 0 forks source link

Bar graph showing inaccurate frequencies after last few updates #51

Closed thevudia14 closed 7 months ago

thevudia14 commented 8 months ago

Expected: The max frequency shown should not be greater than the song sample rate itself

Actual:

image

In this example, the sample rate of the song is 44.1kHz but the graph showing more than that.

For the same song, the curve graph shows the correct frequency spread.

image

Please fix it.

stuerp commented 8 months ago

Can you please share the preset file for the bar graph? Because this makes no sense. The spectrum should be the same.

thevudia14 commented 8 months ago

Where is it located? Which file format?

stuerp commented 8 months ago

Presets tab. Just save a test file. The default location is your fb2k profile.

thevudia14 commented 8 months ago

test_preset.zip

stuerp commented 8 months ago

Thx. There's nothing wrong with the spectrum as-such. The problem is caused by the high number of bars. A bar has a minimum width which causes the rendering to spill over on the right side of the component. The X-axis, however, has no such limitation and can be drawn within the bounds of the component. Net result: A different scale factor between the bars and the X-axis.

thevudia14 commented 8 months ago

But this did not happen until few updates ago. I reduced the number of bars, but resizing the window is causing the issue again.

stuerp commented 8 months ago

That's because on the support forum people kept asking me to tweak the sizing and the spacing of the spectrum bars. The next beta will have a redesigned algorithm that hopefully will please most people.

thevudia14 commented 8 months ago

Can you point me to the version link that used to work? I will keep it until your beta release.

stuerp commented 8 months ago

No, because it got unnoticed. It only appears in edge cases such as a high number of bands + small window size + high max. frequency.

thevudia14 commented 8 months ago

I dont understand. I asked for a prior version which did not have the change you are talking about

stuerp commented 8 months ago

Have a look at https://github.com/stuerp/foo_vis_spectrum_analyzer/releases/tag/v0.7.5.0-beta2

thevudia14 commented 8 months ago
image

It's accurate now. But there is an issue: Even though the chosen range is 20Hz-50kHz, I could see other ranges.

stuerp commented 8 months ago

Yet your screenshot shows 20Hz-50kHz... I'm confused.

thevudia14 commented 8 months ago

I am talking about the borders. In old update, the empty borders wouldnt show up, on either side of 20 and 50kHz.

stuerp commented 7 months ago

That's by design. A pixel is a pixel. There's no way around it. Either you size the window to fit the content or you make sure there are enough bars to fill the available space.