Author Topic: A plugin to be able to use foobar2000 / AIMP VU-meters  (Read 28913 times)

hiccup

  • Hero Member
  • *****
  • Posts: 9135
So when you extract to Frame1 and Frame2 folders, the frame1 folder holds all the images related to needle movement and the Frame2 folder holds all the images related to the LED.
And what I don't really understand:
There are many VU meters that have separate Left and Right VU meters. (or top and bottom)
Often those come in 2 bin files where one ends with 1 and the other with 2.
Like Accuphase1 Accuphase2. Or M3581 and M3582.  (In foobar2000 they will be listed as Accuphase and MK358)
But sometimes they are combined into 1 bin file.
Like the one that I created and showed a few posts below. (it's also in your PM)
But when you use VUEditor to extract such bin files, you only get the images of the left meter. So the extractor doesn't seem able to see the right meter, but the foobar2000 plugin does?

I also don't really understand why you need to be concerned about location and movement of the needles?
That is defined at the stage when the VU meter is created?
Oh, you are probably not talking about the foobar2000 implementation but about how AIMP does it?
I have no insights in those a.t.m.


edit for completeness:
There can also be bin file #3
That one is for a mono version of the VU meter. Which can be very useful when available (horizontal) space is limited:

mono

stereo
Last Edit: August 24, 2024, 08:36:55 AM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
And what I don't really understand:
There are many VU meters that have separate Left and Right VU meters. (or top and bottom)
Often those come in 2 bin files where one ends with 1 and the other with 2.
Like Accuphase1 Accuphase2. Or M3581 and M3582.  (In foobar2000 they will be listed as Accuphase and MK358)
But sometimes they are combined into 1 bin file.
Like the one that I created and showed a few posts below. (it's also in your PM)
But when you use VUEditor to extract such bin files, you only get the images of the left meter. So the extractor doesn't seem able to see the right meter, but the foobar2000 plugin does?

It appears the extractor cannot extract the right meter. Most meters have the same image for left and right but I found one (6noname.bin) with different images and the extrator will only give me the left images and the LED frames, if I add a third directory to the command line it doesn't like it.

As for when multiple bins are listed eg) M3581, M3582. Foobar uses M3581 for the left image and M3582 for the right image. I found that out by copying noname.bin to noname1.bin and nomane2.bin. When I loaded it up it had "left" listed on both sides of the image. So if the left and right images are the same and there are m3581.bin and m3582.bin files, you could probably delete one and rename the other to M358.bin and it would still work.

If it's a single bin it just uses the same image for both sides. That's also how the AIMP skins work, they either contain 3 image files (0.png, 1.png, 2.png). Same images used for left and right or 6 (L_0.png, L_1.png, L_2.png, R_0.png, R_1.png, R_2.png).

I made a 60fps video alternating a single frame of the needle and LED dumped from the bin file of your skin. While it does work it has a strobe effect and you can tell. So that idea is out.

It's really got me stuffed how they do it....maybe the background, needle and LED are stored separately in the bin file, similar to how AIMP do it and the extraction process just renders them into 1 image per frame so that function is just a red herring on how it actually works. Actually just noticed a "back.bmp" image gets dumped in the extraction which is the background without the needle on it. So I'm probably right. It's the only thing that makes sense.

It's looking very unlikely I'll be able to support the bin files natively unless I'm right about the parts being stored separately and someone has some magic sauce on how to get them out.

But it shouldn't be too difficult to convert a bin file into the AIMP format although it would be a manual process and you would lose the accuracy most likely. I would have to work out some extra code to add LED options.

AIMP skins can be formatted to look like an LED but it replaces the needle, you can't have both. You can have a needle on the left and an LED on the right or vice versa but you can't have both a needle and an LED on the same side at the same time.

edit:
This one thew a spanner in the works - ArtsAcoustic, up until that one the left and right images have been the same dimensions so I need to change my code a bit to cater for that.

I fixed this issue. That skin is an example of how you can combine the left and right sides to look like one meter. It's kind of clever how they did it. They put a huge pivot offset so it looks like its sliding left and right on a straight line but it's actually rotating on a huge curve. It's just so large it doesn't register as being curved and they had to set the angle values very low as the degree of the needle is only changing by very small amounts. Most skins have a range of 50-80 degrees, that one only has a range of 0.20 degrees.
Last Edit: August 24, 2024, 11:27:57 AM by BoringName

hiccup

  • Hero Member
  • *****
  • Posts: 9135
I have created a version of my VU meter for AIMP to be able to more clearly see differences in outcome between the foobar2000 and the AIMP implementation.
It's just finished, so it's only a rough first opinion on what I see:

The AIMP version doesn't look too bad at this first attempt, but its needle action isn't that great. (yet)
It's acting very nervous, and I'm not satisfied about how it covers the available space.
I might be able to improve on that tweaking the .ini file. Not sure at the moment. Will try later.

To be honest it's probably not a fair comparison at this moment:
I have spent A LOT of time tweaking the response curves for the foobar2000 version, and only some 15 minutes on getting the needle at least being ball-park correct for the AIMP version.


foobar2000 top, AIMP bottom:

(the difference in colouring between the two is intentional ;-)

PS
If you want to hear the music that was playing during the screencapture:
It's the first minute of Supertramp's  'Bloody Well Right'
(good luck with hitting 'Play' at the exact right moment ;-)

edit:
The observant viewer surely will have noticed how the LEDs in the foobar2000 version are now more in an on/off state, instead of being gradually dimmed (unnatural) in previous versions.
It's the brilliant mind of the creator of the foobar2000 implementation that allows for such detailed tweaks.
Just tweak the curve for the lamps (LEDs):

Last Edit: August 24, 2024, 10:01:04 PM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
The AIMP version doesn't look too bad at this first attempt, but its needle action isn't that great. (yet)
It's acting very nervous, and I'm not satisfied about how it covers the available space.
I might be able to improve on that tweaking the .ini file. Not sure at the moment. Will try later.

The AIMP player is very jittery on the ones I have looked at. Some Skin.ini files have MobilityNegative and MobilityPositive settings. I haven't played around with those at all, I assume they affect the rise and fall speed of the meter.

The aimp implementation probably isn't that great for meters with a wide range because they just divide the range evenly, you will find the needle rarely gets as high as it should. It seems to work better with meters starting at minus 20 instead of minus 60.

I tried to decompile the foo_vis_vumeter.dll which didn't really leave me a lot to go on. But there was a reference to 3 strings. CreateTexture1, CreateTexture2, CreateTexture3. Which reinforces the idea that they draw each element separately and the export option is a red herring on how it works. One texture for the background, one for the LED and one for the Needle and they just draw them in layers on top of each other.

Still doesn't help much but at least I'm more sure on how they do it now.

The needle on mine moves more like the foobar version in your gifs.

hiccup

  • Hero Member
  • *****
  • Posts: 9135
Some Skin.ini files have MobilityNegative and MobilityPositive settings. I haven't played around with those at all, I assume they affect the rise and fall speed of the meter.
Yeah, I have searched for documentation explaining the available/necessary variables but haven't fully succeeded.
First I'll have to get the angles stuff figured out.

This helped:


I'm now creating an Excel sheet where you can enter the coordinates of rotation axis, needle position etc. and the sheet will spit out the exact angles that need to be entered in the .ini
After that I'll be figuring out what MobilityPositive and MobilityNegative are doing exactly.

hiccup

  • Hero Member
  • *****
  • Posts: 9135
I'm now creating an Excel sheet where you can enter the coordinates of rotation axis, needle position etc. and the sheet will spit out the exact angles that need to be entered in the .ini
After that I'll be figuring out what MobilityPositive and MobilityNegative are doing exactly.
Success!
The result is now much better and less nervous: (bottom)



But the foobar2000 version is much more lively and responsive. (top)
I wish that the AIMP implementation had a curve function, similar to the foobar2000 one. That could probably improve things a bit.
But perhaps you can add something for that in the plugin you are working on?
 
Last Edit: August 25, 2024, 10:47:52 AM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
The result is now much better and less nervous: (bottom)
But the foobar2000 version is much more lively and responsive. (top)
The AIMP is still registering too low though. I don't think you can fix that in the ini settings. It's the issue I mentioned previously with how AIMP plots out levels.

I wish that the AIMP implementation had a curve function, similar to the foobar2000 one. That could probably improve things a bit.
But perhaps you can add something for that in the plugin you are working on?

My main goal was just to get the skins working. Both the AIMP version and the foobar bin files. Though the latter is looking less likely. I hadn't planned on the meters being so inaccurate or adding functionality for people that want to make their own. I don't know if I'll implement any kind of scaling options, even if I could figure out how to do it.....

But I'm confident between the Min/Max angle, Min/Max Level and PivotPoint settings, I should be able to guesstimate the size of the meter and automatically adjust the logarithmic formula to be closer to the mark than it currently is in AIMP. It's never going to be perfect as some skins have varying gaps between levels and some are scaled. There is no way I can account for both with the info in the INI files.

For people that want to create their own, they might just need to adjust where the level markers are to match where the needle goes in Musicbee rather than me adding options to adjust where the needle goes. Probably not what you want to hear but that's probably the way I'm leaning at the moment.

hiccup

  • Hero Member
  • *****
  • Posts: 9135
For people that want to create their own, they might just need to adjust where the level markers are to match where the needle goes in Musicbee rather than me adding options to adjust where the needle goes. Probably not what you want to hear but that's probably the way I'm leaning at the moment.

I'm thinking that maybe I am walking a bit too far in front of the parade ;-)
It will already be marvelous if you manage to come up with something that has moving needles in them.
Let's worry later about the quality and usability of the needle actions?

I have been able to get more satisfying results by using values that are not per-se the values that the VU meters are showing.
It's still not as good as what foobar2000 produces, but it's not bad either:


BoringName

  • Sr. Member
  • ****
  • Posts: 916

Let's worry later about the quality and usability of the needle actions?


After being neck deep in logarithmic regression equations for most of the day, I think I agree.

So I got the formula nutted out and while it mostly works, I'm not overly happy with it but I think I just have to let it go. The layout of the skins varies far too much to get anything that's going to be accurate all of the time. For some of them, AIMP's method is actually better. I'm only noticing a problem because I'm running a test track with fixed values so I can see the needle marks don't line up properly. When a song is playing it looks fine and it is more accurate than AIMP most of the time from what I can tell.

I think most people should be happy.

For people that want to create one that's more accurate, I can probably provide a spreadsheet where you enter in the MinAngle, MinLevel, ZeroAngle and it will spit out all the calculated angles for each level in between so you can fine tune the image to match.

I might also add a checkbox to use AIMP's method as that does work better for meters that are evenly spaced.

I just need to clean up the code a bit and test a few more meters just in case I've missed something and then I'll make it available. I'm away until the end of the week so it will probably be the middle of next week.

sveakul

  • Hero Member
  • *****
  • Posts: 3285
I might also add a checkbox to use AIMP's method as that does work better for meters that are evenly spaced.

I just need to clean up the code a bit and test a few more meters just in case I've missed something and then I'll make it available. I'm away until the end of the week so it will probably be the middle of next week.
Yes, please do add the checkbox option to choose the AIMP method!  Your efforts and committment to provide the most accurate readout possible are fully appreciated, BoringName!  They do not go unnoticed;  we are lucky to have an expert like you sweating this out.  I understand hiccup's frustration but I don't want some "prop" just bouncing a needle around for the sake of having it available.  With the CEN spectrum and this project we are finally getting some pro metering available for this player.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
we are lucky to have an expert like you sweating this out.

Expert at google :)

