View Single Post
Old 06-22-2015, 02:31 PM   #21
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Quote:
Originally Posted by Tale View Post
May instead of applying the Hamming window you could simply set the first sample of data[] to zero. That way you the output should still match the input, but then you can see where each buffer starts.
I set data[0] = 0.0. Comment out the Hamming. I'm using the code you posted.

I can see data[0] appearing at exactly the intervals of 1024 and integer multiples of it, even if I shift the input file (sine wave 1000Hz). It's just that the data[0] doesn't align with the sine wave (the input audio), which it should, but rather follows those sample intervals, i.e. is relative to the host.

This corresponds to why the hamming is seen not aligning with the sine wave. But where's the problem?

It seems like reading audio in is done before it's really input into the plug-in, because what's seen here corresponds to that some nFrames must have been passed in before the audio file starts? Right? Otherwise the processingBuffer wouldn't fill up and we wouldn't see data and data[0] at those intervals, because (in shifted.jpg) the data array shouldn't have existed at those intervals yet.

The reason there isn't initial 1024 zeros in these pictures is because I've set PLUG_LATENCY 1024, so it makes the input and output align. But the initial zeros are outputted correctly (seen if I set PLUG_LATENCY 0).
Attached Images
File Type: jpg aligned.jpg (24.5 KB, 120 views)
File Type: jpg shifted.jpg (24.5 KB, 128 views)

Last edited by mviljamaa; 06-22-2015 at 02:57 PM.
mviljamaa is offline   Reply With Quote