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 523812 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel script discussion/help

Reply #2025
But I am puzzled by this post. Were you able to retrieve the back (L_0), needle (L_1) and glass (L_2) from the BIN?
You state, "we then apply a formula to convert decibel into angle" ... how and what?
ilovefb2k's method will only work for certain skins. When the BIN file is created with the VUEditor, it merges the needle and glass pixels so you can't separate them.

You can extract the background image without any problems.
You can extract a full needle image only if there is at least one angle where it will not be covered by a glass element.
You can extract full LED images.

The problem with just extracting images is you have to manually configure the pivot point and scale of the meter. While it's a lot more complicated up front, decoding the BIN file properly will produce a much better result.
Ok. I'll wait and won't respond to posts that rise  more questions than answers.

FYI. Earlier in this thread I described a working but very elaborate way of creating a AIMP skin from the 7inch_3 BIN and using VU Editor to help at least with finding the correct angles to use in skin.ini.
https://hydrogenaud.io/index.php/topic,110516.msg1054186.html#msg1054186

Re: JScript Panel script discussion/help

Reply #2026
The current version of the sample script now has built-in a lot of the stuff I originally added including mousewheel support on art and image support for buttons.
I took current version of the sample script and applied the things I still miss like optional transparency, stub art, extra buttons with optional font/size support and rightclick functions.
Hereby attached the upgraded version (v11). It needs the (same old) stub art of course to be extracted as well.
Let me know if it works as intended.

Text Display + Album Art + Seekbar + Buttons - v11 with middle mouse button

Re: JScript Panel script discussion/help

Reply #2027
@Air KEN
@Jacob91
 
Two modifications:

1) For the time being I've activated the stub Radio.png for playing streams until I have a solution for displaying the current streaming artist image instead of another stub image.

2) Doubleclicking the text part on normal tracks opens the containing folder in an explorer window.

No changes in the stub images, but added to be complete.

Re: JScript Panel script discussion/help

Reply #2028
Text Display + Album Art + Seekbar + Buttons - v11 with middle mouse button
Can you send me your script? You implemented some extra buttons and my modified script also has no middle mouse action.

Re: JScript Panel script discussion/help

Reply #2029
We think Santa Claus is true and He just bought us a Xmas present.

Here's another - BinExtractor1.1.zip

BinExtractor will now take 2 command line arguments. The first is the path to the bin file and the second is a frame number.

eg)
BinExtractor.exe "C:\FoobarSkins\McIntosh.bin" 400

This will extract the background image, needle and LED frame for frame number 400 into the following folders
C:\FoobarSkins\McIntosh\left
C:\FoobarSkins\McIntosh\right

If there is no right meter the folder will be empty.
The frame number argument starts at zero so if a skin has 1024 frames and you want the last one you need to use 1023.

If the frame number argument is omitted it will extract all the frames. As previously mentioned this has the potential to create A LOT of files, over 4000.

If you specify a frame number argument that is larger than the number of frames in the specified bin file, it will extract all frames.

If you extract a bin file that only has LEDs and no Needles, it will still create a needle file for each frame, they will just be blank.

This is provided as is, use at your own risk. It doesn't really check for errors and if the arguments are wrong it will just exit without letting you know why. Make sure you enclose the bin path in quotes if it has any spaces in it.

Edit: Also I hinted about this earlier but you may find some needle images contain parts of the background image as well. This isn't a bug with the extractor, it's just how the needle pixel data has been stored by the original VUEditor program. I don't know if this is a bug with the original program or intentional to provide some form of antialiasing or other reason.

Re: JScript Panel script discussion/help

Reply #2030
@Defender
Thanks!  :)
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #2031
Text Display + Album Art + Seekbar + Buttons - v11 with middle mouse button
Can you send me your script? You implemented some extra buttons and my modified script also has no middle mouse action.

Text Display + Album Art + Seekbar + Buttons - v11 with middle mouse button mouse wheel + extra buttons

Re: JScript Panel script discussion/help

