I'm currently attempting to create a vectorscope that analyzes realtime audio in Javascript using the Web Audio API. During every cycle, the API allows access to the current frequency data and time domain data. I have already recreated lissajous figures using simple values for the a and b variables in the following equations:
var x = A*sin(a*t);
var y = B*sin(b*t);
Where A & B are the magnitudes, a & b are the frequencies, and t is time (which I obtain with performance.now() ).
My issue is that I'm not sure how to implement the data from the Byte Frequency Data and the Byte Time Domain Data from the Web Audio API into the equations above. In my code I have two oscillators that are stereo-detuned to one another (to highlight phase correlation) which are fed into two analyzers (one for the left channel and one for the right). From both of the analyzers I can extract data with the methods getByteFrequencyData() and getByteTimeDomainData(). Both of these methods return a Uint8 array of the requested data. I currently iterate through the buffers from the analyzers and apply the contained data to the equations above during each iteration. The result is a mess of lines, albeit on an x/y graph.
If anyone has any idea on how to translate the frequency and time domain data into usable values for the variables of the equation I would greatly appreciate it. Cheers!