Looking for best approaches here. Say I have a buffer~ object, filled with a bit of silence of unknown length (maybe not *exactly* 0.0 values, but close), followed by a few seconds of a tone comprised of repeating waveforms. I hesitate to say "single cycle", as each cycle might be composed of multiple zero crossings - these are not single cycle (e.g. sines, trianges, sawtooths, etc..) in the purest sense - they're complex waveforms. I *do* know that each repeating cycle is 256 samples in length.
What would be the best approach in extracting the 256 samples that comprise this "single cycle"?
I've tried simply stripping the beginning silence using automated approaches, and then counting 256 samples, and though it sort of worked, it was not precise enough, not sure why. Possibly because the sound takes some time to steady, or perhaps because my silence stripping was not accurate enough.
When I visualize the buffer~, I can clearly see the repeating patterns, so I figure there should be some way of perhaps taking adjacent 256 sample buffers, and measuring the absolute difference between the corresponding samples in each buffer. The 256 sample range which generates the least total difference with the 256 sample ranges after it is the "winner"?
Before I start trying to code this, does this reasonable? Any other better solutions? I hope my explanation makes sense....