Append wav-files to buffer~
Is it possible to append a .wav-file to a buffer~, so that the current content in the buffer~ is unchanged, but the buffer~ is enlarged by the length of the new file, which is added in this expansion?
I've searched both the docs and the forum, but can't seem to find any solution...
have a look at [mxj buf.Op]. maybe by merging buffers you can achieve what you need? otherwise there is always peek~ and poke~
modified to make the function "append"
If I may resurrect this thread as I am trying to do something similar to no avail.
I would like to have a buffer (A) from which I can crop certain segments of sound (and later on, save the cropped segment). I would like this to be 'circular' such that I would be able to take audio from the end of the buffer and append to it some audio from the start of the same buffer e.g. take the last 1000 ms of the buffer and stitch on the beginning 500 ms, and then be able to save the resulting 1500 ms duration file.
The approach I have taken in my patch is to take two separate cropped sections of the original buffer A (some audio towards the end and some towards the start) and put those in buffers B and C. Then I try to append the contents of buffer C to buffer B.
However this doesn't really seem to work the way I would like/expect (no change occurs to buffer B after I try to append). I suspect that there is some gap in my understanding of how buffers work amongst other things - and perhaps there is an easy way to do this. Can anyone help?
In case it helps anyone else, I solved the question I had above. What I didn't realise before was that the buffer size was simply not big enough to accommodate the extra samples that I wanted to append.
To resolve this I added a new buffer, whose size is determined by the size of the two cropped portions.
Of course, if there is a more efficient way to do this using the basic max objects I would be happy to hear - but I'm quite happy with the way this works now.