buf.op, cut sound at "0 energy"

    Sep 27 2010 | 3:35 pm
    Hi, 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 ? Thx. -Ad-

    • Sep 29 2010 | 9:46 am
      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 ? Ad
    • Sep 30 2010 | 1:38 pm
      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 ;) Java/Javascript would be the way to go...
    • Sep 30 2010 | 2:14 pm
      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.
    • Sep 30 2010 | 2:29 pm
      Thx guys, 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). It's of course off line job, I'll search for javascript solution, maybe buf.Op could help me; I keep searching :) Ad.
    • Oct 02 2010 | 2:36 pm
      wonder how long it would take peek~ to scan and copy the relevant parts to new buffers~ and save them...?
    • Oct 02 2010 | 8:43 pm
      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.