[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] FreqScope Spasm Fix

There is a bug that most people who have used FreqScope are familar with where the spectrogram will occasionally jump around.

This is because of the way ScopeOut synchronizes with the lang. If the lang is copying the scope buffer then ScopeOut temporarily stops writing data to it's buffer. It is possible for the FFT magnitudes to get written starting mid-way through the scope buffer if the reading does not take an even amount of time. The FFT magnitudes continue to be given to ScopeOut even though ScopeOut isn't putting them in the buffer.

The fix for this is to continue incrementing the buffer position even if the lang is reading. When the entire buffer has been filled, which may involve wrapping around, the write count is incremented and the lang reads. Currently the write count is only incremented when the frame position reaches the end.

Attached is a patch for the bug. I've also changed SCFreqScope to take advantage of recent FFT improvements (using a Hann window and a larger window improves accuracy and appearance considerably).

I think this should go in 3.2 because of how annoying the bug is, but if time is short it can wait.


Attachment: FreqScope_fix.patch
Description: Binary data