Reply #2032
@Jacob91
Thanks.
It would be nice if all the buttons were centered. Thanks.
------
Sorry. It's done.

Line: 110
   var x      = (panel.w - (bs * (btot + 1))) / 3.8;   // Last button also needs bs width

Use "foo_flowin"

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

Re: JScript Panel script discussion/help

Reply #2033
extra buttons
@Jacob91 @Air KEN

Hi Jacob,

Couple of things. Your script is based on an older version version of my script. Therefore you miss out on left doubleclicking on the textpart to open an explorer in the folder of the currently displayed track. You also won't get a Radio stub image displayed on a stream.

Random was already implemented by rightclick on Play/Pause.
Show Console I now added as a rightclick on Preferences.
I added support for an optional Albumlist button. Go to line 57 and set var al_enable to 1 to have it displayed.

I also made sure alignment is centered again. Hereby attached the modified version. (With required stub images which did not change).

Enjoy!

NB. With mouseover on buttons the second line of help shows the assigned rightclick function when implemented.

Re: JScript Panel script discussion/help

Reply #2034
@Jacob91 @Air KEN

I don't use the Text Display + Album Art + Seekbar + Buttons - v12 script myself. I use image based AudioControl buttons.

Buttons are different to:
Menu, Stop, Play/Pause, Previous, Next, PBO, Randomize selection, Queue selection, ReplayGain, DSP preset, OutputDevice - All with rightbutton extras, which are described in the script itself.

Have a look. Maybe gives an idea for other text based buttons. Attached is cui-configs_AudioControls.rar with required base script and images.

Re: JScript Panel script discussion/help

Reply #2035
hi Defender as I can't get to grasp with these scripts and I have tried could you try text display and buttons please no hurry as I am off to bed soon early shift tom

Re: JScript Panel script discussion/help

Reply #2036
I can't get to grasp

You can't grasp anything. Just give it up and go away.

I've seen the huge amount of time and effort numerous people have spent trying to help you and you throw it back in their face every single time by never understanding anything you've been told.

Re: JScript Panel script discussion/help

Reply #2037
We think Santa Claus is true and He just bought us a Xmas present.

Here's another - BinExtractor1.1.zip

BinExtractor will now take 2 command line arguments. The first is the path to the bin file and the second is a frame number.

eg)
BinExtractor.exe "C:\FoobarSkins\McIntosh.bin" 400

This will extract the background image, needle and LED frame for frame number 400 into the following folders
C:\FoobarSkins\McIntosh\left
C:\FoobarSkins\McIntosh\right

If there is no right meter the folder will be empty.
The frame number argument starts at zero so if a skin has 1024 frames and you want the last one you need to use 1023.

If the frame number argument is omitted it will extract all the frames. As previously mentioned this has the potential to create A LOT of files, over 4000.

If you specify a frame number argument that is larger than the number of frames in the specified bin file, it will extract all frames.

If you extract a bin file that only has LEDs and no Needles, it will still create a needle file for each frame, they will just be blank.

This is provided as is, use at your own risk. It doesn't really check for errors and if the arguments are wrong it will just exit without letting you know why. Make sure you enclose the bin path in quotes if it has any spaces in it.

Edit: Also I hinted about this earlier but you may find some needle images contain parts of the background image as well. This isn't a bug with the extractor, it's just how the needle pixel data has been stored by the original VUEditor program. I don't know if this is a bug with the original program or intentional to provide some form of antialiasing or other reason.
hi @BoringName,
Thank you very very much for your help. without your tool, we can not do anything with fb2k Vu Meter.
But your have just made it more fantastic, we can now extract the BIN file on-the-fly,  it works flawlessly.

we still try to have FB2k_VU_Meter bin  decoded natively to save CPU-load and reduce RAM consumed, but this tool surely inspires us in a very positive way.
again, thank you a lot for your time.

