Forums > MaxMSP

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

August 17, 2012 | 2:13 pm

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…

Here’s my analysis code so far:

– Pasted Max Patch, click to expand. –

August 18, 2012 | 6:09 pm

Bumping with newer/better analysis code:

– Pasted Max Patch, click to expand. –

August 24, 2012 | 12:45 pm

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.


August 24, 2012 | 12:49 pm

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


August 24, 2012 | 1:20 pm

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


August 24, 2012 | 1:52 pm

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).


August 24, 2012 | 3:18 pm

uhm… maybe polybuffer~ could help…


August 24, 2012 | 3:42 pm

Indeed. So many objects I’ve not used….


August 24, 2012 | 3:53 pm

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)


Viewing 9 posts - 1 through 9 (of 9 total)