Loading a folder of samples back to back into a single buffer?

Rodrigo's icon

I'm working on a 'from scratch' corpus-based concatenative synthesis patch and at the moment I'm working the analysis side. I'm using Alex Harker's descriptors/entrymatcher to do the heavy lifting and so far it's working ok. I'm analyzing a single file and writing that data to disk as well as producing low/high values for each parameter (for normalizing later on).

(my current code below)

The thing is that I need to manually make a single file from the files I want to analyze. It's not a massive pain as for testing purposes I'm using only a couple dozen files, but if I'm doing something in the hundreds of files, that's going to be super tedious to manually combine them.

So would I would like to do is to be able to select a folder (or single file) or drag file (or folder) and have all of the samples be placed in a single buffer 'end to end'. I can then write that big buffer to disk as well as analyze it etc...

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

Here's my analysis code so far:

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

Bumping with newer/better analysis code:

justin's icon

There was a 3rd party external called bufcopy~ but i think it's no longer compatible... You could also try this Java method with buf.Op, available here http://www.fredrikolofsson.com/pages/code-max.html - but I havent tried that so YMMV.

If you want to stay "native", you could copy the buffers with peek~ then perform the analysis. There might even be another way of doing this using Jitter matrices.

Rodrigo's icon

Would concatenating a super long buffer with peek~ jam the computer up?

andrea agostini's icon

I didn't try it, but [mxj buf.Op] might help you - have a look at the merge message in the help file.
hth
aa

Rodrigo's icon

I hadn't seen that before. Looks quite handy, although it requires the merging of actual buffers, so I'd need to be able to dynamically create a buffer per soundfile that I potentially want to use (could be over 1000).

andrea agostini's icon

uhm... maybe polybuffer~ could help...

Rodrigo's icon

Indeed. So many objects I've not used....

Rodrigo's icon

It looks like merge doesn't concat the files, it stacks them as different channels (merging 4 files just made a single, short 4 channel audio file)