Skip to main content

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.
Topic: JScript Panel script discussion/help (Read 411062 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #1900
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.

@ilovefb2k
Thx.

Can you add an option to the right click menu for Background color? Option No fill or Transparent. Which effectively disables the painting of the background which is being done in line 503 and 504.

Can you add an option to the right click menu to set the margins (properties HA.METER.Left Margin and HA.METER.Top margin)?

The original VUmeter stretches to fill the window/panel it lives in. Your script fills from top/left until it reaches bottom/right margin but keeps aspect ratio. Would it be possible to add an option so your script stretches too?

How do you get the base images and needle for a VU meter? Is there a tool to rip them from an existing VUmeter BIN file?

Re: JScript Panel script discussion/help

Reply #1901
...
How do you get the base images and needle for a VU meter? Is there a tool to rip them from an existing VUmeter BIN file?

You can go to the AIMP forum and use the ZIP-Files containing the AIMP VU-Meters, in these Zip's you'll find the pics.


Re: JScript Panel script discussion/help

Reply #1902
sorry for being off topic but is it possible to get a sound level in the taskbar like in the picture

Re: JScript Panel script discussion/help

Reply #1903
...
How do you get the base images and needle for a VU meter? Is there a tool to rip them from an existing VUmeter BIN file?
You can go to the AIMP forum and use the ZIP-Files containing the AIMP VU-Meters, in these Zip's you'll find the pics.
Thx. There's quite a lot. Unfortunately not the ones I really like.

I have those in BIN format. The VU Editor (that creates the BIN files for foo_vis_vumeter) can not open/read its own BIN files. It opens VU project files. When you are done you can export a project to a BIN file which uses either No Compression, BZIP2 or LZMA.

One of my BIN files start with a BZh91 header so I guess it is BZIP2 compressed. Unfortunately I cannot open the file with RAR/7-Zip.
Does anyone have a bright idea to extract the files from a VU meter BIN file?

Re: JScript Panel script discussion/help

Reply #1904
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.

@ilovefb2k
Thx.

Can you add an option to the right click menu for Background color? Option No fill or Transparent. Which effectively disables the painting of the background which is being done in line 503 and 504.

Can you add an option to the right click menu to set the margins (properties HA.METER.Left Margin and HA.METER.Top margin)?

The original VUmeter stretches to fill the window/panel it lives in. Your script fills from top/left until it reaches bottom/right margin but keeps aspect ratio. Would it be possible to add an option so your script stretches too?

How do you get the base images and needle for a VU meter? Is there a tool to rip them from an existing VUmeter BIN file?
hi @Defender,
your fb2k theme/skin looks very promising.
regarding your feedback,  may i humbly raise my points as follows, in hoping that helps:
1. add an option to the right click menu for Background color : Done. please find the script attached and 2 screenshots illustrated thereafter.
2.  properties HA.METER.Left Margin and HA.METER.Top margin adjustment: As you have already pointed out.  /SHIFT + right click/ on the panel to  bring the context menu up front, which should have item allowing us to access window properties. These properties should be there. 
3. Would it be possible to add an option so your script stretches [skin] too : Yes, in principal.
we may try the following pseudo_script,  which is whithin on_paint() callback to refresh per internal timer.  The point is that we create an instance\image of the VU Meter every internal timer,  then it is too fast to rapidly consume CPU-power and Memory, which , consequently,  may cause computer to memory leak and crash.
as such, my approach is to leave it aside till we can have better solution.      

Spoiler (click to show/hide)

4- base images and needle for a VU meterthe script is solely based on AIMP VU Meter skins, which are compressed by standard method. In principal, we may let javascript to un-zip that files or utilize 3rd command-line tools to do it. I well noted this suggestion.
however, follow some of your later posts, it seems you want the script to play around with fb2k's VU Meter skin, which are zipped by its or component's method. so far, i have had no idea to give it a try cause i do not have any clue about that format and, therefore, the script has no feature to deal with fb2k VU Meter skins. 
however, based on @oops's comments during developing vu_vis_meter, i do think that that BIN should have at least a background, cover and a sheet list of data that help component to paint the needle. but, that is a guess.


hope this helps,
regards
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #1905
sorry for being off topic but is it possible to get a sound level in the taskbar like in the picture
VERY off-topic. A one-off reply: right-click the taskbar (not the tool bar) and choose "Show volume".  It will then appear in the lower right corner as a dB value; mouse over and center wheel will adjust up/down, or, click on it and you'll get a slider.

Re: JScript Panel script discussion/help

Reply #1906
thank you for the reply say no more

Re: JScript Panel script discussion/help

Reply #1907
I have those in BIN format. The VU Editor (that creates the BIN files for foo_vis_vumeter) can not open/read its own BIN files. It opens VU project files. When you are done you can export a project to a BIN file which uses either No Compression, BZIP2 or LZMA.

Does anyone have a bright idea to extract the files from a VU meter BIN file?
I'll second that.  Could someone please make a tool that can both export the image components from a BIN file, and re-import them into the same BIN, overwriting the originals?  Then a user could make say a color change to a meter body using an image editor and then re-save the BIN with that change.  With VUEditor you can only do this by starting with "*.vu project files," not the BIN file.

Re: JScript Panel script discussion/help

Reply #1908
@ilovefb2k : I loaded your newly posted 1.011 script completely as-is with just the skin folder path mod, and the meter movements are MUCH more reactive and seem more accurate.  Thanks for clarifying the "check setting" prompts!  What I have been doing when I load a new skin is do the "check setting" procedure, and keep the "tweak min/max level" option checked--I am assuming that the latter is performing an additional refinement to using the "check setting" buttons--is that correct?

I did not add the portion of script to 1.01 you posted a day earlier in response to my concerns about needle movement, as I am guessing those changes are addressed in the new 1.011 QM 05-11-24 version.

Re: JScript Panel script discussion/help

Reply #1909
1. add an option to the right click menu for Background color : Done. please find the script attached and 2 screenshots illustrated thereafter.

2.  properties HA.METER.Left Margin and HA.METER.Top margin adjustment: As you have already pointed out.  /SHIFT + right click/ on the panel to  bring the context menu up front, which should have item allowing us to access window properties. These properties should be there. 

3. Would it be possible to add an option so your script stretches [skin] too : Yes, in principal.
we may try the following pseudo_script,  which is whithin on_paint() callback to refresh per internal timer.  The point is that we create an instance\image of the VU Meter every internal timer,  then it is too fast to rapidly consume CPU-power and Memory, which , consequently,  may cause computer to memory leak and crash.
as such, my approach is to leave it aside till we can have better solution.      


4- base images and needle for a VU meterthe script is solely based on AIMP VU Meter skins, which are compressed by standard method. In principal, we may let javascript to un-zip that files or utilize 3rd command-line tools to do it. I well noted this suggestion.
however, follow some of your later posts, it seems you want the script to play around with fb2k's VU Meter skin, which are zipped by its or component's method. so far, i have had no idea to give it a try cause i do not have any clue about that format and, therefore, the script has no feature to deal with fb2k VU Meter skins. 
however, based on @oops's comments during developing vu_vis_meter, i do think that that BIN should have at least a background, cover and a sheet list of data that help component to paint the needle. but, that is a guess.

Ad 1) Works. Thx. The reason I like to have it in the rightclickmenu and as a property is when you release a new version I do not have to outcomment the background paintcode everytime.

