marcopixel / monstercat-visualizer

A real time audio visualizer for Rainmeter similar to the ones used in the Monstercat videos.
MIT License
920 stars 103 forks source link

Visualizer bar gap not pixel perfect #49

Closed Alipoodle closed 7 years ago

Alipoodle commented 7 years ago

With the settings I would normally use on Fountain of Rainbows seems to make, some but not all, of the Visualiser's bars overlap / have 0 spacing. Settings: image Gif showing it off. https://puu.sh/vPDRJ/9134780dea.gif Image image

tjhrulz commented 7 years ago

I think this is caused by the variable being set as a float instead of an int. What is the value of that setting in the variables.ini file? (Can be found under ~/Documents/Rainmeter/Skins/Monstercat-Visualizer/@resources/variables.ini)

Alipoodle commented 7 years ago

My Variables.ini: https://pastebin.com/9a3XMwuC BarGap=1 Which should work, if that helps?

tjhrulz commented 7 years ago

Hmmm and bar width is also an int. Bar count is a float but I doubt that would cause it. I'll see if I can replicate the issue with a from scratch settings and see if I can find the exact cause.

After looking at the code I think it is something to do with the new rotate script as I see no references to the bar gap in it so I feel something may have been hard or miss coded or something.

tjhrulz commented 7 years ago

Alright after looking into it it seems to be caused by pixel rounding of the rotation skin so they are not pixel perfect. This is more noticeable at smaller bar gaps but seems to occur at all gaps. @MarcoPixel any idea if alatsombath encountered issue like this that were resolved in future versions of fountain of colors?

Alipoodle commented 7 years ago

image Well towards the Rotate Script... would this help explain it....

marcopixel commented 7 years ago

@tjhrulz This was because LUA rounded it wrong, should be fixed with the last commit.

Please report back if it worked propertly on your side.

Alipoodle commented 7 years ago

I think this is due to the Math done for width W=(#CURRENTCONFIGWIDTH#-((#BarGap#*#ScaleVisualizer#)*2)+2) CurrentConfigWidth - (10.8)2 + 2 CurrentConfigWidth - 3.6 🤷‍♂️ Could this be the problem where it comes comes out wrong.

tjhrulz commented 7 years ago

Better but now it is always one pixel larger than set and can not be a spacing of 0. Making line 13 local offset = math.ceil(barWidth) + math.ceil(barGap) -1 Seems to work tough in every edge case and is still pixel perfect.

marcopixel commented 7 years ago

Hmm, @tjhrulz i've tried it and it worked flawlessly on lower numbers but when you do higher ones it will break again. Maybe it has to do something with the width like @Alipoodle said.

tjhrulz commented 7 years ago

How is it breaking? Seems to work fine on my end even at large numbers. Is it just not pixel perfect? It is hard to tell if it is but I can get out photoshop just to double check

tjhrulz commented 7 years ago

I think I just found the real issue to this, the bar width is actually 1 pixel less than it is supposed to be.

tjhrulz commented 7 years ago

Also @Alipoodle that weird string is due to an encoding issue that is actually the degrees symbol being misencoded in github, we should probably fix that @MarcoPixel.

marcopixel commented 7 years ago

Fixed with 1.7.1 release, please download the update and report back if it is fixed for you.