
Mon 13 Jun 05 @ 9:31 pm
How to convert an analogical signal to numerical signal:(example of a sinusoidal sound with a frequency f=1/T) (T in second(s) and f in Hertz(Hz))

In fact you get a value on the curve at each Te second: SAMPLE_RATE: (= number of samples by second)
fe=1/Te=44100Hz for Virtual DJ (=> Te~0.02ms)
Each blue cross is a sample (= a value, positive or negative)

A song is a superposition (an addition) of a lot of sinusoidal sound with different frequencies (for more information, read about Fourier) and a "time of life" (depending on the frequency and style of the played song)
A stereo song is composed of two channels = two curves, one for left speaker, another one for right speaker
In the VDJ plugin, a song is represented by a "vector" (a table represented by a pointer in C++) of samples from 1 to songLength where songLength is the number of blue cross in the song. Each case of the table contains the value (integer positive or negative) of the sample. Thanks to this method, you can directly know where you are in the song, the most of the time, we call pos the integer corresponding to the current position in the song. For example: with SongLength + SAMPLE_RATE fe, we can guess the length in seconds of the song, then convert in minutes,etc...