Ad 2) I noticed that sometimes the properties reset themselves loading different skins or changing rightclick options.
Another thing is that it is a bit inconsistent to only set left and top margins. If you set a top and left option I would expect these margins to be also applied to the right and bottom which they are not. So please add separate padding options for right and for bottom or apply the setting for left also to right and the setting for top also to bottom.

Ad 3) Ok. I will look into  it later.

Ad 4) The idea I have is to extract the images from a BIN file, create an appropiate skin.ini and use your script to display the results.

As a proof of concept I have been experimenting with recreating stuff from a BIN file. If you rightclick on a running foo_vis_vumeter BIN skin you can see the native resolution. Then I define a panel in my  skin with this exact size in which I run the BIN. Make a screenshot when not playing anything and make a screenshot at full level with replaygain off. Merge the two screenshots to get rid off the needle. Which leaves you with the base png of the particular skin.
Then paint the needle (I use lunapic) in a separate png. Very hard to determine the correct length needed for the needle.
Then experiment with changing values in a skin.ini until it more or less resembles the behavior of the original BIN.

I find it is very difficult to determine settings for PivotPointX and PivotPointY. Also changing settings for MobilityNegative and
MobilityPositive do not change behavior as far as I can see.

All in all very timeconsuming.

It would help a lot if the values of PivotPointX and PivotPointY could be calculated automatically. If you have those values it is far more easy to determine the needed length for the needle.

