···112112113113#### API Functions
114114```lua
115115-value = fft(bin) -- Get raw FFT magnitude for bin (0-1023)
116116-value = ffts(bin) -- Get smoothed FFT magnitude for bin (0-1023)
115115+value = fft(bin) -- Get peak-normalized FFT magnitude for bin (0-1023)
116116+value = ffts(bin) -- Get smoothed peak-normalized FFT magnitude for bin (0-1023)
117117```
118118+119119+**Note:** Both FFT functions return peak-normalized values (auto-gain controlled), not raw magnitudes.
118120119121### VQT Implementation
120122···147149148150#### API Functions
149151```lua
150150-value = vqt(bin) -- Get raw VQT magnitude for bin (0-119)
152152+value = vqt(bin) -- Get peak-normalized VQT magnitude for bin (0-119)
151153-- Note mapping: Bin = octave * 12 + note
152154-- Note: C=0, C#=1, D=2, D#=3, E=4, F=5, F#=6, G=7, G#=8, A=9, A#=10, B=11
153155```
156156+157157+**Note:** VQT also returns peak-normalized values (auto-gain controlled), not raw magnitudes.
154158155159### FFT vs VQT Comparison
156160···206210### Completed Features
207211- **FFT**: 1024 bins with exact original behavior preserved
208212- **VQT**: 120 bins with Variable-Q implementation
209209-- **Spectral Whitening**: Per-bin normalization for VQT
213213+- **Spectral Whitening**: Per-bin normalization for VQT (removed due to spreading issues)
210214- **Shared Audio Buffer**: Automatic sizing for both FFT and VQT
211211-- **Lua API**: `fft()`, `ffts()`, `vqt()` functions implemented
215215+- **API Functions**: `fft()`, `ffts()`, `vqt()`, `vqts()` implemented for all supported languages
216216+- **Peak Normalization**: Both FFT and VQT use auto-gain control
212217213218### Configuration Options
214219- `VQT_FFT_SIZE`: Default 8192 (configurable in vqtdata.h)
···226231## Future Enhancements
227232228233### Additional API Functions
229229-- `vqts(bin)`: Smoothed VQT data
230230-- `vqto(octave, note)`: Raw VQT by musical note
234234+- `vqts(bin)`: Smoothed VQT data (already implemented)
235235+- `vqto(octave, note)`: VQT by musical note
231236- `vqtos(octave, note)`: Smoothed VQT by musical note
237237+- `fftr(bin)`: Raw (non-normalized) FFT magnitude
238238+- `fftrs(bin)`: Raw smoothed FFT magnitude
239239+- `vqtr(bin)`: Raw (non-normalized) VQT magnitude
240240+- `vqtrs(bin)`: Raw smoothed VQT magnitude
232241233242### Signal Processing Enhancements
234243- **Adaptive Thresholding**: Dynamic noise floor removal
+31-1
src/api.h
···822822 1, \
823823 0, \
824824 double, \
825825- tic_mem*, s32 startFreq, s32 endFreq)
825825+ tic_mem*, s32 startFreq, s32 endFreq) \
826826+ \
827827+ \
828828+ macro(vqt, \
829829+ "vqt(bin)", \
830830+ \
831831+ "Get Variable-Q Transform magnitude for a specific frequency bin.\n" \
832832+ "VQT provides 120 bins (0-119) with logarithmic frequency spacing for musical analysis.\n" \
833833+ "Each bin corresponds to a musical note: bin = octave * 12 + note\n" \
834834+ "where octave is 0-9 and note is 0-11 (C=0, C#=1, D=2, ..., B=11).\n" \
835835+ "Returns a value roughly 0..1 based on the intensity at that frequency.", \
836836+ 1, \
837837+ 1, \
838838+ 0, \
839839+ double, \
840840+ tic_mem*, s32 bin) \
841841+ \
842842+ \
843843+ macro(vqts, \
844844+ "vqts(bin)", \
845845+ \
846846+ "Get smoothed Variable-Q Transform magnitude for a specific frequency bin.\n" \
847847+ "VQT provides 120 bins (0-119) with logarithmic frequency spacing for musical analysis.\n" \
848848+ "Each bin corresponds to a musical note: bin = octave * 12 + note\n" \
849849+ "where octave is 0-9 and note is 0-11 (C=0, C#=1, D=2, ..., B=11).\n" \
850850+ "Returns a smoothed value roughly 0..1 based on the intensity at that frequency.", \
851851+ 1, \
852852+ 1, \
853853+ 0, \
854854+ double, \
855855+ tic_mem*, s32 bin)
826856827857#define TIC_API_DEF(name, _, __, ___, ____, _____, ret, ...) ret tic_api_##name(__VA_ARGS__);
828858TIC_API_LIST(TIC_API_DEF)