LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.8k stars 986 forks source link

Equalizer's spectrum analyzer not detecting short notes #6122

Open viraxor opened 2 years ago

viraxor commented 2 years ago

Bug Summary

The equalizer doesn't display frequencies on the spectrum analyzer and the channels under it when the notes are very short. I tested this on 1.3.0 alpha.

Steps to reproduce

Put very short notes in the piano roll (1/192, 2/192, 3/192, 4/192) with a bit of spacing between them. Put an equalizer and play.

Expected behavior

The equalizer should display the note frequencies on the spectrum analyzer.

Actual behavior

The equalizer does not display any frequencies on the spectrum analyzer.

Screenshot

unknown

Affected LMMS versions

LMMS 1.3.0 Alpha

Here's the project file: https://cdn.discordapp.com/attachments/242409373505159168/872822886778437632/equalizer_not_working.mmpz

Spekular commented 2 years ago

Worth noting is the fact that these notes show up on the standalone spectrum visualizer regardless of window size, and are loud enough to show on all Y axis scales except "Extended" with logarithmic toggled*.

*i.e. set to whichever setting isn't default, the icons in the visualizer are just colored squares in my install.

he29-net commented 2 years ago

This is caused by the FFT window function, the short note (or percussion etc.) simply sometimes falls to the dead space where signal is squashed to zero. Explanation from #5160:

  • advanced config: add support for FFT window overlapping If the signal (red) contains a fast transient, it can fall to a place between blocks, where FFT window function squishes it to zero (right side); such transient would be invisible on the waterfall display; by overlapping the blocks / windows (left) it can be ensured that all transients are always covered, at the cost of processing each sample multiple times. fft_window_overlap

Some small, fixed window overlap could be implemented in the Eq plugin as well, but it has some performance impact and there is no good space for extra controls to allow turning it off. On the other hand, most of the CPU cycles it eats are from drawing, the FFT analysis itself is very fast and it should not affect the performance that much. On the third hand, IIRC, the FFT analysis in Eq plugin runs in the realtime audio thread, so unlike GUI drawing, the performance hit from the addition of overlap would have impact on the CPU load shared by all instruments, mixing etc.

allejok96 commented 2 years ago

A Kicker beat with a length of 45ms falls through the Equalizer's spectrum sometimes. But the Spectrum analyzer shows it at all time, even if I decrease the length down to 5ms, and no matter how I tweak the graph settings (window size = 1). Why is it so? Can't this be applied to Equalizer as well?