I attached the results of my experiment including the AIMP skin I created and the original BIN file.
The lower large VU meter is the BIN file running. The upper large VU meter is run by your script. The left part runs with the original needle of Line Magnetic 501 and the right part runs with my recreated needle.
Both are running in their native resolution.

Re: JScript Panel script discussion/help

Reply #1910
AIMP skin

In case somebody wants to experiment with my 7inch_3 rip without the ugly red needle on the left here are two working versions.
First is a vanilla  version and the second works with an upgraded gradient background.

It is quite easy to change colors and backgrounds if you have the underlying png files.

Re: JScript Panel script discussion/help

Reply #1911
@Defender



I set it to (30-30-30) to match the dark mode.
It's originally a color for DarkOne, right?
The needle vibration is also nice.
I also use 7inch_3.bin with foo_vis_vumeter.
I like that it's simple and easy to see.
Thank you.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1912
how do you install the vu meter

Re: JScript Panel script discussion/help

Reply #1913
@telboy1812
Reply #1867 By ilovefb2k: https://hydrogenaud.io/index.php/topic,110516.msg1053272.html#msg1053272
or
foo_vis_vumeter
https://hydrogenaud.io/index.php/topic,126733.0.html
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1914
thank you  :)

Re: JScript Panel script discussion/help

Reply #1915
@Defender



I set it to (30-30-30) to match the dark mode.
It's originally a color for DarkOne, right?
The needle vibration is also nice.
I also use 7inch_3.bin with foo_vis_vumeter.
I like that it's simple and easy to see.
Thank you.
You are welcome.

My skin is based on the original DarkOne v4. All my colors are derived from the original background color 19-30-38.
All panels I paint have optional external padding, an optional bezel, optional accent, optional gradient, optional internal padding and selectable background art. On top of such a painted panel with transparency enabled I display plugins.

I played around a bit more with the AIMP skins and when scaling is implemented in this script as it is in foo_vis_vumeter you can do things like the left VU panel from the screenshot with has a namelogo of the playing artist as background.

I also attached a version of my AIMP skin that is supposed to live in a panel with activated transparency. You might want to try that one as well.

Re: JScript Panel script discussion/help

Reply #1916
@telboy1812
Reply #1867 By ilovefb2k: https://hydrogenaud.io/index.php/topic,110516.msg1053272.html#msg1053272
or
foo_vis_vumeter
https://hydrogenaud.io/index.php/topic,126733.0.html
@telboy1812

Follow the above instructions.

Then extract my skins under the following folder.
%APPDATA%\foobar2000-v2\skins\viking\images\vnav_fb2k\beat_audio_vu_meter

Should give you something like the attached screenshot.

Then rightclick on the panel with the component and choose a skin ...

Re: JScript Panel script discussion/help

Reply #1917
I have those in BIN format. The VU Editor (that creates the BIN files for foo_vis_vumeter) can not open/read its own BIN files. It opens VU project files. When you are done you can export a project to a BIN file which uses either No Compression, BZIP2 or LZMA.

Does anyone have a bright idea to extract the files from a VU meter BIN file?
I'll second that.  Could someone please make a tool that can both export the image components from a BIN file, and re-import them into the same BIN, overwriting the originals?  Then a user could make say a color change to a meter body using an image editor and then re-save the BIN with that change.  With VUEditor you can only do this by starting with "*.vu project files," not the BIN file.

Hmm, there are quite a few skins for the AIMP Analog VU Meter that I would like to do something about, or have someone do something about.

Sharp GF-9000
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1918
thank you for the help but my nephew will sort it tomorrow as I am to old for pcs heh

Re: JScript Panel script discussion/help

Reply #1919
how do you install the vu meter
There are three "types."

1.  The AIMP-only ilovefb2k JSP3 meters should be installed using the latest script ("1.0.11 QM 05-11-24") here: https://hydrogenaud.io/index.php?action=dlattach;topic=110516.0;attach=33395 (No meters are included).  You can use the same instructions that Defender and Air KEN posted, which are mostly repeated at the beginning of the script file itself.  Sample meters are include with the 1.0 and 1.0.1 version packages attached to earlier posts.

