1
Notice
Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
2
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by Defender -very nice look& feel, you made a clever change to the script.@ilovefb2k
In my skin there are 5 different instances of VU BIN you can enable (and now one VU JSP). All are driven by the same scaling code although the bottom ones use slightly different parameters than the upper ones.
Please don't implement my maximum vu.h_scale / vu.w_scale method unless you make it optional.
I have no way of knowing what skin is selected and it's native aspect ratio. I also cannot read Properties. Hence the generic values of vu.x_fact and vu.y_fact instead of the actual x/y of the BIN png in my code. These values work fine for all selected horizontal VU skins, but look awful in vertical and square skins.
3
MP3 - General / Re: Split mp3 without re-transcoding?
Last post by jaybeee -forked version at github.
overall summary with links to last original version by @SebastianG
4
WavPack / Re: Restoring corrupted .wv files
Last post by bryant -However, it will terminate with that error if it can't find a valid WavPack block at all in the first megabyte. I don't know why a file generated by Reaper, even if interrupted, would look like that.
If you have a WavPack file that should have good audio but generates that error, I'd be happy to take a look at it. It might be recoverable.
Sorry this happened to you!
5
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by Defender -hard reset the scriptThat did the trick. Thx.
6
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by ilovefb2k -hi @Defender,quick edit ,This last script does not show a VU meter for me.
please ignore the script in the previous post.
use the attached herein instead.
update: addressing a special case where the needles are horizontal.
regards
if something goes wrong, then i have to revise the script throughout.
this may be last changes has made this script too messy.
thank you,
@ilovefb2k
edit:
@Defender : i just have had a quick revise and found nothing illogic. can you hard reset the script to see what is next ?
i may wait for other replies to replicate that errors.
thank you.
7
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by ilovefb2k -Hi @Defender,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.Code: [Select]// 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.
very nice look& feel, you made a clever change to the script.
skin does not look as sharp as the original BIN: yeah, i noted that also. the script created skin images based on the current panel size and will not look nice if we , even, enlarge the panel size after that. well-noted this.
thank you very much.
regards
@ilovefb2k
8
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by Defender -quick edit ,This last script does not show a VU meter for me.
please ignore the script in the previous post.
use the attached herein instead.
update: addressing a special case where the needles are horizontal.
regards
9
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by ilovefb2k -quick edit ,Spoiler (click to show/hide)hi @sveakul,
thank you for your feedback. It is just an attempt for us to play around and tune it to suit our specific look & feel. e.g. we may construct ourself a fb2k theme/skin and let this help us in manipulating a VU Meter.
It is in no way can compared with well-coded, beautiful and rich-feature one of @oops' or the 32x version.
hi @Defender,
yeah, you are totally right.
wish you both a nice day.
@ilovefb2kHi @Defender , @sveakul, @Air KEN and @all,Spoiler (click to show/hide)[/spoiler]
Hi @Air KEN and @all,
As per some feedback and suggestions , please find the JSP3 "AIMP Analog VU Meter" update attached, version named "1.0.1 QM 05-11-24" for convenient reference.
This update addresses some points:
- High CPU load.
- Covering some very special cases, which were not easy to find a skin for, but they are there, finally. We also attached some for your quick loading:
+ The needle is upside down. Technically, the y_needle coordinates can be in (>=0) or outside (<0) the background area.
+ The needle is horizontal.
We find it very interesting as, to some extent, we could not think of such skins existing early on. Wow, what creativity from us as an audio lovers community.
Spoiler (click to show/hide)
A week has gone by too fast, like the wind. Please find the updated JSP3 'AIMP Analog VU Meter' script attached, named version '1.0.13 DT-K 08-Nov-24' for convenient reference, details as following:
Just one feature was added: unlock aspect ratio, as per @Defender's suggestion.
A free night weekend allowed me to play around with this feature, which I also think is a must-try if we want the script to move on to 'animation' VU Meters, which contain pre-calculated data/images per needle angle.
Please note that once this option is on, CPU load may beboosted up to Mars and won't come back, so fasten your computer's belt for a safe trip.
What happens behind the scenes:
The script will create around 200 x 2 channels = 400 needle images (we may tune this number per the hard-coded variable stepCache, for now), which are number of screenshots of needles per angle along the meter range, then load them into 'heap' memory. We will instantly note an increase in RAM consumption in less than 1 second, then it will return to normal.
Later on, we just retrieve each needle image by its index-converted angle as real-time calculated.
To do this, we have to do a trick, just jotting it down here for those who want to make it better:
-Step 1: Allocate memory for hundreds of images.
-Step 2: Draw needles, 1 needle per 1 image, per 1 angle. This takes about 1 ms each.
-Step 3: Garbage collection. As we allocate stack memory, we have to clear it ourselves or soon end up crashing. This will also take more than 1 ms each, which is time-consuming.
So, we have to make an async task, which will transfer the clearance job (step 3) to another thread, and we can move on. In principle, we can reuse some async methods of JSP3 to do this job in a very 'strange' manner. For example:Code: [Select]fb.AddLocationsAsync(window_id, [""]);Or, simply, leave this mess for
on_locations_added(task_id, handle_list) { do clearing job, which is not related to this native function}Code: [Select]window.SetTimeout({do clearing job}, 1)=> We move on, and this method, on another thread, will do the clearing job after 1 ms and not bother us.
As such, we will experience a frozen-screen instance (not core audio engine) for a very short time. To save CPU power, just do this one time per current panel size until we move to another skin. Consequently, the resolution will not be nice if we enlarge the panel size, or we will have to switch forward and back just 1 skin to update the needle images caching for the current panel size.
If something seems wrong (e.g. needles are not on show), then a 'hard reset' via context menu [shift +right click] will bring back default setting and may help.
And that is all. Wish you all the very best and a very nice weekend.
Regards,
@ilovefb2k
please ignore the script in the previous post.
use the attached herein instead.
update: addressing a special case where the needles are horizontal.
regards
@ilovefb2k
10
3rd Party Plugins - (fb2k) / Re: JScript Panel script discussion/help
Last post by Defender -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.
Code: [Select]
// 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.