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

Re: foo_vis_spectrum_analyzer

Reply #275
20 bands per octave? An octave has 12 semitones. Are you fan of microtonal music?

In microtonal music the unit is Cent. An octave is 1200 Cent. Each semitone is +100  Cent, quartertone is +50 Cent. In your case of 20 tones per octave, this should be labeled +60 Cent per tone.
I don't mind adding that sub-unit but... I hope everybody understands we're using an audio player not a science experiment ;-)
Since unlike the original foo_musical_spectrum, the number of bands per-octave can be set to anything other than 12, and the frequency band distribution mode can be set to other than octave bands (including the frequency scales other than logarithmic), a "Nearest note: (insert note name here)" would make sense since on 1/24th octave spectrum, we have two A4s instead of one

* Improved: The sample window size for the FFT is now calculated based on the sample rate and the FFT size.
This should also account for resampling DSPs (especially extreme ones like when the source material is at 48kHz sample rate and the resampling DSP's target rate is 8kHz), which obviously affects all visualizations since visualization stream API gathers data after all DSP effects right?

Re: foo_vis_spectrum_analyzer

Reply #276
20 bands per octave? An octave has 12 semitones.
I've even increased it to 24 because it looks better to my eyes, otherwise the bars are too large ;)


In your case of 20 tones per octave, this should be labeled +60 Cent per tone.
That or no note label at all if the frequency doesn't match with a real note.

Re: foo_vis_spectrum_analyzer

Reply #277
This should also account for resampling DSPs (especially extreme ones like when the source material is at 48kHz sample rate and the resampling DSP's target rate is 8kHz), which obviously affects all visualizations since visualization stream API gathers data after all DSP effects right?
I use the sample rate as reported by an audio chunk once they start coming in. Before that, it's a guestimate based on what the track reports in its metadata. For synthesized tracks the sample rate starts at 44100.

Re: foo_vis_spectrum_analyzer

Reply #278
- When I double click on the panel to show me in fullscreen, the screen remains black and nothing appears but if I right click I see that's the panel because it shows me the context menu. Has it been reported by other people ?
What settings are you using? Is a track playing? Do any of the axis appear? A completely black screen has never been reported.

Hi, this is the panel into my fb2k and when I double click on the panel. As you can see it seems I can do right click but nothing is showed. There is 2 windows : the fb2k window which shows me that spectrum is displayed in the thumb, and the plugin window which shows me a black screen.
I have a dual screen, is it supposed to be an issue for displaying in fullscreen ?
I made screenshots of the configuration

Re: foo_vis_spectrum_analyzer

Reply #279
I use the sample rate as reported by an audio chunk once they start coming in. Before that, it's a guestimate based on what the track reports in its metadata. For synthesized tracks the sample rate starts at 44100.
Fair enough, this trick is also used on foo_enhanced_spectrum_analyzer component by @Crossover to make up for the fact the requested_length argument of get_chunk_absolute() function is in seconds rather than samples, so if the requested_length is 0.1, the chunk we get is 4800 samples (on 48kHz sample rate) long and it becomes obvious at low framerate (100ms or higher refresh interval) and applying the resampling DSPs (this includes Set Sample Rate effect from foo_dsp_utility by @Peter )

Also, two FRs: Reaction alignment parameter (like in Vizzy.io) that controls the delay between actual playback and the visualization, setting to negative one means all of samples are ahead the actual playback (with the first sample is equal to the actual playback), setting to zero means the first half of samples are behind the actual playback and latter half are ahead of it (just like original foo_musical_spectrum and basically any get_spectrum_absolute() visualizations), and setting it to positive one means all of samples are behind the playback (similar to VST audio analyzer plugins like Voxengo SPAN) with the last sample is equal to the actual playback

And make cutoff at Nyquist frequency toggleable via a checkbox named something like "Suppress mirror image" in configuration window (and probably Nyquist label, which is placed at the sample rate divided by two) since on my own spectrum analyzer, the mirror image of the spectrum is visualized at anything above Nyquist

Re: foo_vis_spectrum_analyzer

Reply #280
It seems to be possible with a custom swap chain.

Not sure if it would work for this but I need to use DrawThemeBackground in my own code and it's done like this...

a) adjusting your D2D1::RenderTargetProperties with D2D1_RENDER_TARGET_USAGE set to D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE

b) a bit of code like

Code: [Select]
HDC dc{};

