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: foo_vis_spectrum_analyzer (Read 100890 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: foo_vis_spectrum_analyzer

Reply #200
I missed this reply earlier...

The component doesn't work on anything older than Windows 10 because it calls GetDpiForWindow function, which was introduced in Windows 10. If the function is necessary to get over all the DPI issues people have suffered one simple solution would be to only use it on Win10 or newer.
It's not necessary but the ID2D1Factory::GetDesktopDpi() got deprecated and replaced by GetDpiForWindow(). And yes, that makes me a little liar... I forgot I made this change. I try to deliver a warning free build and don't like 'deprecation' warnings. I'll add a fall-back case for older Windows versions.

I noticed the visualization element is created with default bright background causing it to flash rather nastily on start before rendering its correct colors.
Should be fixed in the next release.

There may be something wrong with the fancy up/down arrows next to numeric values. With default config for example hitting the up arrow next to Pitch increases the value from 440.00 to 440.50. Then hitting down arrow changes the value to 44.50.
Will be fixed in the next release. I used a factor of 10 instead of 100 in the division.

Re: foo_vis_spectrum_analyzer

Reply #201
OK, I've reproduced the gradient, this being within the 64-bit installation; I have two spectrum analyzers in the layout.

What I did on the left was duplicate the second color from the top by selecting it, clicking "Add", and keeping the color pre-loaded into it. This shifted everything below it downward as one would expect. Then I removed that color. Things shifted back up but not all the way.

As it happens, I like it better this way; please don't fix it too quickly and restrictively.  ;D

Re: foo_vis_spectrum_analyzer

Reply #202
As it happens, I like it better this way; please don't fix it too quickly and restrictively.  ;D
I'm glad I don't have to 'fix' it  ;)  but I do plan to add a GUI to tweak the distance between the colors. The colors are currently spread evenly over the length of the gradient.

Re: foo_vis_spectrum_analyzer

Reply #203
v0.6.0.0, 2023-12-31, Happy Newyear!

* New: Curve visualization with customizable line width and area opacity.
* New: The position of the custom gradient colors can be specified individually.
* New: The color dialog can create colors with a specific opacity.
* Improved: Added fall-back case for pre-Windows 10 1903 versions. Completely untested. Your mileage may vary.
* Improved: Hardened the reading and writing of the configuration.
* Improved: Various minor tweaks with focus on stability and future expandability:
  * The graph is drawn completely even when there is no track playing.
  * The peak indicators animation continues when the track stops playing or when it is paused.
  * The configuration dialog page is remembered.
* Improved: The x axis shows labels for the complete specified frequency range.
* Fixed: Crash when adding multiple instances to CUI (Columns User Interface) layouts.
* Fixed: Removed background 'flash' when the element gets created.
* Fixed: The spin controls of the Pitch setting used a wrong divider.
* Fixed: Rewrote the handling of the spin controls to fix range checking and acceleration handling.

You can download it from the Components repository or upgrade from within foobar2000.

It was close but I wanted to push this out of the door before the year ended.



Re: foo_vis_spectrum_analyzer

Reply #205
The 0.6.0.0 release doesn't work on anything older than Windows 10 still, because you directly reference the function that causes problems. The compiler links the function stubs in and things break.

Here's a replacement that allows the function to be used on any OS where it's present and not cause problems on stock Win7:
Code: [Select]
typedef UINT (WINAPI *GetDpiForWindow_t)(_In_ HWND hwnd);
GetDpiForWindow_t GetDpiForWindow_w10 = NULL;

static BOOL initGetDpiForWindow_w10()
{
    HMODULE handle;
    if ((handle = LoadLibraryA("user32.dll")) != NULL) {
        GetDpiForWindow_w10 = (GetDpiForWindow_t)GetProcAddress(handle, "GetDpiForWindow");
    }
    if (!GetDpiForWindow_w10) {
        if (handle) FreeLibrary(handle);
    }
    return (GetDpiForWindow_w10 != NULL);
}

static BOOL initGetDpi()
{
    static BOOL success = initGetDpiForWindow_w10();
    return success;
}

HRESULT DirectX::GetDPI(HWND hWnd, UINT & dpi) const
{
    if (initGetDpi())
        dpi = ::GetDpiForWindow_w10(hWnd);
    else
    {
        FLOAT DPIX, DPIY;

        #pragma warning(disable: 4996)
        _Direct2D->GetDesktopDpi(&DPIX, &DPIY);
        #pragma warning(default: 4996)

        dpi = (UINT) DPIX;
    }

    return S_OK;
}

 

Re: foo_vis_spectrum_analyzer

Reply #206
The 0.6.0.0 release doesn't work on anything older than Windows 10 still, because you directly reference the function that causes problems. The compiler links the function stubs in and things break.

