Store Buffer data to coll

kirky's icon

Hi there

I have a short buffer with some clicks in it. Most of the buffer is just filled with zeroes, but from time to time there are single sample values that are over 0.
What I want to do is store the bufferindex of these values over 0. and their amplitude in a coll (the index of the samples with value 0 dont need to be stored). The Index has to be precise to 1 sample, so I can't use something like "edge-"
I can't find a solution and I have no ideas left. Help would be greatly appreciated!

Thanks in advance!

double_UG's icon
Max Patch
Copy patch and select New From Clipboard in Max.
kirky's icon

Any chance that this logic is also possible in the signal world?
It takes a long time iterating through all the samples with something like uzi, especially if the buffer gets longer. Would be great if I even could do it faster-than-realtime.
Thanks anyway for the effort!

kirky's icon

Sorry I was wrong, that seems to work even with bigger buffers. Is there a limit to how many bangs an uzi can make? At 44100 samplerate there are a lot of bangs needed for a few seconds.

ak's icon
Max Patch
Copy patch and select New From Clipboard in Max.

In signal world you can play through buffer data and record data to the second auxiliary buffer, then put that data into coll, eg.:

You can also try with JS (Buffer object) or Java (see [mxj buf.Op] code).

Dan Laüt's icon

Double_UG's patcher works fine getting buffer~ data into coll. But how about getting the data back into a buffer~? Whatever I try, the original turns into a pop. The original sound file says "OK", but I don't know how to include it with the patcher.

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

as first uzi 512 -> peek on uknown buffer size ?

then you feed samples into coll only if they are not 0. ?
what is the sense of that ?

here is simplest example of buff-> coll -> buff

all one needs to know is size in samps for uzi,
when you import something into buffer

Max Patch
Copy patch and select New From Clipboard in Max.


if you want to post patch including any pictures
then paste picture ... or embed fpic