Foobar2000:Components/Spectrum Analyzer (foo vis spectrum analyzer): Difference between revisions

From Hydrogenaudio Knowledgebase
No edit summary
No edit summary
 
(71 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{stub}}
{{panel|title=Experimental component|This component is considered an early prototype and it is under development as it was released as an early access. Bugs and issues with this component are expected and currently it has no CUI support.|color=yellow}}
{{infobox foobar2000 component
{{infobox foobar2000 component
| name                    = Spectrum Analyzer
| name                    = Spectrum Analyzer
| screenshot              =  
| screenshot              = [[File:Spectrum_Analyzer.png|256px]]
| caption                =  
| caption                =  
| module_name            = foo_vis_spectrum_analyzer
| module_name            = foo_vis_spectrum_analyzer
| developer              = {{ha user|u=67884|name=pqyt}}
| developer              = {{ha user|u=67884|name=pqyt}}
| repository              =  
| repository              = [https://github.com/stuerp/foo_vis_spectrum_analyzer GitHub]
| released                =  
| released                =  
| released_ref            =  
| released_ref            =  
| stable_release          =  
| stable_release          = 0.7.6.2
| stable_release_date    =  
| stable_release_date    = {{start date and age|2024|04|17}}
| preview_release        = 0.1.0.2
| preview_release        =  
| preview_release_date    = {{start date and age|2023|11|13}}
| preview_release_date    = <!--{{start date and age|2023|11|12}}-->
| foobar2000_architecture = x86 32-bit, x86 64-bit
| foobar2000_architecture = x86 32-bit, x86 64-bit
| foobar2000_minimum      = 2.0
| foobar2000_minimum      = 2.0
| foobar2000_maximum      =  
| foobar2000_maximum      =  
| foobar2000_legacy      = false
| foobar2000_legacy      = false
| foobar2000_ui_module    = Default UI
| foobar2000_ui_module    = Default UI, Columns UI
| use                    = Visualization
| use                    = Visualization
| license                =  
| license                = [https://github.com/stuerp/foo_vis_spectrum_analyzer/blob/master/LICENSE.txt MIT License]
}}
}}
A recreation of [[foobar2000:Components/Musical Spectrum (foo_musical_spectrum)|Musical Spectrum]] component for foobar2000 v2.x and 64-bit versions.
A recreation of the [[foobar2000:Components/Musical Spectrum (foo_musical_spectrum)|Musical Spectrum]] component for foobar2000 v2.x and 64-bit versions. '''Windows 10''' or higher are the only supported operating systems.


== Configuration ==
It uses DirectX (Direct2D and DirectWrite) to render its graphics. Over time more visualizations likes a spectogram and a peak meter were added.
You can tweak the configuration by creating a '''foo_vis_spectrum_analyzer.json''' next to the '''foo_vis_spectrum_analyzer.dll''' file. The content of the file is reread at the start of a new track.


''You can find the foo_vis_spectrum_analyzer.dll in your foobar2000 profile directory.''
The component supports Dark Mode and the Default (DUI) and Columns User Interface (CUI).


    {
You can double-click the component window to switch between windowed and full-screen mode.
        "FFTSize": 4096,
        "FrequencyDistribution" : 1,
        "ScalingFunction" : 1,
        "ScalingFunctionFactor" : 0.0,
        "NumberOfBands" : 160,
        "MinFrequency" : 20,
        "MaxFrequency" : 20000,
        "Bandwidth" : 0.5,
        "BandsPerOctave" : 12,
        "MinNote" : 0,
        "MaxNote" : 143,
        "Detune" : 0,
        "Pitch" : 440.0,
        "SummationMethod" : 1,
        "SmoothingMethod" : 1,
        "SmoothingFactor" : 0.75,
        "XAxisMode" : 3,
        "LogLevel" : 1
    }


'''FFTSize''': 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
<blockquote>''When using the Default User Interface (DUI) the full-screen version is another instance of the component with its own configuration. When you use the Columns User Interface (CUI) the existing instance will be resized to occupy the full screen.''</blockquote>


'''FrequencyDistribution''': Determines which parameters are used to generate the frequency bands.
== Context Menu ==


    0: Generate frequency bands based on the frequency parameters.
Right-click on the component window to display the context menu. The following options are available:
    1: Generate frequency bands based on the note parameters.
    2: Generate frequency bands used by AveePlayer.


'''ScalingFunction''': Determines which frequency scaling function is used.
=== Configure ===


    0: Linear
Opens the Configuration dialog. This component has its own configuration dialog instead of a page in the standard foobar2000 preferences dialog.
    1: Logarithmic
    2: Shifted logarithmic
    3: Mel (AIMP)
    4: Bark
    5: Adjustable Bark
    6: ERB
    7: Cams
    8: Hyperbolic Sine
    9: NthRoot
    10: Negative exponential
    11: Period


'''NumberOfBands''': Number of frequency bands to generate (2 to 512)
=== Toggle Full-Screen Mode ===


'''MinFrequency''': Frequency of the first band, 0Hz to 96000Hz.
Toggles full-screen mode off and on.


'''MaxFrequency''': Frequency of the last band, 0Hz to 96000Hz.
<blockquote>''When using the Default User Interface (DUI) the full-screen version is another instance of the component with its own configuration. When you use the Columns User Interface (CUI) the existing instance will be resized to occupy the full screen.''</blockquote>
'''Bandwidth''': 0.0 to 64.0


'''BandsPerOctave''': Number of bands per octave (1 to 48)
=== Frame Counter ===


'''MinNote''': Number of the first note. (C0 = 0, C1 = 12, ...), 0 to 143 (12 octaves)
Enables the display of a rudimentary frame counter.


'''MaxNote''': Number of the last note. (C0 = 0, C1 = 12, ...), 0 to 143 (12 octaves)
=== Refresh Rate Limit ===


'''Detune''': Detuning offset (-24 to 24)
Allows you the selected the refresh rate of the component animation. Note that even though the component can redraw its visuals very fast the actual maximum refresh rate is usually determined by the refresh rate of your monitor.


'''Pitch''': Tuning pitch (A4 = 440.0Hz), 0Hz to 96000Hz.
=== Presets ===


'''SummationMethod''': Determines which method is used to sum the coefficients of FFT.
Contains a list of previously saved presets. Select one from the list to activate it. A checkmark will be shown next to the latest activated preset.


    0: Minimum
=== Freeze ===
    1: Maximum
    2: Sum
    3: RMS
    4: RMSSum
    5: Average
    6: Median


Prevents the refresh of the component, effectively reducing CPU and GPU use to 0.


'''SmoothingMethod''': Specifies how the spectrum will be smoothed over time.
== Configuration dialog ==


    0: Average
The configuration dialog is used to change all parameters used by the component. All changes are applied immediately to the component without the need to close it.
    1: Peak


'''SmoothingFactor''': Specifies the strength of the smoothing (0.0 to 1.0)
Close the dialog with Close button or the Cancel button to undo any changes to the configuration.


'''Reset'''


'''XAxisMode''': Determines which X axis to display
Resets the configuration to the default values.


    0: Center frequency of a band, every 10 bands.
'''OK'''
    1: Fixed frequency range
    2: Frequency of the C note of each octave
    4: C note of each octave


'''LogLevel''': Specifies the verbosity of the logging to the foobar2000 console.
Closes the dialog box and preserves the changes to the configuration during the current session.


    0: Trace
<blockquote>''The settings will only be saved to your profile when foobar2000 is closed.''</blockquote>
    1: Debug
 
    2: Information
'''Cancel'''
    3: Warning
 
    4: Error
Closes the dialog box and undoes any changes to the configuration.
    5: Critical
 
    6: None
 
=== Transform page ===
 
==== Transform group ====
 
[[File:foo_vis_spectrum_analyzer_transform.png|thumb|256px|Spectrum Analyzer Configuration: Transform]]
 
'''Method'''
 
Allows you to select the Time to Frequency domain transform. The following transforms are implemented:
 
* Fast Fourier (FFT)
* Constant-Q (CQT)
* Sliding Windowed Infinite Fourier (SWIFT)
* Analog-style
 
'''Window function'''
 
Selects the window function that will be applied to the samples (Time domain).
 
'''Window parameter'''
 
Allows you to tweak window functions that support a parameter like Gaussian and Kaiser.
 
'''Window skew'''
 
Adjusts how the window function reacts to samples. Positive values makes it skew towards latest samples while negative values skews towards earliest samples. Defaults to 0 (None).
 
'''Reaction alignment'''
 
Controls the delay between the actual playback and the visualization.
 
* < 0: All samples are ahead of the playback sample (with the first sample equal to the actual playback sample).
* = 0: The first half of samples are behind the current playback sample and the second half are ahead of it.
* > 0: All samples are behind the playback with the last sample equal to the current playback sample.
 
==== Fourier Transform group ====
 
Groups the parameters that influence the Fast Fourier transform.
 
'''No. of bins'''
 
Specifies the number of bins used by the transforms as a number between 64 and 32768.
 
* Select ''Custom'' to specify a number that is not a power of 2. This will consume a lot more CPU power.
* Select ''Sample rate based'' to specify the size as a duration. F.e. 100ms of a track sampled at 44.1kHz will result in an FFT window of 4410 samples.
 
'''Coefficient aggregation'''
 
Determines which method is used to aggregate the coefficients of FFT.
 
* Minimum
* Maximum
* Sum
* Residual Mean Square (RMS)
* RMS Sum
* Average
* Median
 
'''Mapping'''
 
Determines how the FFT coefficients are mapped to the frequency bins.
 
* Standard
* Triangular Filter Bank
* Brown-Puckette CQT
 
'''Smooth lower frequencies'''
 
When enabled, the band power part only gets used when number of FFT bins to sum for each band is at least two or more.
 
'''Smooth gain transition'''
 
Smooths the frequency slope of the aggregation modes.
 
'''Lanczos kernel'''
 
Determines the size of the Lanczos kernel. The kernel is used to create a smooth transition between the FFT coefficients resulting in a visual pleasing result.
 
==== Brown-Puckette CQT Mapping group ====
 
'''Bandwidth offset'''
 
Offsets the bandwidth of the Brown-Puckette CQT.
 
'''Bandwidth cap'''
 
Minimum Brown-Puckette CQT kernel size.
 
'''Bandwidth amount'''
 
The Brown-Puckette CQT kernel size.
 
'''Granular bandwidth'''
 
When disabled constrains the bandwidth to powers of 2.
 
'''Kernel shape'''
 
Determines the shape of the Brown-Puckette CQT kernel.
 
'''Kernel shape parameter'''
 
Parameter used by certain window functions like Gaussian and Kaiser windows.
 
'''Kernel asymmetry'''
 
Adjusts how the window function reacts to samples. Positive values makes it skew towards latest samples while negative values skews towards earliest samples.
 
==== Infinite Impulse Response (IIR) group ====
 
Groups the parameters used by the SWIFT and the Analog-style transforms.
 
'''Filter bank order'''
 
Determines the order of the filter bank used to calculate the SWIFT and Analog-style transforms.
 
'''Time resolution'''
 
Determines the maximum time resolution used by the SWIFT and Analog-style transforms.
 
'''Bandwidth'''
 
Determines the bandwidth used by the SWIFT and Analog-style transforms.
 
'''Constant-Q'''
 
Uses constant-Q instead of variable-Q in the IIR transforms.
 
'''Compensate bandwidth'''
 
Compensate bandwidth for narrowing on higher order IIR filters banks.
 
'''Use prewarped Q'''
 
Prewarps Q to ensure the actual bandwidth is truly logarithmic at anything closer to the Nyquist frequency.
 
 
=== Frequencies page ===
 
[[File:foo_vis_spectrum_analyzer_frequencies.png|thumb|256px|Spectrum Analyzer Configuration: Frequencies]]
 
==== Frequencies group ====
 
Groups the parameters that determine the frequency range that will be displayed.
 
'''Distribution'''
 
Determines which parameters are used to generate the frequency bands.
 
* Linear: Generate frequency bands based on the frequency parameters.
* Octaves: Generate frequency bands based on the note parameters.
* AveePlayer: Generate frequency bands used by AveePlayer.
 
'''No. of bands'''
 
Specifies the number of frequency bands to generate (2 to 512) in the specified frequency range.
 
'''Frequency range'''
 
Frequency of the first and last band, 1Hz to 96000Hz. Each frequency is centered in the band.
 
'''Note range'''
 
Available when selecting the ''Octaves'' distribution. Select a range between the C note of octave 0 and B# of octave 11 (max. 144 notes or 12 octaves)
 
'''Bands per octave'''
 
Number of bands per octave (1 to 48)
 
'''Pitch'''
 
Frequency of the tuning pitch (A4 = 440.0Hz), 1Hz to 96000Hz.
 
'''Transpose'''
 
Determines how many semitones the frequencies will be transposed. (-24 to 24)
 
'''Scaling'''
 
Determines which which will be used to scale the frequencies:
 
* Linear
* Logarithmic
* Shifted logarithmic
* Mel (AIMP)
* Bark
* Adjustable Bark
* ERB
* Cams
* Hyperbolic Sine
* n-th Root
* Negative exponential
* Period
 
'''Skew factor'''
 
Affects any adjustable frequency scaling functions like hyperbolic sine and n-th root. Higher values mean a more linear spectrum.
 
'''Bandwidth'''
 
Distance between the low and high frequency boundaries for each frequency band. (0.0 to 64.0)
 
 
=== Filters page ===
 
[[File:foo_vis_spectrum_analyzer_filters.png|thumb|256px|Spectrum Analyzer Configuration: Filters]]
 
==== Acoustic Filters group ====
 
This group contains settings to allow you to apply acoustic weighting filters (A-, B-, C-, D- and M-weighting (ITU-R 468)) to the samples.
 
'''Weighting type'''
 
Selects the weighting filter type that will be applied.
 
'''Slope function offset'''
 
Slope function offset expressed in sample rate / FFT size in samples
 
'''Slope'''
 
Frequency slope offset
 
'''Slope offset'''
 
Frequency slope in dB per octave
 
'''Equalize amount'''
 
Equalization amount
 
'''Equalize offset'''
 
Equalization offset
 
'''Equalize depth'''
 
Equalization depth
 
'''Weighting amount'''
 
Weighting amount
 
 
=== Common page ===
 
[[File:foo_vis_spectrum_analyzer_common.png|thumb|256px|Spectrum Analyzer Configuration: Common]]
 
This page contains settings that the visualizations have in common.
 
==== Common group ====
 
'''Smoothing method'''
 
Determines how the spectrum coefficients and the peak meter values are smoothed.
 
* Average: Calculates a weighted average between the old and the new value of the peak. Uses the smoothing factor as a weight.
* Peak: Retains the maximum between the old and the new value of the peak.
 
'''Smoothing factor'''
 
Specifies the strength of the smoothing (0.0 to 1.0)
 
'''Tooltips'''
 
Enable the check box to see a tooltip with the center frequency and when appropriate, the name of the note, of the frequency band.
 
'''Suppress mirror image'''
 
Prevents the mirror image of the spectrum (anything above the Nyquist frequency) from being rendered.
 
==== Artwork group ====
 
Some visualizations can use artwork to display on the background or to use as a source for a color list. The artwork can come from the playing track or from file location.
 
'''No. artwork colors'''
 
The maximum number of colors to select from the artwork.
 
'''Lightness threshold'''
 
Determines when a color is considered light. Expressed as a percentage of whiteness.
 
'''Sort colors by'''
 
Determines how to sort the colors selected from the artwork.
 
'''Show artwork on background'''
 
Displays the artwork on the graph background.
 
'''Fit mode'''
 
Determines how over- and undersized artwork is rendered.
 
* Free: The artwork will not be scaled.
* Fit big: Artwork that is bigger than the available area will be proportionally scaled.
* Fit width: The width of the artwork is scaled to fit in the available area.
* Fit height: The height of the artwork is scaled to fit in the available area.
* Fill: The width or height of artwork is scaled to fit the available area.
 
'''Fit window'''
 
Enable to use the full component window as available area instead of the client area (the window minus any room taken by axes)
 
'''Artwork opacity'''
 
Determines the opacity of the artwork when displayed.
 
'''Artwork file path'''
 
A fully-qualified file path or a foobar2000 script that returns the file path of an image to display on the graph background.
 
 
=== Visualization page ===
 
[[File:foo_vis_spectrum_analyzer_visualization.png|thumb|256px|Spectrum Analyzer Configuration: Visualization]]
 
'''Type'''
 
Determines the type of visualization:
 
* Bars: The classic spectrum visualization
* Curve: The same as bars but with a smoothed curve instead of bars.
* Spectogram
* Peak Meter: Displays the peak and RMS levels of the track.
* Level Meter: Displays the balance and mid/side correlation of the track.
 
==== Peak indicators group ====
 
Some visualizations can display indicators for the peak values. The following settings determine how those peak indicators are animated.
 
'''Peak mode'''
 
Specifies how the peak indicators are rendered:
 
* None
* Classic
* Gravity
* AIMP
* Fade Out
* Fading AIMP: A combination of AIMP and Fade Out
 
'''Hold time'''
 
Specifies how long a peak value will be held steady before it decays.
 
'''Acceleration'''
 
Specifies the acceleration used to decay the peak value.
 
==== LEDs group ====
 
Some visualizations can display a bar as simulated LED lights.
 
'''Enabled'''
 
Display the spectrum bars and peak meters as LEDs.
 
'''LED size'''
 
The size of the LED light, in pixels.
 
'''LED gap'''
 
The size of the gap between the LEDs, in pixels.
 
==== Spectogram group ====
 
'''Scrolling'''
 
Activates scrolling of the spectogram.
 
==== Peak Meter group ====
 
The peak meter will display the instant peak and RMS over time level of the playing track.
 
<blockquote>''A gauge will be shown for each of the channels in the playing track but only when it is also selected in the Channels list on the Graphs page. F.e. a 7.1 track with only the Front Left and Front Right channel selected will only show 2 gauges. A mono track without the Front Center channel selected will show no gauge.''</blockquote>
 
'''Horizontal'''
 
Renders the peak meter horizontally.
 
'''RMS+3'''
 
Adds 3dB to the RMS value.
 
'''RMS window'''
 
Specifies the duration of each RMS measurement (in seconds).
 
'''Gauge gap'''
 
Specifies the gap between the gauges (in pixels). Defaults to 1 pixel.
 
=== Graphs page ===
 
[[File:foo_vis_spectrum_analyzer_graphs.png|thumb|256px|Spectrum Analyzer Configuration: Graphs]]
 
The component window can contain more than one graph at the same time. Some users use this to create facing spectrum analyses. Graphs can have individual settings but share the visualization type and the styles.
 
'''Graph list'''
 
The graph list shows all graphs in the current window. Use the + button to add a graph. Use the - button to remove the selected graph.
 
'''Vertical layout'''
 
Enables this setting to stack the graphs vertically instead of horizontally.
 
'''Description'''
 
Allow you to edit the description of the selected graph.
 
'''Flip horizontally'''
 
Flips the current graph horizontally. Any axes will be rendered accordingly.
 
'''Flip vertically'''
 
Flips the current graph vertically. Any axes will be rendered accordingly.
 
==== X axis group ====
 
Groups the parameters that determine the way the X axis is displayed.
 
'''Mode'''
 
Determines which X axis to display.
 
* None: Hides the X axis (reserve no screen area for it).
* Bands: Center frequency of a band, every 10 bands.
* Decades: Fixed frequency range
* Octaves: Frequency of the C note of each octave
* Notes: C note of each octave
 
'''Top'''
 
Displays an X-axis on top of the graph.
 
'''Bottom'''
 
Displays an X-axis at the bottom of the graph.
 
==== Y axis group ====
 
Groups the parameters that determine the way the Y axis is displayed.
 
'''Mode'''
 
Determines which Y axis to display.
 
* None: Hides the Y axis (reserve no screen area for it).
* Decibel scale: Uses decibel values to render the scale.
* Logarithmic: Uses logarithmic values to render the scale.
 
'''Left'''
 
Displays an Y-axis on the left of the graph.
 
'''Right'''
 
Displays an Y-axis on the bottom of the graph.
 
'''Amplitude range'''
 
Determines the minimum and maximum amplitude, expressed in decibel (dB), to display.
 
'''Amplitude step'''
 
Determine the step size between the min. and max. amplitude.
 
'''Use absolute'''
 
Sets the min. amplitude to -∞ dB (0.0 on the linear scale) when enabled.
 
'''Gamma'''
 
Sets index n of the n-th root calculation.
 
'''Channels'''
 
Allows you to select the audio channels that will be used to participate in the analysis of a chunk of audio samples.
 
<blockquote>''Most users will enable only the left and right channel. Therefor no information will be shown in the graph when a mono track is played. Also enable the Front Center channel to remedy this situation.''</blockquote>
 
 
=== Styles page ===
 
[[File:foo_vis_spectrum_analyzer_styles.png|thumb|256px|Spectrum Analyzer Configuration: Styles]]
 
Most of the elements of a graph can be styled. The styles list shows all available styles. Each style has a number of settings that determine how the element is rendered.
 
'''Color source'''
 
The color source determines where the element gets its color information from.
 
* None: Prevents the element from being rendered.
* Solid: A single color is used to render the element.
* Dominant color: The dominant color in the artwork is used to render the element. The artwork does not have to be rendered on the background.
* Gradient: The element is rendered using a gradient created from the color list below.
* Windows: The element is rendered using a standard Windows color.
* User Interface: The element is rendered using a standard DUI or CUI user interface color.
 
'''Color index'''
 
Allow you to select a color when color source Window or User Interface is specified.
 
'''Color'''
 
Displays the current color used by color source Solid or Dominant Color. Click to modify the color.
 
<blockquote>''A standard Windows color dialog that has been extended with controls to modify the alpha channel of the color will pop up.''</blockquote>
 
'''Color scheme'''
 
Specifies the color scheme used to render the element.
 
* Solid color: A single color, effectively the same as color source Solid.
* Custom: A custom list of colors.
* Artwork: A list of colors determined by the current artwork
* Prism 1
* Prism 2
* Prism 3
* foobar2000
* foobar2000 Dark Mode
* Fire
* Rainbow
* SoX: A list of colors emulating the spectogram colors used by SoX.
 
'''Color list'''
 
Double-click a color to modify it. Modifying a color of a built-in color scheme automatically selects the Custom color scheme.
 
Press the ''Add'' button to add a color, ''Remove'' to remove a color, ''Reverse'' to reverse the color list.
 
The position of the color in the gradient is expressed as a percentage of the length of the gradient. E.g. a position of 50% puts the color in the middle of the gradient.
 
Press the ''Spread'' button to evenly spread the colors in the list over the gradient. This updates the position of the colors as required.
 
'''Horizontal gradient'''
 
Generates a horizontal instead of a vertical gradient.
 
'''Amplitude-based'''
 
Some styles can use the amplitude of a spectrum frequency to determine the color. This option can only be applied to a horizontal gradient.
 
'''Opacity'''
 
Specifies the opacity of the rendered element.
 
'''Thickness'''
 
For some styles you can specify the thickness of the brush used to render the element.
 
'''Font name'''
 
Specifies the name of the font used to render the element.
 
'''Font size'''
 
Specifies the size in points of the font used to render the element.
 
 
=== Presets page ===
 
[[File:foo_vis_spectrum_analyzer_presets.png|thumb|256px|Spectrum Analyzer Configuration: Presets]]
 
The whole configuration can be saved to a preset. A preset can be reloaded at any time.
 
<blockquote>''Presets are not interchangeable with x86 and x64 versions of foobar2000. Special care is taken to be as backwards compatible with preset files saved by older versions of the component.''</blockquote>
 
You can recognize preset files by the <code>fvsa</code> file extension.
 
'''Location'''
 
Contains the path name of the location of your preset files. By default the foobar2000 profile directory is used.
 
<blockquote>''For privacy reasons the location is stored in your foobar2000 settings but will not be included in a preset file. Preset files contain no personal information and can be safely exchanged with other users.''</blockquote>
 
Below the location you find the preset files currently found in the specified location.
 
Double click a preset to activate it or select it and press the Load button.
 
'''Name'''
 
Specifies the name of the preset.
 
'''Load'''
 
Loads and activates the currently selected preset.
 
'''Save'''
 
Saves the current configuration.
 
'''Delete'''
 
Deletes the currently selected preset.


== External links ==
== External links ==
* {{foobar2000|https://www.foobar2000.org/components/view/foo_vis_spectrum_analyzer|Spectrum Analyzer (foo_vis_spectrum_analyzer)}}
* {{foobar2000|https://www.foobar2000.org/components/view/foo_vis_spectrum_analyzer|Spectrum Analyzer (foo_vis_spectrum_analyzer)}}
* {{ha|https://hydrogenaud.io/index.php/topic,125031.0.html}}
* {{ha|https://hydrogenaud.io/index.php/topic,125031.0.html}}
== See also ==
== See also ==
* [https://codepen.io/TF3RDL/pen/poQJwRW Frequency bands spectrum analyzer using either FFT or CQT] on CodePen (which this component is based on)
* [https://codepen.io/TF3RDL/pen/poQJwRW Frequency bands spectrum analyzer using either FFT or CQT] on CodePen (on which part of this component is based).

Latest revision as of 08:01, 28 April 2024

Spectrum Analyzer

Developer(s) pqyt
Repository GitHub
Release information
Initial release
Stable release 0.7.6.2 (April 17, 2024; 0 years ago)
Preview release
foobar2000 compatibility
Architecture x86 32-bit, x86 64-bit
Minimum version 2.0
Maximum version
UI module(s) Default UI, Columns UI
Additional information
Use Visualization
License MIT License
Discussion thread {{{discussion_thread}}}
View all components

A recreation of the Musical Spectrum component for foobar2000 v2.x and 64-bit versions. Windows 10 or higher are the only supported operating systems.

It uses DirectX (Direct2D and DirectWrite) to render its graphics. Over time more visualizations likes a spectogram and a peak meter were added.

The component supports Dark Mode and the Default (DUI) and Columns User Interface (CUI).

You can double-click the component window to switch between windowed and full-screen mode.

When using the Default User Interface (DUI) the full-screen version is another instance of the component with its own configuration. When you use the Columns User Interface (CUI) the existing instance will be resized to occupy the full screen.

Context Menu

Right-click on the component window to display the context menu. The following options are available:

Configure

Opens the Configuration dialog. This component has its own configuration dialog instead of a page in the standard foobar2000 preferences dialog.

Toggle Full-Screen Mode

Toggles full-screen mode off and on.

When using the Default User Interface (DUI) the full-screen version is another instance of the component with its own configuration. When you use the Columns User Interface (CUI) the existing instance will be resized to occupy the full screen.

Frame Counter

Enables the display of a rudimentary frame counter.

Refresh Rate Limit

Allows you the selected the refresh rate of the component animation. Note that even though the component can redraw its visuals very fast the actual maximum refresh rate is usually determined by the refresh rate of your monitor.

Presets

Contains a list of previously saved presets. Select one from the list to activate it. A checkmark will be shown next to the latest activated preset.

Freeze

Prevents the refresh of the component, effectively reducing CPU and GPU use to 0.

Configuration dialog

The configuration dialog is used to change all parameters used by the component. All changes are applied immediately to the component without the need to close it.

Close the dialog with Close button or the Cancel button to undo any changes to the configuration.

Reset

Resets the configuration to the default values.

OK

Closes the dialog box and preserves the changes to the configuration during the current session.

The settings will only be saved to your profile when foobar2000 is closed.

Cancel

Closes the dialog box and undoes any changes to the configuration.


Transform page

Transform group

Spectrum Analyzer Configuration: Transform

Method

Allows you to select the Time to Frequency domain transform. The following transforms are implemented:

  • Fast Fourier (FFT)
  • Constant-Q (CQT)
  • Sliding Windowed Infinite Fourier (SWIFT)
  • Analog-style

Window function

Selects the window function that will be applied to the samples (Time domain).

Window parameter

Allows you to tweak window functions that support a parameter like Gaussian and Kaiser.

Window skew

Adjusts how the window function reacts to samples. Positive values makes it skew towards latest samples while negative values skews towards earliest samples. Defaults to 0 (None).

Reaction alignment

Controls the delay between the actual playback and the visualization.

  • < 0: All samples are ahead of the playback sample (with the first sample equal to the actual playback sample).
  • = 0: The first half of samples are behind the current playback sample and the second half are ahead of it.
  • > 0: All samples are behind the playback with the last sample equal to the current playback sample.

Fourier Transform group

Groups the parameters that influence the Fast Fourier transform.

No. of bins

Specifies the number of bins used by the transforms as a number between 64 and 32768.

  • Select Custom to specify a number that is not a power of 2. This will consume a lot more CPU power.
  • Select Sample rate based to specify the size as a duration. F.e. 100ms of a track sampled at 44.1kHz will result in an FFT window of 4410 samples.

Coefficient aggregation

Determines which method is used to aggregate the coefficients of FFT.

  • Minimum
  • Maximum
  • Sum
  • Residual Mean Square (RMS)
  • RMS Sum
  • Average
  • Median

Mapping

Determines how the FFT coefficients are mapped to the frequency bins.

  • Standard
  • Triangular Filter Bank
  • Brown-Puckette CQT

Smooth lower frequencies

When enabled, the band power part only gets used when number of FFT bins to sum for each band is at least two or more.

Smooth gain transition

Smooths the frequency slope of the aggregation modes.

Lanczos kernel

Determines the size of the Lanczos kernel. The kernel is used to create a smooth transition between the FFT coefficients resulting in a visual pleasing result.

Brown-Puckette CQT Mapping group

Bandwidth offset

Offsets the bandwidth of the Brown-Puckette CQT.

Bandwidth cap

Minimum Brown-Puckette CQT kernel size.

Bandwidth amount

The Brown-Puckette CQT kernel size.

Granular bandwidth

When disabled constrains the bandwidth to powers of 2.

Kernel shape

Determines the shape of the Brown-Puckette CQT kernel.

Kernel shape parameter

Parameter used by certain window functions like Gaussian and Kaiser windows.

Kernel asymmetry

Adjusts how the window function reacts to samples. Positive values makes it skew towards latest samples while negative values skews towards earliest samples.

Infinite Impulse Response (IIR) group

Groups the parameters used by the SWIFT and the Analog-style transforms.

Filter bank order

Determines the order of the filter bank used to calculate the SWIFT and Analog-style transforms.

Time resolution

Determines the maximum time resolution used by the SWIFT and Analog-style transforms.

Bandwidth

Determines the bandwidth used by the SWIFT and Analog-style transforms.

Constant-Q

Uses constant-Q instead of variable-Q in the IIR transforms.

Compensate bandwidth

Compensate bandwidth for narrowing on higher order IIR filters banks.

Use prewarped Q

Prewarps Q to ensure the actual bandwidth is truly logarithmic at anything closer to the Nyquist frequency.


Frequencies page

Spectrum Analyzer Configuration: Frequencies

Frequencies group

Groups the parameters that determine the frequency range that will be displayed.

Distribution

Determines which parameters are used to generate the frequency bands.

  • Linear: Generate frequency bands based on the frequency parameters.
  • Octaves: Generate frequency bands based on the note parameters.
  • AveePlayer: Generate frequency bands used by AveePlayer.

No. of bands

Specifies the number of frequency bands to generate (2 to 512) in the specified frequency range.

Frequency range

Frequency of the first and last band, 1Hz to 96000Hz. Each frequency is centered in the band.

Note range

Available when selecting the Octaves distribution. Select a range between the C note of octave 0 and B# of octave 11 (max. 144 notes or 12 octaves)

Bands per octave

Number of bands per octave (1 to 48)

Pitch

Frequency of the tuning pitch (A4 = 440.0Hz), 1Hz to 96000Hz.

Transpose

Determines how many semitones the frequencies will be transposed. (-24 to 24)

Scaling

Determines which which will be used to scale the frequencies:

  • Linear
  • Logarithmic
  • Shifted logarithmic
  • Mel (AIMP)
  • Bark
  • Adjustable Bark
  • ERB
  • Cams
  • Hyperbolic Sine
  • n-th Root
  • Negative exponential
  • Period

Skew factor

Affects any adjustable frequency scaling functions like hyperbolic sine and n-th root. Higher values mean a more linear spectrum.

Bandwidth

Distance between the low and high frequency boundaries for each frequency band. (0.0 to 64.0)


Filters page

Spectrum Analyzer Configuration: Filters

Acoustic Filters group

This group contains settings to allow you to apply acoustic weighting filters (A-, B-, C-, D- and M-weighting (ITU-R 468)) to the samples.

Weighting type

Selects the weighting filter type that will be applied.

Slope function offset

Slope function offset expressed in sample rate / FFT size in samples

Slope

Frequency slope offset

Slope offset

Frequency slope in dB per octave

Equalize amount

Equalization amount

Equalize offset

Equalization offset

Equalize depth

Equalization depth

Weighting amount

Weighting amount


Common page

Spectrum Analyzer Configuration: Common

This page contains settings that the visualizations have in common.

Common group

Smoothing method

Determines how the spectrum coefficients and the peak meter values are smoothed.

  • Average: Calculates a weighted average between the old and the new value of the peak. Uses the smoothing factor as a weight.
  • Peak: Retains the maximum between the old and the new value of the peak.

Smoothing factor

Specifies the strength of the smoothing (0.0 to 1.0)

Tooltips

Enable the check box to see a tooltip with the center frequency and when appropriate, the name of the note, of the frequency band.

Suppress mirror image

Prevents the mirror image of the spectrum (anything above the Nyquist frequency) from being rendered.

Artwork group

Some visualizations can use artwork to display on the background or to use as a source for a color list. The artwork can come from the playing track or from file location.

No. artwork colors

The maximum number of colors to select from the artwork.

Lightness threshold

Determines when a color is considered light. Expressed as a percentage of whiteness.

Sort colors by

Determines how to sort the colors selected from the artwork.

Show artwork on background

Displays the artwork on the graph background.

Fit mode

Determines how over- and undersized artwork is rendered.

  • Free: The artwork will not be scaled.
  • Fit big: Artwork that is bigger than the available area will be proportionally scaled.
  • Fit width: The width of the artwork is scaled to fit in the available area.
  • Fit height: The height of the artwork is scaled to fit in the available area.
  • Fill: The width or height of artwork is scaled to fit the available area.

Fit window

Enable to use the full component window as available area instead of the client area (the window minus any room taken by axes)

Artwork opacity

Determines the opacity of the artwork when displayed.

Artwork file path

A fully-qualified file path or a foobar2000 script that returns the file path of an image to display on the graph background.


Visualization page

Spectrum Analyzer Configuration: Visualization

Type

Determines the type of visualization:

  • Bars: The classic spectrum visualization
  • Curve: The same as bars but with a smoothed curve instead of bars.
  • Spectogram
  • Peak Meter: Displays the peak and RMS levels of the track.
  • Level Meter: Displays the balance and mid/side correlation of the track.

Peak indicators group

Some visualizations can display indicators for the peak values. The following settings determine how those peak indicators are animated.

Peak mode

Specifies how the peak indicators are rendered:

  • None
  • Classic
  • Gravity
  • AIMP
  • Fade Out
  • Fading AIMP: A combination of AIMP and Fade Out

Hold time

Specifies how long a peak value will be held steady before it decays.

Acceleration

Specifies the acceleration used to decay the peak value.

LEDs group

Some visualizations can display a bar as simulated LED lights.

Enabled

Display the spectrum bars and peak meters as LEDs.

LED size

The size of the LED light, in pixels.

LED gap

The size of the gap between the LEDs, in pixels.

Spectogram group

Scrolling

Activates scrolling of the spectogram.

Peak Meter group

The peak meter will display the instant peak and RMS over time level of the playing track.

A gauge will be shown for each of the channels in the playing track but only when it is also selected in the Channels list on the Graphs page. F.e. a 7.1 track with only the Front Left and Front Right channel selected will only show 2 gauges. A mono track without the Front Center channel selected will show no gauge.

Horizontal

Renders the peak meter horizontally.

RMS+3

Adds 3dB to the RMS value.

RMS window

Specifies the duration of each RMS measurement (in seconds).

Gauge gap

Specifies the gap between the gauges (in pixels). Defaults to 1 pixel.

Graphs page

Spectrum Analyzer Configuration: Graphs

The component window can contain more than one graph at the same time. Some users use this to create facing spectrum analyses. Graphs can have individual settings but share the visualization type and the styles.

Graph list

The graph list shows all graphs in the current window. Use the + button to add a graph. Use the - button to remove the selected graph.

Vertical layout

Enables this setting to stack the graphs vertically instead of horizontally.

Description

Allow you to edit the description of the selected graph.

Flip horizontally

Flips the current graph horizontally. Any axes will be rendered accordingly.

Flip vertically

Flips the current graph vertically. Any axes will be rendered accordingly.

X axis group

Groups the parameters that determine the way the X axis is displayed.

Mode

Determines which X axis to display.

  • None: Hides the X axis (reserve no screen area for it).
  • Bands: Center frequency of a band, every 10 bands.
  • Decades: Fixed frequency range
  • Octaves: Frequency of the C note of each octave
  • Notes: C note of each octave

Top

Displays an X-axis on top of the graph.

Bottom

Displays an X-axis at the bottom of the graph.

Y axis group

Groups the parameters that determine the way the Y axis is displayed.

Mode

Determines which Y axis to display.

  • None: Hides the Y axis (reserve no screen area for it).
  • Decibel scale: Uses decibel values to render the scale.
  • Logarithmic: Uses logarithmic values to render the scale.

Left

Displays an Y-axis on the left of the graph.

Right

Displays an Y-axis on the bottom of the graph.

Amplitude range

Determines the minimum and maximum amplitude, expressed in decibel (dB), to display.

Amplitude step

Determine the step size between the min. and max. amplitude.

Use absolute

Sets the min. amplitude to -∞ dB (0.0 on the linear scale) when enabled.

Gamma

Sets index n of the n-th root calculation.

Channels

Allows you to select the audio channels that will be used to participate in the analysis of a chunk of audio samples.

Most users will enable only the left and right channel. Therefor no information will be shown in the graph when a mono track is played. Also enable the Front Center channel to remedy this situation.


Styles page

Spectrum Analyzer Configuration: Styles

Most of the elements of a graph can be styled. The styles list shows all available styles. Each style has a number of settings that determine how the element is rendered.

Color source

The color source determines where the element gets its color information from.

  • None: Prevents the element from being rendered.
  • Solid: A single color is used to render the element.
  • Dominant color: The dominant color in the artwork is used to render the element. The artwork does not have to be rendered on the background.
  • Gradient: The element is rendered using a gradient created from the color list below.
  • Windows: The element is rendered using a standard Windows color.
  • User Interface: The element is rendered using a standard DUI or CUI user interface color.

Color index

Allow you to select a color when color source Window or User Interface is specified.

Color

Displays the current color used by color source Solid or Dominant Color. Click to modify the color.

A standard Windows color dialog that has been extended with controls to modify the alpha channel of the color will pop up.

Color scheme

Specifies the color scheme used to render the element.

  • Solid color: A single color, effectively the same as color source Solid.
  • Custom: A custom list of colors.
  • Artwork: A list of colors determined by the current artwork
  • Prism 1
  • Prism 2
  • Prism 3
  • foobar2000
  • foobar2000 Dark Mode
  • Fire
  • Rainbow
  • SoX: A list of colors emulating the spectogram colors used by SoX.

Color list

Double-click a color to modify it. Modifying a color of a built-in color scheme automatically selects the Custom color scheme.

Press the Add button to add a color, Remove to remove a color, Reverse to reverse the color list.

The position of the color in the gradient is expressed as a percentage of the length of the gradient. E.g. a position of 50% puts the color in the middle of the gradient.

Press the Spread button to evenly spread the colors in the list over the gradient. This updates the position of the colors as required.

Horizontal gradient

Generates a horizontal instead of a vertical gradient.

Amplitude-based

Some styles can use the amplitude of a spectrum frequency to determine the color. This option can only be applied to a horizontal gradient.

Opacity

Specifies the opacity of the rendered element.

Thickness

For some styles you can specify the thickness of the brush used to render the element.

Font name

Specifies the name of the font used to render the element.

Font size

Specifies the size in points of the font used to render the element.


Presets page

Spectrum Analyzer Configuration: Presets

The whole configuration can be saved to a preset. A preset can be reloaded at any time.

Presets are not interchangeable with x86 and x64 versions of foobar2000. Special care is taken to be as backwards compatible with preset files saved by older versions of the component.

You can recognize preset files by the fvsa file extension.

Location

Contains the path name of the location of your preset files. By default the foobar2000 profile directory is used.

For privacy reasons the location is stored in your foobar2000 settings but will not be included in a preset file. Preset files contain no personal information and can be safely exchanged with other users.

Below the location you find the preset files currently found in the specified location.

Double click a preset to activate it or select it and press the Load button.

Name

Specifies the name of the preset.

Load

Loads and activates the currently selected preset.

Save

Saves the current configuration.

Delete

Deletes the currently selected preset.

External links

See also