// I use microsoft/wil, could be pfc from the fb2k SDK or whatever
wil::com_ptr_t<ID2D1GdiInteropRenderTarget> gdi;
if SUCCEEDED(render_target->QueryInterface(IID_PPV_ARGS(&gdi)))
{
if SUCCEEDED(gdi->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &dc))
{
// do stuff with dc here
gdi->ReleaseDC(nullptr);
}
}

Re: foo_vis_spectrum_analyzer

Reply #281
It seems to be possible with a custom swap chain.

Not sure if it would work for this but I need to use DrawThemeBackground in my own code and it's done like this...

a) adjusting your D2D1::RenderTargetProperties with D2D1_RENDER_TARGET_USAGE set to D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE

b) a bit of code like

Code: [Select]
HDC dc{};

// I use microsoft/wil, could be pfc from the fb2k SDK or whatever
wil::com_ptr_t<ID2D1GdiInteropRenderTarget> gdi;
if SUCCEEDED(render_target->QueryInterface(IID_PPV_ARGS(&gdi)))
{
if SUCCEEDED(gdi->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &dc))
{
// do stuff with dc here
gdi->ReleaseDC(nullptr);
}
}
The whole point was to create a component without any GDI. Direct2D was released in 2006 . It's way past time to move on. I'll try the swap chain route first.


Re: foo_vis_spectrum_analyzer

Reply #283
@marc2k3,

Cool. I'll look out for it and maybe I can modernise mine. I'm generally too stupid to do much myself. :P
Here is a working example for a desktop window.  Now I need to see it also works with a child window of foobar2000.


Re: foo_vis_spectrum_analyzer

Reply #285
I appreciate the time you took to make this plugin. I'm not really a power user anymore so forgive me if there's an obvious answer to these questions/concerns/comments:

1. Shouldn't the configuration window be honoring the user selected dark/light mode?
2. Wishlist (feature request):
  2A. Please consider adding the option to save multiple configurations. It would be nice to quickly switch between them.
  2B. Peak mode for curve type

Re: foo_vis_spectrum_analyzer

Reply #286
@metal_termite ,

1. Shouldn't the configuration window be honoring the user selected dark/light mode?
Yes, but I ran into problems with the standard way of implementing this because the dialog is not a foobar2000 settings page. I'll go back to it later.
  2A. Please consider adding the option to save multiple configurations. It would be nice to quickly switch between them.
Already on the To Do list.
  2B. Peak mode for curve type
Noted.

Re: foo_vis_spectrum_analyzer

Reply #287
And, please add left and right reversed setting to x-axis
 for displaying left and right channel side by side.
Me too as I haven't (and someone else) able to find the channel spectrum visualization for Default UI that it is compatible with foobar2000 x64 v2.x