The above script works ONLY with AIMP analog meters (not LVU) that do not have LEDs and requires Javascript Panel 3 to be installed.

2.  The re-written plugin foo_vis_vumeter will display all three main types--AIMP analog (with or without LEDs), AIMP "LVU", and the Foobar BIN meters.  JSP3 is not required. https://hydrogenaud.io/index.php/topic,126733.0.html

3.  The JSP3 horizontal bar variety, discussed in detail earlier, easiest tried by installing the built-in "VU Meter" sample from later versions of Javascript Panel 3 (mine is from 3.79 but it's in the newest version also).  This is not a representation of an AIMP or BIN style meter face, but extremely accurate double bars (there are 4-bar mods) that are tied to the JSP3 ability to get raw audio data right from the Foobar interface.

Enjoy, but have lots of time on your hands first  ;)

Re: JScript Panel script discussion/help

Reply #1920
@ilovefb2k : I loaded your newly posted 1.011 script completely as-is with just the skin folder path mod, and the meter movements are MUCH more reactive and seem more accurate.  Thanks for clarifying the "check setting" prompts!  What I have been doing when I load a new skin is do the "check setting" procedure, and keep the "tweak min/max level" option checked--I am assuming that the latter is performing an additional refinement to using the "check setting" buttons--is that correct?

I did not add the portion of script to 1.01 you posted a day earlier in response to my concerns about needle movement, as I am guessing those changes are addressed in the new 1.011 QM 05-11-24 version.
Hi @sveakul,
[Just a quick reply cause i got a deadline, so sorry about this].
as per your yesterday feedback, i thought there was something to do with MobilityNegative option: The needle speed is sensitive to CPU-power.
consequently, there must be somewhere to dictate this, and as you pointed out:  we just let the RMS level roll back gently by applying it some tasks to do. i just name the variable after 'rms_decay_speed', which can be adjusted via JSP3's properties window [HA.RMS.decay.speed (0-1)] to suit our system.
We just get the MobilityNegative value from INI file and assign this to the script. 

Code: [Select]
peak_rms =  Math.sqrt(sum/frame_len);
//instantly react: RMS_levels[c] = peak_rms;
// or: gently
if (peak_rms > RMS_levels[c]) RMS_levels[c] = peak_rms;
else RMS_levels[c] *= rms_decay_speed;
note: this method was already done by @Marc2003's VU meter script. we just figure out how to bind this with the  MobilityNegative  option.

And, as such, ' "check setting" option is just there to show the MaxLevel/MinLevel and angle. Based on these information, we may know how accurate INI data is and make some changes or calibrate, if nay.
regards,
@ilovefb2k 

Re: JScript Panel script discussion/help

Reply #1921
1. add an option to the right click menu for Background color : Done. please find the script attached and 2 screenshots illustrated thereafter.

2.  properties HA.METER.Left Margin and HA.METER.Top margin adjustment: As you have already pointed out.  /SHIFT + right click/ on the panel to  bring the context menu up front, which should have item allowing us to access window properties. These properties should be there. 

3. Would it be possible to add an option so your script stretches [skin] too : Yes, in principal.
we may try the following pseudo_script,  which is whithin on_paint() callback to refresh per internal timer.  The point is that we create an instance\image of the VU Meter every internal timer,  then it is too fast to rapidly consume CPU-power and Memory, which , consequently,  may cause computer to memory leak and crash.
as such, my approach is to leave it aside till we can have better solution.      


4- base images and needle for a VU meterthe script is solely based on AIMP VU Meter skins, which are compressed by standard method. In principal, we may let javascript to un-zip that files or utilize 3rd command-line tools to do it. I well noted this suggestion.
however, follow some of your later posts, it seems you want the script to play around with fb2k's VU Meter skin, which are zipped by its or component's method. so far, i have had no idea to give it a try cause i do not have any clue about that format and, therefore, the script has no feature to deal with fb2k VU Meter skins. 
however, based on @oops's comments during developing vu_vis_meter, i do think that that BIN should have at least a background, cover and a sheet list of data that help component to paint the needle. but, that is a guess.

Ad 1) Works. Thx. The reason I like to have it in the rightclickmenu and as a property is when you release a new version I do not have to outcomment the background paintcode everytime.

