Spectral Analysis

Overview
The Spectral Analysis window provides a real-time visualisation and control interface for frequency-domain analysis of audio signals. It combines Fast Fourier Transform (FFT) processing with a configurable analysis environment, supporting in-depth inspection of frequency components over time. The display includes magnitude spectra and peak detection, facilitating detailed timbral and structural audio analysis.
In addition to its analytical capabilities, the environment supports direct integration with compositional workflows. The Export Partials function enables the extraction and preservation of spectral data in a format compatible with the Opusmodus library system. This allows composers to employ spectral data as a generative resource, thereby placing the techniques of spectral composition, including orchestration, transformation, and algorithmic modelling, immediately at their disposal.
Spectrum View (Graph Area)
X-axis: (Frequency, logarithmic scale): Ranges from ~8.17 Hz to 20 kHz (depending on user input).
Y-axis: (Normalised Amplitude): Ranges from 0.0 to 1.0.
Bars: Represent the magnitude spectrum at the current frame.
Curve Line: Shows averaged or smoothed spectral envelope.
Peak: Display detected frequency peaks (e.g., 21, 69, 144 etc. in Hz).
Top Information Bar
Fps: Frames per second of visual refresh.
RMS: Root Mean Square amplitude of current frame.
Bars: Number of spectral bins displayed.
Pos: Current time/frame position and total duration.
Cen: Spectral centroid (in Hz).
Roll: Spectral roll-off frequency (in Hz).
Spr: Spectral spread (standard deviation from centroid, in Hz).
Flat: Spectral flatness (0.0 = harmonic; 1.0 = noise-like).
Control Buttons and Options
Play: Initiates playback and real-time analysis.
Rewind: Resets position to start of audio buffer.
Scale: Log Selects frequency scale (e.g., Logarithmic or Linear).
Show Octaves: Displays octave grid overlays.
Analyser: Opens or configures the main Analyser module.
Analysis Parameters
FFT size: Number of points in FFT computation; affects frequency resolution, default: 16384.
Window size: Size of analysis window (samples); affects time resolution, default: 2048.
Hop size: Overlap between windows (samples), default: 1024.
Frame interval: Time interval (seconds) between frames, default: 0.01.
Min peak diff: Minimum difference between adjacent peaks for detection, default: 0.01.
Min amp (dB): Minimum amplitude threshold for rendering spectrum, default: -90.
Under-peak (dB): Threshold below peak for considering partials, default: -60.
Min freq (Hz): Lower bound of frequency range displayed, default: 8.1758.
Max freq (Hz): Upper bound of frequency range displayed, default: 12543.855.
Window: Type of windowing function used for FFT (e.g., Hanning, Hamming, Blackman). Can be selected live to immediately observe its effect on the spectral analysis, default: :hanning.
Inactive Buttons (Context-Sensitive)
Export Partials (Disabled): Enables the export of spectral partials once sufficient analysis data is available. Upon activation, this function saves the extracted partials in a file conforming to the Opusmodus library format. The file is stored in the designated library location and indexed automatically for future retrieval, reuse in composition, or further spectral processing.
Resample Rect (Disabled): Once active, performs rectangular resampling of the analysed audio. The resampled signal is saved as an audio file in the Media/Audio directory. The newly generated file is indexed automatically, allowing direct access through the Opusmodus Spectral Analysis or for subsequent processing.
Interactive Controls and Selection Tools
Timeline Selection (Shift + Click & Drag)
Holding the Shift key while clicking and dragging horizontally across the graph area allows the user to define a temporal selection on the timeline. This operation sets the active region for analysis playback and data export.
The horizontal extent corresponds to the time range (start - end) under analysis.
This selected interval can be used to constrain playback or to focus data extraction (e.g., exporting partials within the selected window).
Rectangular Selection (Option + Click & Drag)
Holding the Option (Alt) key while dragging the mouse enables a rectangular selection within the spectral display. This selection defines both frequency and time bounds.
The vertical axis of the selection restricts frequency range.
The horizontal axis restricts time range.
This selection becomes active for specific functions such as resampling or focused spectral export.
Once defined, the rectangular region is visually highlighted and is used as a contextual domain for subsequent operations.
Graphical Labels
Peak Frequency: Numeric labels (e.g., 21, 69, 144) appear above detected spectral peaks, denoting the frequency (in Hz) of dominant components.
Cursor Markers: While hovering or selecting, real-time frequency and amplitude information may be displayed depending on implementation.
Time Cursor: A vertical line or pointer indicates the current playback or analysis frame.
Keyboard Shortcuts
Spacebar Play/Pause the analysis. Starts or halts real-time playback.
Return Rewind to the beginning of the signal buffer.