I've already have side-by-side channel visualization mode (Visualization type = separate) on my own Channel Spectrum panel remake on Web Audio API as a CodePen project a long-time ago after realizing that there are people who wanting to see a 64-bit remake of foo_uie_vis_channel_spectrum, so I've added that to aforementioned CodePen project and renamed this project from "Overlayed channel spectrum + custom FFT" to just "Channel spectrum + custom FFT", and another FR: more frequency distribution mode as in the aforementioned CodePen project (which have similar behavior to Classic Spectrum Analyzer (vis_classic) plugin for Winamp as well as Channel Spectrum panel (foo_uie_vis_channel_spectrum) component for foobar2000 as I've realized that Channel Spectrum panel frequency scaling depends on the FFT size and actual number of bands rather than a true Mel scale)

BTW, I've noticed that my own Web Audio API visualizations especially ones involving simultaneous channel visualizations only react to the Front part of the surround sound, though the mono (one AnalyserNode that connected to the audio source before ChannelSplitterNode) visualization reacts to everything except LFE channels per specifications for the channelInterpretation="speakers" behavior when comes to downmixing, which you can test it by putting a surround sound (or anything more than 2 channels) audio file into the visualizer

Hi,
I'd also like to have X-axis and Y-axis mirroring ;-)
thanks a lot for your work!

Re: foo_vis_spectrum_analyzer

Reply #288
Hi,
I'd also like to have X-axis and Y-axis mirroring ;-)
thanks a lot for your work!
Dynamic gradients are nearly done. This is next on the design table.

Re: foo_vis_spectrum_analyzer

Reply #289
- When I double click on the panel to show me in fullscreen, the screen remains black and nothing appears but if I right click I see that's the panel because it shows me the context menu. Has it been reported by other people ?
What settings are you using? Is a track playing? Do any of the axis appear? A completely black screen has never been reported.

Hi, this is the panel into my fb2k and when I double click on the panel. As you can see it seems I can do right click but nothing is showed. There is 2 windows : the fb2k window which shows me that spectrum is displayed in the thumb, and the plugin window which shows me a black screen.
I have a dual screen, is it supposed to be an issue for displaying in fullscreen ?
I made screenshots of the configuration

Hi, does anybody have the same issue than me ?

Re: foo_vis_spectrum_analyzer

Reply #290
Minor cosmetic issue when visualization type is set to curve. When nothing is playing the top of the curve line appears on the very bottom of the analyzer (see image below). I think expected behavior would be that nothing is visible.


Re: foo_vis_spectrum_analyzer

Reply #291
Minor cosmetic issue when visualization type is set to curve. When nothing is playing the top of the curve line appears on the very bottom of the analyzer (see image below). I think expected behavior would be that nothing is visible.


It didn't bother me. I'll see if I can remove it efficiently.

Re: foo_vis_spectrum_analyzer

Reply #292
- When I double click on the panel to show me in fullscreen, the screen remains black and nothing appears but if I right click I see that's the panel because it shows me the context menu. Has it been reported by other people ?
What settings are you using? Is a track playing? Do any of the axis appear? A completely black screen has never been reported.

Hi, this is the panel into my fb2k and when I double click on the panel. As you can see it seems I can do right click but nothing is showed. There is 2 windows : the fb2k window which shows me that spectrum is displayed in the thumb, and the plugin window which shows me a black screen.
I have a dual screen, is it supposed to be an issue for displaying in fullscreen ?
I made screenshots of the configuration
Hi, does anybody have the same issue than me ?
I haven't investigated it yet. Driver issue? I regularly run fb2k with 3 screens without any problems.

 

Re: foo_vis_spectrum_analyzer

Reply #293
1. Shouldn't the configuration window be honoring the user selected dark/light mode?
Yes, but I ran into problems with the standard way of implementing this because the dialog is not a foobar2000 settings page. I'll go back to it later.
Does it mean that the config window has to be rewritten from scratch?

  2B. Peak mode for curve type
Noted.
I guess that audioMotion-analyzer already have peak lines mode, so I'd appreciate that if it is implemented

BTW, implementing something like analog-style analyzer mode would require a different way of using get_chunk_absolute() from ones used by both FFT and current Goertzel-based CQT/VQT mode; the previous time is used as time offset and the requested chunk length is equals to a difference between current and previous time

Re: foo_vis_spectrum_analyzer

Reply #294
1. Shouldn't the configuration window be honoring the user selected dark/light mode?
Yes, but I ran into problems with the standard way of implementing this because the dialog is not a foobar2000 settings page. I'll go back to it later.
Does it mean that the config window has to be rewritten from scratch?
It is written from scratch.

Re: foo_vis_spectrum_analyzer

Reply #295
You can still use fb2k::CCoreDarkModeHooks in popup dialogs. Although that is built in to core, the DarkMode implementation in Peter's libPPUI gives a clue as to what controls it can handle automatically...

https://github.com/jscript-panel/foobar2000-sdk/blob/32f6b8029d59247d633b952c79f11ed2e8601cc8/libPPUI/DarkMode.cpp#L1795-L1825

You might have to handle more exotic ones manually.

Re: foo_vis_spectrum_analyzer

Reply #296
I haven't investigated it yet. Driver issue? I regularly run fb2k with 3 screens without any problems.

Hi, my driver is up to date. Is there a thing I can do to help you investigate it ?
Regards.

Re: foo_vis_spectrum_analyzer

Reply #297
You might have to handle more exotic ones manually.

And that is the case. It took 3 lines of code for this but one control needs more work...

My pr for foo_midi uses the same code used here.

Re: foo_vis_spectrum_analyzer

Reply #298
You might have to handle more exotic ones manually.

And that is the case. It took 3 lines of code for this but one control needs more work...

My pr for foo_midi uses the same code used here.
I'll have a second look. Like I said, I ran into problems during initial development and I didn't wanted to waste time on it then.

Re: foo_vis_spectrum_analyzer

Reply #299
You might have to handle more exotic ones manually.

And that is the case. It took 3 lines of code for this but one control needs more work...

My pr for foo_midi uses the same code used here.
I'll have a second look. Like I said, I ran into problems during initial development and I didn't wanted to waste time on it then.
Done. I still think it's ugly and I will have to upgrade the menu listbox and the Channels button.