Ad 2) I noticed that sometimes the properties reset themselves loading different skins or changing rightclick options.
Another thing is that it is a bit inconsistent to only set left and top margins. If you set a top and left option I would expect these margins to be also applied to the right and bottom which they are not. So please add separate padding options for right and for bottom or apply the setting for left also to right and the setting for top also to bottom.

Ad 3) Ok. I will look into  it later.

Ad 4) The idea I have is to extract the images from a BIN file, create an appropiate skin.ini and use your script to display the results.

As a proof of concept I have been experimenting with recreating stuff from a BIN file. If you rightclick on a running foo_vis_vumeter BIN skin you can see the native resolution. Then I define a panel in my  skin with this exact size in which I run the BIN. Make a screenshot when not playing anything and make a screenshot at full level with replaygain off. Merge the two screenshots to get rid off the needle. Which leaves you with the base png of the particular skin.
Then paint the needle (I use lunapic) in a separate png. Very hard to determine the correct length needed for the needle.
Then experiment with changing values in a skin.ini until it more or less resembles the behavior of the original BIN.

I find it is very difficult to determine settings for PivotPointX and PivotPointY. Also changing settings for MobilityNegative and
MobilityPositive do not change behavior as far as I can see.

All in all very timeconsuming.

It would help a lot if the values of PivotPointX and PivotPointY could be calculated automatically. If you have those values it is far more easy to determine the needed length for the needle.

I attached the results of my experiment including the AIMP skin I created and the original BIN file.
The lower large VU meter is the BIN file running. The upper large VU meter is run by your script. The left part runs with the original needle of Line Magnetic 501 and the right part runs with my recreated needle.
Both are running in their native resolution.

Hi @Defender,
[Just a quick reply, so sorry about this].

1-   (1) Works. : Thank you
2 -1: sometimes the properties reset themselves :  I did utilize window.Reload(option), where option = false. this should not trigger any properties reset to default. i will check it over the weekend.
2-2: add separate padding options for right and for bottom :  Done. please find the script attached. There may be likely bugs cause i am in a rush.
3- Thank you. I am looking forwards to your script.
4- It is fantastic that you can play around with that. I humbly raise an idea to calculate x0,y0 as per image attached. It should be easy for you to catch up.  

regards,
@ilovefb2k

 

Re: JScript Panel script discussion/help

Reply #1922
2 -1: sometimes the properties reset themselves :  I did utilize window.Reload(option), where option = false. this should not trigger any properties reset to default. i will check it over the weekend.
2-2: add separate padding options for right and for bottom :  Done. please find the script attached. There may be likely bugs cause i am in a rush.
4- It is fantastic that you can play around with that. I humbly raise an idea to calculate x0,y0 as per image attached. It should be easy for you to catch up.  
@ilovefb2k

2-1) Properties still reset sometimes.
2-2) Thanks for adding margin properties for top and bottom. I asked this just for consistency since I always set them to 0.

The alignment option works great. I always put it to Center. It rises an issue though. When the available height is greater than needed the vu meter is aligned correctly. However (after adjusting PivotPointX and PivotPointY) at high output the needle displays under the allotted space for the VU meter. and under the opaque L_2 png. See attached screenshot (needles in red to show the issue).

As you can see in the screenshot the original VU meter resizes automatically to use full available space.
Is this functionality you are going to look into as well?
I realize that angle calculations will become more complicated.

Another nice feature of the original VU meter is that you can adjust sensibility my using control mousewheel. which would be a great feature instead of entering a fixed value in properties.

Thx
Def

Re: JScript Panel script discussion/help

Reply #1923
okay i give up  :'( i don't see \profile\skins\viking\scripts\jsp3\{deployed} AIMP Analog VU Meter.txt here what I see



Re: JScript Panel script discussion/help

Reply #1924
@telboy1812

AIMP Analog VU Meter.7z (beat_audio_vu_meter, {deployed} AIMP Analog VU Meter.txt)
https://mega.nz/file/4TslWCzT#qexjdlX0j_jjET072IPwo-_iDqUHik86j-8HedGVdbU

Place the skin folder in:
\profile\skins\viking\images\vnav_fb2k\beat_audio_vu_meter\

Prepare JScript Panel 3 Panel and load "{deployed} AIMP Analog VU Meter.txt". JScript Panel 3 Panel context menu > Configure... >Tools > Import
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)