wish your all the best and a very happy, enjoyable weekend.
regards
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #2038
AIMP Analog VU Meter deployed, version named 1.0.16 DT-M 16-Nov-24
@ilovefb2k
Spoiler (click to show/hide)
MEMORY USAGE:

When using any of the H and C scalings except H:Maximize and switching between them your script hardly uses any extra memory. All of these scalings however display part of the needle below L_0 & R_0 (and L_2 & R_2). Only H:Bottom looks fine because it probably paints the lower part of the needle outside of the panel.

The moment you switch to H:Maximize or any of the V and R scalings the needle is displayed correctly within image boundaries.
However memory uses goes up by a lot. Lowest value I have seen is +400MB, but sometimes it goes up by +1000MB. CPU usage stays low.
Any switch in scaling you do after you selected a high memory scaling, keeps the memory at those elevated levels even when playing stops or plugin is not displayed.
I also encountered some very infrequent freak spikes up to +2000MB while testing before fooBar became unstable and had to be killed.

Spoiler (click to show/hide)
LAMP/LIGHT:

With VU Editor you can add a light/lamp overlay (with has the same dimensions as L_0 & R_0), that starts to be displayed as an overlay from a certain peak level to a maximum with increasing opaqueness.  I use two knots in VU Editor values +0,0% and +4,100% with linear scale in between.
Can this be implemented in your script by adding the lights as L_3 & R_3 with PROPERTIES such as lowlight_dB, lowlight_perc and highlight_dB, highlight_perc?

I attached current version of my transparent AIMP style skin (red needles) with proposed lamp/light overlays included. Also a gradient BIN style (black needles) with red light/lamp. Also a small video with both VU meters running and show the light/lamp on the BIN.
Spoiler (click to show/hide)
4. LAMP/LIGHT: well-noted.
best regards,
@ilovefb2k
hi @Defender;
thanks to recent JSP3 updated by @marc2003 (3.8.4, 3.8.5), we now can address the 'weird tail' of the skin and reduce RAM consumed (but not much).

LAMP/LIGHT:  i already enclosed this in the script, but may not as your suggestion, please make changes if any and refer to later post for a full script.  navigate to line 3398, the main script is there.
we have to change the filename of that lamp from L_3.png, R_3.png into L_4.png, R_4.png as @sveakul already uses these filenames for another skin (DejaVU Compact LED Calibrated Elemental-mod2)

Code: [Select]
	// layer 2.2 > turn peak LED on, if any
//-----------------------------------

for (c = 0; c < channels_count; c++) {
opacity[c] = 0;
if ( Peak_LED_levels[c] > 0 && aimp_peak_LED_img[c] ){
db_ = _clamp(db_peak_LED[c], lowlight_dB[c], highlight_dB[c]);
minOpacity = highlight_perc[c]/100; maxOpacity = 1-lowlight_perc[c]/100;

opacity[c]  =  ( db_ -  lowlight_dB[c])/(highlight_dB[c] - lowlight_dB[c]) ;

if (db_ >= highlight_dB[c] || db_ >= MaxLevel[c]) opacity[c] = maxOpacity;
else if (db_ <= lowlight_dB[c] ) opacity[c] = minOpacity;
else
opacity[c] = minOpacity + opacity[c] * (maxOpacity - minOpacity);//linear scale

opacity[c] =  _clamp(opacity[c],0,1);
}

try {
if (opacity[c]  != null )
gr.DrawBitmap (aimp_peak_LED_img[c],
x_[c],y_[c],ww_[c],wh_[c],
0,0,wwc[c],whc[c],opacity[c]);


} catch (e) {
console.log('\n\n-------------',window.Name, ' : Error line 3300, /AIMP_VU_Meter_needle_render/ = ',e);
}
}


 hope this helps.
regards
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #2039
hope this helps.
I'd love to test it. My current script is version "1.0.16 DT-M 16-Nov-24" and it only has 3144 lines ... Did I miss a more recent version with more lines?

Re: JScript Panel script discussion/help

Reply #2040
xmas present
Great news. This is also one of my preferred BIN's.

