how to overlap samples(same length) in to one buffer?

missmiss's icon

hi,everyone.

I'm trying to use a ADC~ object to record a segment of sound running for 4'33'', then continue to sample the same segment of  sound from the same environment for the same length over and over again into ONE buffer~, in other words, the total length of the final piece should always be 4'33''.  Here is my question: How can I manage to overlay the multiple samples automatically in real-time ??

thx very very much

Chris Muir's icon

So you are doing a mashup of 4'33" and "I am sitting in a room" ?

At any rate, I would go to a double-buffer scheme. It's not _that_ much more memory, and makes this a fairly tractable problem.

missmiss's icon

Thanks for mentioned “ I am sitting in a room”,or I’ll never know the great work of Alvin Lucier. this is the address of the piece: <   http://ubu.artmob.ca/sound/source/Lucier-Alvin_Sitting.mp3    >, if anyone’s interested.

yes , i do use two buffer~s ,but i can't figure it out how to add one sample into a buffer which already been added all the samples before, meanwhile the overlapped one is been play~ing/groove~ing.

sorry , my english is no very good. i hope everyone can understand what i'm trying to say. this is emergency! thanks again!

Untitled1.maxpat
Max Patch
Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I haven't looked at your patch yet, but I liked the idea of the build up of 4'33" so I did this:

Roman Thilenius's icon

litter.nada ?

missmiss's icon

chris muir, thanks a lot! this patch is really helpful!

but one problem is ,how can i control the samples under an appropriate volume? anyway, we don't want to get a pure noise if some loud sound is sampled.

this is my solution , but if adc~ captured a loud sound, it will suddenly decrease the volume a lot .

chong.maxpat
Max Patch
missmiss's icon
Chris Muir's icon

Putting a compressor on the input might help, but if your source is loud enough to clip the input, there's not much you can do about it.

Normalization seems like a bad idea. It will bring up the noise floor immediately. Also, when Sample_A is recording, it is mixing with Sample_B and vice versa, so there is never really a "safe" time to normalize.

missmiss's icon

thanks chris. it seems this is not a "safe" patch, we can't control each element that ADC captured. but it still worth a try. I'll add some modulation on the final sample, make it more comfortable to audiences' ear.

and thanks again :>