The Audacity file TrackArtist.cpp contains a method TrackArtist::DrawClipSpectrum(…) which is responsible for the FFT conversion of a waveform and the drawing on screen of the Spectrum of that waveform. The amplitudes of the different frequencies in the spectrum are displayed on screen by different colors.
In that DrawClipSpectrum() method there is a single float called ‘value’ which contains the information with which a single frequency in the spectrum at one particular point in time can be displayed, thus:
- the frequency which is detected by the FFT routine
and
- the signal strength of that detected frequency.
The method
- GetColorGradient(value, selflag, mIsGrayscale, &rv, &gv, &bv);
converts the encoded info of ‘value’ into the three basic color values rv, gv and bv which together make the color by which the amplitude of a particular frequency is indicated.
My problem is that I can’t deduce from the source code how a single freqency and its amplitude are both encoded in this single float ‘value’.
The source code is poorly commented on that issue.
Is there anybody who can explain me the encoding rules of this float ‘value’ ?
or do I have to contact the author Dominic Mazzoni himselve in the hope he still remembers?
Thanks for any help,
jerome42