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

Aug 17, 2012 at 2:13pm

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

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. –
#64009
Aug 18, 2012 at 6:09pm

Bumping with newer/better analysis code:

– Pasted Max Patch, click to expand. –
#230825
Aug 24, 2012 at 12:45pm

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.

#230826
Aug 24, 2012 at 12:49pm

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

#230827
Aug 24, 2012 at 1:20pm

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

#230828
Aug 24, 2012 at 1:52pm

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

#230829
Aug 24, 2012 at 3:18pm

uhm… maybe polybuffer~ could help…

#230830
Aug 24, 2012 at 3:42pm

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

#230831
Aug 24, 2012 at 3:53pm

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)

#230832

You must be logged in to reply to this topic.