Just one feature was added: unlock aspect ratio, as per @Defender's suggestion.
@ilovefb2k
Just a quick reaction. It works fine and is the way I am going to use it.
To clarify ... I don't want to stretch the VU meter (BIN or yours) more than either a maximum horizontal scaling or a maximum vertical scaling so I recalculate the VU meter coordinates using these maximum scaling factors. If that means there's either some horizontal or vertical space left I display a bezel around the VU meter, which I don't do with my transparent skin that I made for your script since it doesn't look better. For reference I attached the relevant code for calculating VU coordinates.
I now applied this code also to your script. As you can see your VU meter looks slightly larger than the original BIN. Reason for that is that I slightly cut the original bezel from the BIN before making the remaining bezel transparent.
// plug.x - initial VU panel x-coordinate
// plug.y - initial VU panel y-coordinate
// plug.w - initial VU panel width
// plug.h - initial VU panel height
$ifgreater($get(dbg.vu),0, $puts(dbg1,STEP|1:|plug.xywh=$get(plug.x).$get(plug.y).$get(plug.w).$get(plug.h)) ,)
// VU panel standard settings
$puts(vu.x_fact, 400) // VU default proportion - X
$puts(vu.y_fact, 100) // VU default proportion - Y
$puts(vu.acc, $mul(%on.accent.vu%,%def.accent%)) // VU - Accent padding
$puts(vu.acc_limit, $muldiv(0,%scale%,100)) // Limit to trigger accent padding - 0= Always full on, otherwise either horizontal only or vertical only
// VU panel specific padding
$puts(vu.l_pad, 0) // VU - Left padding
$puts(vu.r_pad, $get(vu.l_pad)) // VU - Right padding
$puts(vu.t_pad, 0) // VU - Top padding
$puts(vu.b_pad, $get(vu.t_pad)) // VU - Bottom padding
// VU panel specific width and scaling settings
$puts(vu.w_min, $muldiv( 250,%scale%,100)) // VU minimum width - when less width available do not display VUmeter
$puts(vu.w_max, $muldiv(10000,%scale%,100)) // VU maximum width - set very high to use full available width
$puts(vu.w_scale, $max(175, 100)) // VU maximum width scale percentage related to original vu dimensions vu.x_fact en vu.y_fact. Minimum value 100
$puts(vu.h_scale, $max(150, 100)) // VU maximum height scale percentage related to original vu dimensions vu.x_fact en vu.y_fact. Minimum value 100
// Calculate initial VU height and width using available width/height and above settings
$puts(vu.w, $sub($min($get(vu.w_max),$get(plug.w)),$get(vu.l_pad),$get(vu.r_pad)))
$puts(vu.h, $sub($get(plug.h),$get(vu.t_pad),$get(vu.b_pad)))
$puts(vu.h, $min($get(vu.h), $muldiv($muldiv($get(vu.w),$get(vu.y_fact),$get(vu.x_fact)), $get(vu.h_scale), 100)))
$puts(vu.w, $min($get(vu.w), $muldiv($muldiv($get(vu.h),$get(vu.x_fact),$get(vu.y_fact)), $get(vu.w_scale), 100)))
// Calculate final VU coordinates adjusted for padding and painted accent
$ifgreater($get(vu.w_min),$get(vu.w),
$puts(vu.w, 0)
,
$puts(vu.y, $add($get(plug.y), $div($sub($get(plug.h),$get(vu.h)),2))) // Vcenter alignment
$puts(vu.x, $add($get(plug.x), $div($sub($get(plug.w),$get(vu.w)),2))) // Hcenter alignment
$ifgreater($get(dbg.vu),0, $puts(dbg2,STEP|2:|||vu.xywh=$get(vu.x).$get(vu.y).$get(vu.w).$get(vu.h)) ,)
// Paint accent and adjust VU coordinates accordingly
$ifgreater($get(vu.acc),0,
$ifgreater($get(vu.acc_limit),0,
$puts(vu.x_pad, $sub($get(vu.x),$get(plug.x)))
$puts(vu.y_pad, $sub($get(vu.y),$get(plug.y)))
$ifgreater($get(vu.acc_limit),$get(vu.x_pad),
$puts(vu.x_pad, 0)
,)
$ifgreater($get(vu.acc_limit),$get(vu.y_pad),
$puts(vu.y_pad, 0)
,)
,
$puts(vu.x_pad, 1)
$puts(vu.y_pad, 1)
)
$ifgreater($add($get(vu.x_pad),$get(vu.y_pad)),0,
// $drawrect($get(vu.x), $get(vu.y), $get(vu.w), $get(vu.h), %cola.at%, %cola.at%)
$puts(i,0)
$ifgreater($get(vu.acc),$get(i), $drawrect($add($get(vu.x),$get(i)), $add($get(vu.y),$get(i)), $sub($get(vu.w),$mul($get(i),2)), $sub($get(vu.h),$mul($get(i),2)), 0-0-0-0, %cola.at%) $puts(i, $add($get(i),1)) ,)
$ifgreater($get(vu.acc),$get(i), $drawrect($add($get(vu.x),$get(i)), $add($get(vu.y),$get(i)), $sub($get(vu.w),$mul($get(i),2)), $sub($get(vu.h),$mul($get(i),2)), 0-0-0-0, %cola.at%) $puts(i, $add($get(i),1)) ,)
$ifgreater($get(vu.x_pad),0,
$puts(vu.x, $add($get(vu.x), $get(vu.acc)))
$puts(vu.w, $sub($get(vu.w), $mul($get(vu.acc),2)))
,)
$ifgreater($get(vu.y_pad),0,
$puts(vu.y, $add($get(vu.y), $get(vu.acc)))
$puts(vu.h, $sub($get(vu.h), $mul($get(vu.acc),2)))
,)
,)
,)
)
$ifgreater($get(dbg.vu),0, $puts(dbg3,STEP|3:|||vu.xywh=$get(vu.x).$get(vu.y).$get(vu.w).$get(vu.h)) ,)
// vu.x - final VU x-coordinate
// vu.y - final VU y-coordinate
// vu.w - final VU width - do not show/display VU panel when value is 0
// vu.h - final VU height
One thing I noticed is that your skin does not look as sharp as the original BIN, which is very noticeable with larger sized VU meters.
Do you use an internal smaller rendered image before rescaling and displaying to the allotted panel?
EDIT: Sorry, just noticed you already mentioned this.