Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: sometimes, for subtitling music videos, it is important to synchronize subtitles to the music. Most of the music energy is located in the bass frequencies, but the current spectrum display packs everything in the 2–3 bottom lines, which is unreadable. Generally, in audio software, spectrum is displayed on a logarithmic frequency scale, spacing octaves linearly, giving more display room for the bass frequencies. Anyway, something in-between linear and log is probably the most suitable for subtitling, showing clearly both the vocal formants and the low-frequency content (bass drum and other instruments).
This patch adds the following:
– Selection of 5 different frequency mappings for the spectrum display, from linear (current default) to logarithmic (octaves are spaced linearly). Internally, the mapping is done by adjusting the vertical position of the 1 kHz band. Formula here.
– Field added in the preference page to select this frequency mapping.
– New preference key to remember this setting:
Audio/Renderer/Spectrum/FreqCurve
It also fixes some existing quirks:
– Consistent display with high sampling rates (> 48 kHz). Previously, the FFT size was not adjusted depending on the sampling rate, leading to a poor frequency resolution in the audible part of the spectrum.
– Display is clipped to 20 kHz, so ultrasonic content does not waste the space at high sampling rates anymore.
– Fixed time shift with high quality settings (code copied from another Aegisub fork)
– Previous “interpolate” mode was buggy (
minband
added twice + range not checked leading to corrupted display)This patch also makes the high and insane qualities actually useful, showing much more details from the lower part of the spectrum.
The following picture shows, in “better” spectrum quality: