Enhancements since the previous beta
- Slightly different frequency range for better VQT accuracy: 19.445 Hz (D#0/Eb0) - 20480 Hz (10 octaves × 12 notes = 120 bins)
- Spectral whitening (separate functions for backwards compatibility): removes timbre/tilt, improves clarity of notes; can also improve things in cases when bass overly dominates.
vqtw(bin): Peak-normalized whitened VQT magnitude.vqtsw(bin): Smoothed peak-normalized whitened VQT magnitude.vqtrw(bin): Raw whitened VQT magnitude (no auto-gain).vqtrsw(bin): Raw smoothed whitened VQT magnitude.
Misc fixes, cleanups.
A note
There is a 4-frame difference between FFT and VQT due to the laws of physics with FFT slightly lagging: if you care about it, you can have a simple 8-frame buffer and a 4-frame delay on FFT. In practice, I don't think it matters much often.
Previous version's release notes below:
Variable-Q Transform
FFT is great for bass and rhythm and less good for everything else. Variable-Q Transform, a very close sibling of Constant-Q Transform is an algorithm that breaks the music down to octaves and semitones. It opens up a new dimension to play with. We put 10 octaves and 12 semitones into 120 buckets, with the source being 8k FFT buckets.
The new functions available are:
vqt() - peak normalized data with values between roughly 0-1
vqts() - peak normalized data with a 0.3 factor of smoothing, values between roughly 0-1
vqtr() - raw data with values between 0 and a lot
vqtrs() - raw data with a 0.3 factor of smoothing, values between 0 and a lot
Raw FFT data
fftr() - raw FFT data (1024 buckets, same as fft()) with values between 0 and a lot
fftrs() - raw FFT data (1024 buckets, same as ffts()) with smoothing with values between 0 and a lot
The vqt functions take one parameter and currently don't have any summing functions like the fft ones, I'm not sure they need them given their different nature but let me know if this is something you guys want, it's pretty easy to add.
VQT gets enabled with FFT, there isn't a separate switch for it. It also currently outputs some debug information to the console.
This is very beta and and while I did some testing I'll obviously need feedback from y'all.