Non real time zero crossing analysis of a singal to a buffer with ZeroXBufWr

Hello!

Is there a way of analysing the zero crossings of a whole file without needing to wait for the whole file to play in order to do the analysis?

Here is the example of the help file where the analysis happens till the moment you stop the audio. I would like to analyse some larger files so it would be great if there is a solution.

(
p = Platform.resourceDir +/+ "sounds/a11wlk01.wav";
b = Buffer.read(s, p);
z = Buffer.alloc(s, 100000);
)

// analyse buffer

(
{
    var src = PlayBuf.ar(1, b, BufRateScale.ir(b), doneAction: 2);
    ZeroXBufWr.ar(src, b, z, startWithZeroX: 0, doneAction: 2);
}.play
)

thank you!

You can do it simultaneously but have to take care to stay below the zero crossing index. See Ex.6 of the TZeroXBufRd helpfile.

See also Analysis using a Non-Realtime server in the NRT Guide – literally non-real-time analysis.

hjh

Valid point. What I suggested is RT analysis that’s usable if you refer only to previously analyzed data. That might or might not be useful in the given context.
I mainly used wavesets with rather short sound files. Otherwise, a NRT analysis would certainly make sense.

Thank you! It worked perfectly!