But I am puzzled by this post. Were you able to retrieve the back (L_0), needle (L_1) and glass (L_2) from the BIN?
You state, "we then apply a formula to convert decibel into angle" ... how and what?

Nice screenshot. Can you send a working extracted set of L_0, R_0, L_1, R_1, L_2. R_2 with skin.ini from this BIN?
hi @Defender,
hope that i do not miss any your post and sorry for  jumping in between you and @BoringName  's discussion.
about your  feedback:
- Were you able to retrieve the back (L_0), needle (L_1) and glass (L_2) from the BIN? : No, all the magic things done by @BoringName , we just employ @BoringName's fantastic tool BinExtractor https://getmusicbee.com/forum/index.php?topic=41692.msg229228#msg229228 and BinExtractor1.1 https://getmusicbee.com/forum/index.php?topic=41692.msg230008#msg230008 and get all needle images, LED images and background. @BoringName has just done us a favor by compiling this tool as a command-line utility (1.1).

- You state, "we then apply a formula to convert decibel into angle" ... how and what? : as i said, i have no idea about Vu Meter, just copy this formula from here https://www.aimp.ru/forum/index.php?topic=52865.msg325066#msg325066 . frankly, how hard we have tried, we could not figure out how these parameter related to each others (INI file of AIMP analog Vu Meter):
MinAngle, MinLevel
ZeroAngle,ZeroLevel
MaxAngle, MaxLevel

- Can you send a working extracted set of L_0, R_0, L_1, R_1, L_2. R_2 with skin.ini from this BIN? : we get around 1000 images for needle/channel and 1000 images for LED/channel.

regards,
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #2041
we get around 1000 images for needle/channel and 1000 images for LED/channel.
I got the message already by Boringname :-)
Please send me a working script to enable me to test lights/lamps.

Re: JScript Panel script discussion/help

Reply #2042
Oh for fucks sake, please make it stop. This thread is now a complete dumpster fire. I was expecting half a dozen images required at most for these cancerous fucking analog meters. Now you're talking about hundreds/thousands. Fucking idiots the lot of you. :/

Re: JScript Panel script discussion/help

Reply #2043
Oh for fucks sake, please make it stop. This thread is now a complete dumpster fire. I was expecting half a dozen images required at most for these cancerous fucking analog meters. Now you're talking about hundreds/thousands. Fucking idiots the lot of you. :/
LOL. I just asked for a working script :-)
But you are right, this has nothing to do with JSP3 as such,

@Iovefb2k
Can you open a separate thread regarding your script?

Re: JScript Panel script discussion/help