The existing skins won't be overly accurate but it should be possible to create moderately accurate meters or adjust existing skin images to be more accurate. I have noticed a few of them don't have the correct values listed for Min/Max levels in their Skin.ini files which is a bit nuts.

To be honest I'm not even sure how accurate this whole process can be. I can read the peak levels from the audio device on the PC but all my calculations after that are based on the sample files here.

I have no idea if they are accurate or if they are device specific as from what I've read about decibels, it's all relative really. I guess it's as accurate as it can be when trying to make a pretend analog VU meter from digital sources.


hiccup

  • Hero Member
  • *****
  • Posts: 9135
I now better understand the grounds of why I had some reservations about AIMP's implementation vs. foobar2000's.
It proved that it was more caused by- and related to the available VU meters than to the engine driving it.
The vast majority of VU meters for AIMP are mainly focused on 'looks', and not so much on being accurate, or making good use of the available space for needle movement.
So because I couldn't find any meter that seemed really accurate, and the variations on usability were so large and a bit confusing, I thought to create one myself with it's main purpose to be accurate, showing exactly what is what.
In the hopes of gaining a better understanding of what was really going on here.

The result is much better than I was hoping for. The needle is pointing to the exact correct dB values, and the needle movement in general is also pretty, pretty good:



I have named it AcuVU, and it can be downloaded here

edit
The download link has been removed. I am working on a new version that has some improvements and will share it when/if a functioning VU meter plugin has been released.
Last Edit: August 31, 2024, 09:42:55 AM by hiccup

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10276
I have named it AcuVU.
This is very promising!!
I assume all files in the ZIP go into the plugins directory?
Incorrect assumption because there's no DLL file.
And not in the skins directory because there's no XML.

So where?
Last Edit: August 28, 2024, 10:44:48 PM by phred
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

hiccup

  • Hero Member
  • *****
  • Posts: 9135
I assume all files in the ZIP go into the plugins directory?
Incorrect assumption because there's no DLL file.
And not in the skins directory because there's no XML.
So where?
Nowhere, this is for AIMP.
As explained before, at this moment a VU meter plugin for MusicBee does not exist.
I only shared this so that BoringName, Sveakul or others interested in this can use it for their own testing.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10276
Nowhere, this is for AIMP.
As explained before, at this moment a VU meter plugin for MusicBee does not exist.
Yes, you did explain previously, but I thought with this now being available as a download, it was for MB.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here