@pqyt
First of all thank you for this excellent tool. I can (almost) get rid of 18 instances of PeakMeter Spectrum by substituting them with 6 instances of yours.
Since peakmeter is working perfectly in 100% windows scaling, I moved on to testing this plugins behavior with different windows scaling and encountered problems in all scaling (except 200% and 300%). Happens both in horizontal and vertical peakmeters. The rest of this message will only address the vertical peakmeter (without axe legends).
See the attached jpg's that also displays some debug information. I also included the code I use to determine the panel width for the number of channels and windows scaling.
The following text looks quite complicated but is more easy if you look at the jpg.
Based on how your plugin behaves/displays I guess you are calculating barwidth (vertical peakmeter) by first determining the total gauge gap by first multiplying the (unscaled) configuration value gauge gap times the number of channels (bars) to be displayed minus 1. Then I guess you scale this total gauge gap, subtract that value from the panelwidth and divide the result by the number of channels to find barwidth per bar. By scaling a calculated unscaled total gauge gap this value will be to high (except winth 200% and 300%), and subsequently your barwidth/barheight will be lower than I intended.
When you display bars, you apply single gauge gaps between channels leading to pixels that are left over and are distributed to the left of leftmost bar and to the right of rightmost bar.
In the attached jpg I included my scaled total gauge gap is 14 and I'm pretty sure you use 15.75 either truncated to 15 or rounded up to 16. Which leads to the behavior I described above.
// UNSCALED
$ifgreater($get(channels),7, $puts(px.h_bar, 13), // 13 max to display Above logo with Top plugin disabled
$ifgreater($get(channels),5, $puts(px.h_bar, 13), // 13 max to display Above logo with Top plugin enabled
$ifgreater($get(channels),4, $puts(px.h_bar, 14), // 15 max to display Above logo with Top plugin enabled
$ifgreater($get(channels),3, $puts(px.h_bar, 16), // 20 max to display Above logo with Top plugin enabled
$ifgreater($get(channels),2, $puts(px.h_bar, 21), // 27 max to display Above logo with Top plugin enabled
$ifgreater($get(channels),1, $puts(px.h_bar, 21), // 41 max to display Above logo with Top plugin enabled
$puts(px.h_bar, 32) // 83 max to display Above logo with Top plugin enabled
))))))
$puts(mx.w_bar, 6) // Unscaled - Single bar width - Desired unscaled bar width for PeakMeter vertical
$puts(wh_gauge_s, 1) // Unscaled - Single gauge gap - Desired unscaled gauge gap
$puts(wh_gauge_t, $mul($sub($get(channels),1),$get(wh_gauge_s))) // Unscaled - Total gauge gap
$puts(px.h_std, $add($get(wh_gauge_t), $mul($get(px.h_bar),$get(channels)))) // Unscaled - Panel height needed - PeakMeter horizontal
$puts(mx.w_std, $add($get(wh_gauge_t), $mul($get(mx.w_bar),$get(channels)))) // Unscaled - Panel width needed - PeakMeter vertical
// SCALED
$puts(wh_gauge_s, $muldiv($get(wh_gauge_s),%scale%,100)) // Scaled - Single gauge gap - truncated
$puts(wh_gauge_t, $mul($sub($get(channels),1),$get(wh_gauge_s))) // - Total gauge gap - calculation based on truncated scaled single gauge gap / NOT BASED BY SCALING UNSCALED TOTAL GAUGE GAP
$puts(px.h_bar, $muldiv($get(px.h_bar),%scale%,100)) // Scaled - Single bar height - truncated - PeakMeter horizontal
$puts(mx.w_bar, $muldiv($get(mx.w_bar),%scale%,100)) // Scaled - Single bar width - truncated - PeakMeter vertical
$puts(px.h_std, $add($get(wh_gauge_t), $mul($get(px.h_bar),$get(channels)))) // Scaled - Panel height needed - PeakMeter horizontal - calculation based on truncated scaled single bar height / NOT BASED BY SCALING UNSCALED TOTAL BAR HEIGHT
$puts(mx.w_std, $add($get(wh_gauge_t), $mul($get(mx.w_bar),$get(channels)))) // Scaled - Panel width needed - PeakMeter vertical - calculation based on truncated scaled single bar width / NOT BASED BY SCALING UNSCALED TOTAL BAR WIDTH
In my opinion calculation should be as follows:
1) Scale the single gauge gap and store the result truncated in an integer.
2) Calculate total gauge gap by multiplying the value of 1) times the number of (channels minus 1)
3) Deduct from the panel width the value of 2) and width needed for 1/2 axe legends
4) Divide the value of 3) by the number of channels and store the result truncated in an integer (barwidth per bar)
5) ... continued with total leftover pixels and distribution to the left & right of the panel
I think the issue lies in 1) and 2). In my code it is the two lines under // SCALED.
Please investigate ...