Reply #2044
hi @all,
another weekend is coming, friYaY and also another holiday season to come.
please find a script attached, named JSP3 Analog VU Meter, version 1.0.0 DT-N 23-Nov-24 for easy reference.
   - features :
      + load analog/needle AIMP Vu meter (after unziping)
       + load FB2K VU Meter (after extracting by @BoringName 's tool).
      + free allocation in panel
      
   - AIMP VU Meter types covered:
      1 > AIMP VU Meter:
      + analog NEEDLE only (not analog LED) =>  vertical/horizontal needle, up/down needle arrow ,>< V & /\ needle shape.
         * type 1 : 1 image set for both channels
         * type 2 : 2 image sets, each for each channel.
      + LED (LVU) :  vertical/horizontal bar
      - how to :
      + download AIMP Vu Meter skin file e.g.
         * analog NEEDLE : https://www.aimp.ru/forum/index.php?topic=52865.0
         * LED (Led VU) : https://www.aimp.ru/forum/index.php?topic=54005
      + unzip AIMP Vu Meter skin into a folder and copy this [folder] to specific directory as indicated by this script.
      + load this script into a JSP3 /UI/ panel
      2> FB2K VU Meter:
      - step 0: get a FB2k Vu meter skin (e.g. https://audio-file.org/foobar2000-vu-meter-skins-gallery)
      - step 1: extract bin file by employing @BoringName's tool: https://getmusicbee.com/forum/index.php?topic=41692.msg230008#msg230008
            (re-post by @BoringName 's permission https://getmusicbee.com/forum/index.php?topic=41692.msg229964#msg229964)
            we may get 1024 needle image files (needle0000.png, . . . needle1023.png), 1024 LED image files (LED0000.png, . . LED1023.png),
            background.png per channel.
            => 1024 + 1024 + 1 = 2049 files /channel x 2 channels = 4098 files.
            
      - step 2: create a folder named after 'name.bin' (name is fb2k skin name, e.g. 'fisher', 'accuphase', 'sony'...).
      - step 3: if skin has 1 set needle, 1 set LED images : create a sub folder 'VU' for needle images, a subfolder 'VU_LED' for LED images
              if skin has 2 needle sets, 2 LED image set: create a sub folder 'VU_L' for left needle images, a subfolder 'VU_LED_L' for left LED images
              then, 'VU_R' folder for all right needle images, 'VU_LED_R' for all right LED images.
              all these subfolder are right under 'name.bin' folder.
      - step 4: copy/move 'name.bin' folder into specfic folder as indicated in the script,line 140  [fb.ProfilePath + "skins\\viking\\images\\vnav_fb2k\\beat_audio_vu_meter\\"];       
            we can change this path to any other for convinience.
      note: we recognised this folder as FB2k VU Meter skin by its '.bin' characters, so make sure to have this text in the folder name.       
   - limitation:
      + options: MobilityNegative, MobilityPositive > could not take MobilityPositive into account.
      + meter range (in the skin) is quite inaccurate based on fb2k's audio engine.
      + Fb2k's VU Meter skins are currently consumed high RAM memory.
         note: refer to fb2k , @oops's, Analog VU Meter Visualisation/foo_vis_vumeter component [https://www.foobar2000.org/components/view/foo_vis_vumeter]
         for more options    
   - credit and acknowledgment:
      + @marc2003 for rich-feature and powerful, rapid-updated JSP3 component.
      + @Case and @marc2003 for their JSP3 VU Meter.
      + @Artem and contributors /AIMP VU Meter - analog NEEDLE/ for their beautiful analog VU Meters.
      + @xrEngine and contributors /AIMP VU Meter - LED / for their elegant LED VU Meters.
      + @BoringName at https://getmusicbee.com/forum/index.php?topic=41692.msg230008#msg230008 for BinExtractor.exe tool to extract fb2k VU Meter bin skins.
      + @Defender, @sveakul and @Air KEN for nice suggestions and positive feedbacks.
   - special JSP3 features:
      + IJSImage.CreateBitmap() : (3.8.4++) to reduce memory consumed before caching.
      + gr.PopLayer()  : (3.8.5++) set a boundary to be visualied.
      + gr.DrawBitmap() : (3.8.4++) improve rendering image due to  image-converted Bitmap in advance, more efficient CPU-load.

wish you all a very nice weekend and happy holiday season to come.
hope that you all can find this humble script a little bit joyful.
regards,
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #2045
sorry for double posts.
@marc2003: please delete.
@ilovefb2k

Re: JScript Panel script discussion/help

Reply #2046
Oh for fucks sake, please make it stop. This thread is now a complete dumpster fire. I was expecting half a dozen images required at most for these cancerous fucking analog meters. Now you're talking about hundreds/thousands. Fucking idiots the lot of you. :/
hi @marc2k3,
sorry for spamming your thread, but luckily we have already reached the end.
thank you for your powerful JSP3 component and wish you a very nice weekend.
@ilovefb2k 

Re: JScript Panel script discussion/help

Reply #2047
frankly, how hard we have tried, we could not figure out how these parameter related to each others (INI file of AIMP analog Vu Meter):
MinAngle, MinLevel
ZeroAngle,ZeroLevel
MaxAngle, MaxLevel

MinLevel - The minimum level displayed by the meter in decibels. eg) -40, -20 etc..
MinAngle - The angle of the needle when the peak level is at or below the Minlevel
ZeroLevel - What level should be classed as zero. It's nearly always set to zero. It's a method to offset the meter for AIMP users as AIMP doesn't allow you to adjust the decibel level like Foobar and my plugin in Musicbee do with the mousewheel.
ZeroAngle - The angle of the needle when the peak level is 1.0 (zero decibels).
MaxLevel - The max level displayed on the meter in decibels eg) 5, 10 etc...
MaxAngle - The angle of the needle when the peak level is at or above the MaxLevel.

This is the code I use in C#. The reason it's not just maxAngle - minAngle * peak is some meters use a different scale for each side of zero.
Code: [Select]
if (peak > 1.0)
{
    rotOffset = (zeroAngle - minAngle) + (peak - 1.0f) * (maxAngle - zeroAngle);
} else {
   rotOffset = peak * (zeroAngle - minAngle);
}
rotation = minAngle * Constants.radian + rotOffset * Constants.radian;

Sorry if I added to the dumpster fire. I did warn about the insane amount of image files that method would create......but who am I to judge.

If you want any more info ilovefb2k just send me a PM and I'll see if I can help.

Re: JScript Panel script discussion/help

Reply #2048
frankly, how hard we have tried, we could not figure out how these parameter related to each others (INI file of AIMP analog Vu Meter):
MinAngle, MinLevel
ZeroAngle,ZeroLevel
MaxAngle, MaxLevel

MinLevel - The minimum level displayed by the meter in decibels. eg) -40, -20 etc..
MinAngle - The angle of the needle when the peak level is at or below the Minlevel
ZeroLevel - What level should be classed as zero. It's nearly always set to zero. It's a method to offset the meter for AIMP users as AIMP doesn't allow you to adjust the decibel level like Foobar and my plugin in Musicbee do with the mousewheel.
ZeroAngle - The angle of the needle when the peak level is 1.0 (zero decibels).
MaxLevel - The max level displayed on the meter in decibels eg) 5, 10 etc...
MaxAngle - The angle of the needle when the peak level is at or above the MaxLevel.

