buf.op, cut sound at "0 energy"
I am not an expert in buf.Op, so I’m searching for tips to cut a one hour sample in a random way only at "0 sound energy" to avoid clicks…and make a folder of those samples.
Anyone would know about this ?
I trie several buf.Op examples from the forum, but none responds to this point, I just can find the minimum and maximum of energy but not the "0".
Should I do a FFT ?
it’s not quite clear what you exactly want to do…
if you just want to avoid clicks it would be a lot easier to just apply an amplitude envelope, when playing the samples.
if you want to seperate the "events" in your audiofile (like for example protool’s beat detective), that’s a whole different story.
Depending on the kind of your audio material this can get quite tricky.
And if you want to do this "offline" (meaning, not having to wait one hour for the whole buffer to be processed), max is probably not the best environment for this task.
Of course, it can be done in max ;)
If you want to split only at zero crossings, then there is [zerox~] but I don’t know how accurate it would be to do what you want. The only way I can think of to do it would be to generate your random split points, then scan the buffer (with peek~ or index~), detecting the 0-crossings (with zerox~ or some maths after peek~), and then quantize the random split points to the list of 0-crossings.
For a 1 hour audio file that would take a long time! Well, it would take an hour if you did it at audio rate with zerox~. You could set up a patch that used the non-realtime audio driver though.
I agree with Mudang, you could do it in max but it would probably be pretty clunky, and much much easier to window out clicks during playback.
I tell my point in a different way:
One hour of speech from streaming radio should be cropped randomly in little audios tracks, and to avoid clicks, it should be done at 0 energy, (I am not talking about silence, but it could be a solution if I don’t manage to do what I want).
I keep searching :)
wonder how long it would take peek~ to scan and copy the relevant parts to new buffers~ and save them…?
energy is something which can not be measured for only one sample, so in
order to find the sample where you want to cut, you need to do DSP in the
runtime, a bufer object wont have such a feature.
Forums > MaxMSP