Here's a replacement that allows the function to be used on any OS where it's present and not cause problems on stock Win7:
Code: [Select]
typedef UINT (WINAPI *GetDpiForWindow_t)(_In_ HWND hwnd);
GetDpiForWindow_t GetDpiForWindow_w10 = NULL;

static BOOL initGetDpiForWindow_w10()
{
    HMODULE handle;
    if ((handle = LoadLibraryA("user32.dll")) != NULL) {
        GetDpiForWindow_w10 = (GetDpiForWindow_t)GetProcAddress(handle, "GetDpiForWindow");
    }
    if (!GetDpiForWindow_w10) {
        if (handle) FreeLibrary(handle);
    }
    return (GetDpiForWindow_w10 != NULL);
}

static BOOL initGetDpi()
{
    static BOOL success = initGetDpiForWindow_w10();
    return success;
}

HRESULT DirectX::GetDPI(HWND hWnd, UINT & dpi) const
{
    if (initGetDpi())
        dpi = ::GetDpiForWindow_w10(hWnd);
    else
    {
        FLOAT DPIX, DPIY;

        #pragma warning(disable: 4996)
        _Direct2D->GetDesktopDpi(&DPIX, &DPIY);
        #pragma warning(default: 4996)

        dpi = (UINT) DPIX;
    }

    return S_OK;
}
Hmmm, what was I thinking... you're right. I'll release a hot-fix.

EDIT: v0.6.0.1 should fix the fix...

Re: foo_vis_spectrum_analyzer

Reply #207
The 0.6.0.0 release doesn't work on anything older than Windows 10 still, because you directly reference the function that causes problems. The compiler links the function stubs in and things break.
Here's a replacement that allows the function to be used on any OS where it's present and not cause problems on stock Win7
Hmmm, what was I thinking... you're right. I'll release a hot-fix.
EDIT: v0.6.0.1 should fix the fix...
Yes it works!  ;D 👍
Thank you and happy new year to you all :)

EDIT:
I've noticed something strange. Look at the screenshots: B7 = 440 Hz  and A4 = 117.90 Hz :o

Re: foo_vis_spectrum_analyzer

Reply #208
Happy New Year everyone!

@pqyt,
Your component is dynamically developing and improving, it becomes the necessary element of fb2k.
Thanks for your interesting and important component.

Please consider this for a new version:
-adding the graph to the toolbar

Thank you!

Re: foo_vis_spectrum_analyzer

Reply #209
v0.6.0.2, 2024-01-02

* Fixed: Finally found a (the?) correct way to use the sample window duration of foobar2000.
* Fixed: Frequency range specification when using notes.
* Fixed: Code to determine Tooltip text.
* Fixed: The Add button of the configuration dialog still displayed the old color dialog.

You can download it from the Components repository or upgrade from within foobar2000.

Re: foo_vis_spectrum_analyzer

Reply #210
I updated directly from 0600 to 0602, and immediately noticed different frequency bar spectrum behavior, "frantic" jerky up-and-down movement throughout the frequency range.  I had been using a 60Hz refresh rate and both smoothing options off, which gave me IMO perfect real-time looking but controlled bar behavior.  Backing the rate down to 20Hz fixed it "mostly" but still with a lack of overall smoothness that led me to roll back to 0600.  I assume this was due to the 0602 fix described as "Finally found a (the?) correct way to use the sample window duration of foobar2000"--are you sure this change was effective/necessary?  I am using Foobar 2.1 x64 and 1.6.17 with Windows 10 x64 22H2.


Re: foo_vis_spectrum_analyzer

Reply #212
I updated directly from 0600 to 0602, and immediately noticed different frequency bar spectrum behavior, "frantic" jerky up-and-down movement throughout the frequency range.  I had been using a 60Hz refresh rate and both smoothing options off, which gave me IMO perfect real-time looking but controlled bar behavior.  Backing the rate down to 20Hz fixed it "mostly" but still with a lack of overall smoothness that led me to roll back to 0600.  I assume this was due to the 0602 fix described as "Finally found a (the?) correct way to use the sample window duration of foobar2000"--are you sure this change was effective/necessary?  I am using Foobar 2.1 x64 and 1.6.17 with Windows 10 x64 22H2.
What FFT size are you using?



Re: foo_vis_spectrum_analyzer

Reply #215
The last two 64-bit component releases claim to be version 0.6.0.0. 32-bit dlls have the right version info.

Re: foo_vis_spectrum_analyzer

Reply #216
What FFT size are you using?
16384
The sample window duration is now optimized for FFT 4096. There is a relation between the window duration and the FFT size but I haven't found it yet. Higher FFT sizes will indeed show a lot of jitter now for 'pure' signals but music tracks should be fine.
Try setting "Smoothing" to Peak.

Re: foo_vis_spectrum_analyzer

Reply #217
The last two 64-bit component releases claim to be version 0.6.0.0. 32-bit dlls have the right version info.
Huh?