This is the code I use in C#. The reason it's not just maxAngle - minAngle * peak is some meters use a different scale for each side of zero.
Code: [Select]
if (peak > 1.0)
{
    rotOffset = (zeroAngle - minAngle) + (peak - 1.0f) * (maxAngle - zeroAngle);
} else {
   rotOffset = peak * (zeroAngle - minAngle);
}
rotation = minAngle * Constants.radian + rotOffset * Constants.radian;

Sorry if I added to the dumpster fire. I did warn about the insane amount of image files that method would create......but who am I to judge.

If you want any more info ilovefb2k just send me a PM and I'll see if I can help.
hi @BoringName ,
wow, we will have something to chill this weekend.
thank you very very very much for your valuable information and see if we can digest this to not bothering you again.
P/S. @marc2003 just said so, but @marc2003 is kind and nice inside. without recent JSP3 updated, we still struggle with an annoying bug of the JSP3 Analog Vu Meter.

best regards and nice weekend,
@ilovefb2k  

Re: JScript Panel script discussion/help

Reply #2049
new script
First look ... first findings (and very pleased btw).
I'm running my original AIMP skin based on VU Editor project and did not extract a thing.

Proper transparency support (like it already was).
Music stopped, needle goes to the defined MinLevel in all scalings now. Fixed.
No more needle ghosting outside of glass L_2/R_2, cutoff btw should be one pixel higher.
There's lights/lamps in scaling mode with standard aspect ratio. Lights are not shown in H:Maximize though.

What's the reason that I only see one needle in V/H:Maximize (old issue)?

So it seems all the visuals are in place, just needs some tweaking.
Still missing a much needed mouse scrollwheel though to adjust the needle(s).

I won't be able to test for the upcoming month. Only access to a laptop with probably limited/no internet access and I'll be submerged a lot of the time.