sam
sam copied to clipboard
Comment: "Frequency" data is actually a stride value
The table frequencyData values are referred to in the comments frequency values, which isn't strictly true.
They're actually stride values. Per your comments in the rendering sections, the original version of SAM used a pre-calculated sine table instead of calling the sin() function.
By using a stride value, SAM is able to find the next sine value for each formant simply by adding the stride value to the table index (and, of course, wrapping at the end of the table).