FILE HEADER :

   Machine:                         8664h (AMD64 (K8))
   Number of Sections:              0006h
   Time Date Stamp:                 659429ACh  -> 02/01/2024  16:20:12 
   Symbols Pointer:                 00000000h
   Number Of Symbols:               00000000h
   Size Of Optional Header:         00F0h
   Flags:                           2022h

Version language : English (United States)
      FileVersion   : 0.6.0.2
      FileDescription   : A spectrum analyzer for foobar2000
      LegalCopyright   : Copyright (c) 2023-2024 P. Stuer. All rights reserved.
      LegalTrademarks   :
      Comments   :
      CompanyName   :
      InternalName   : Spectrum Analyzer
      OriginalFilename   : foo_vis_spectrum_analyzer.dll
      ProductName   : Spectrum Analyzer
      ProductVersion   : 0.6.0.2

Creation Date   : 02/01/2024  22:09:30
Last Modif. Date   : 02/01/2024  16:20:12
Last Access Date   : 02/01/2024  22:09:30

Re: foo_vis_spectrum_analyzer

Reply #218
Download 0.6.0.2:
Quote
foo_vis_spectrum_analyzer 0.6.0.0
Copyright (c) 2023 P. Stuer. All rights reserved.

A spectrum analyzer for foobar2000
Based on the Audio Spectrum project (https://codepen.io/TF3RDL/pen/poQJwRW)

Built with foobar2000 SDK 20230923
on Dec 31 2023 16:55:48.

Re: foo_vis_spectrum_analyzer

Reply #219
The last two 64-bit component releases claim to be version 0.6.0.0. 32-bit dlls have the right version info.
Huh?
He means that the 0602 release shows up in the Foobar 2.1 x64 component list as 0600 (confirmed).  The dll itself is correctly tagged as 0602.

BTW, with my own issue I did try changing the FFT to 4096 (and smoothing has always been set to "peak"), and the jitter is still way obvious to me even at 20/30 refresh compared to the smooth action of version 0600 at FFT 16384 and 60Hz refresh, so I will be sticking with 0600 for the time being.  For me it is at a "completed" stage there, and I thank you for such a beautiful spectrum.

Re: foo_vis_spectrum_analyzer

Reply #220
The last two 64-bit component releases claim to be version 0.6.0.0. 32-bit dlls have the right version info.
Huh?
He means that the 0602 release shows up in the Foobar 2.1 x64 component list as 0600 (confirmed).  The dll itself is correctly tagged as 0602.
Download 0.6.0.2:
Quote
foo_vis_spectrum_analyzer 0.6.0.0
Copyright (c) 2023 P. Stuer. All rights reserved.

A spectrum analyzer for foobar2000
Based on the Audio Spectrum project (https://codepen.io/TF3RDL/pen/poQJwRW)

Built with foobar2000 SDK 20230923
on Dec 31 2023 16:55:48.
Something else must be wrong. All version information derive from 1 set of defines. Are you sure the DLL is replaced in your foobar2000 profile? Both 32 and 64-bits show up correctly on 3 different system here.

Re: foo_vis_spectrum_analyzer

Reply #221
Investigated the 64 bit dll:

Quote
€           À      F耠  €Q €   €S €   €\ €   p\ €   À€   PP €   @P €   p €   °p €   àp €   ðq €   ¨Ù,âÜŸí C Uù¸€   œa €   @P €   p €   °p €   ðW €    \ €   G"PoZF’E‹ý;`8€   Ðv €   Spectrum Analyzer       foo_vis_spectrum_analyzer.dll   foo_vis_spectrum_analyzer 0.6.0.0
Copyright (c) 2023 P. Stuer. All rights reserved.

A spectrum analyzer for foobar2000
Based on the Audio Spectrum project (https://codepen.io/TF3RDL/pen/poQJwRW)

Built with foobar2000 SDK 20230923
on Dec 31 2023 16:55:48.        0.6.0.0 forced cast failure     À$€   }¦€   }¦€   }¦€   }¦€   €#€   𸠀   𸠀    ¹ €   0¸ €   p\ €   h €   𸠀   𸠀   `» €    · €   з €   ð· €   ¸ €   ˜&€   @¸ €   è'€   €¹ €   (€   °º €   ¨'€   𸠀   𸠀   0º €    · €           ¼  ¾  Æ  È

Re: foo_vis_spectrum_analyzer

Reply #222
v0.6.0.2, 2024-01-02
* Fixed: Frequency range specification when using notes.
It doesn't work for me, A4 is still 117.90 Hz and B7 440 Hz :(


Re: foo_vis_spectrum_analyzer

Reply #224
Are you using 64 bit? It claims to be 0.6.0.0 instead of 0.6.0.2
Yes, I'm using the 64-bit version and in the installed components list I see version 0.6.0.0, however in the foo_vis_spectrum_analyzer component folder it's the correct version 0.6.0.2 DLL.
But what has this to do with frequencies and notes ?