I need to transfer data from one buffer array to another buffer array without audio clicks. How can I achieve this?
Thanks any advance!
Copying data from one buffer array to another buffer array
I need to transfer data from one buffer array to another buffer array without audio clicks. How can I achieve this?
Thanks any advance!
I was talking with @porres which made some initial tests about efficiency, and maxlib/arraycopy go bad in time.. And "array get" and "array set" go better. I'm using ofelia in the patch I'm working, so, it is an option.
Here the tests he made:
We can see array is in order of 10x faster than arraycopy. With better message management using his else library he managed to narrow that difference but it exist how we can see:
There is the possibility to use data structures, wich can be more efficient:
https://forum.pdpatchrepo.info/topic/12059/array-text-pointer/1
I put my ass on the chair and did my own tests. So I can see maxlib/arraycopy can be an out-of-the-box solution for my case. Here it go fast enough to won't produce clips. All other options produced it.
I don't understand why my tests go to different @porres tests.. Here the patch:
array_copy-test.pd
Thanks all responses!
@emviveros did you forget the [until]
stuff?
@seb-harmonik.ar woops... Yes.. forget!!!
Sorry about that! now make sense again... I will try to copy paste the data structure test as well...
For now array get/set are is making competitors eat dust!
Well... I've tested copying the entire large array and got different results (Windows 10, old laptop, Pd 0.51.4):
i'm using maxlib for the undo/redo function in my looper and it is fast enough, works perfectly, no artifacts at all
You can also try tabletool from timbreID. Its performance is comparable to (or sometimes better than) maxlib. But I don't know if there is a mac version of this external. There are also tabdump/tabset in zexy, but they seem to be about as efficient as vanilla get/set:
@artureczq thanks a lot for your tests!
It opened my eyes about performance variation against number of iterations we do.
Seems like maxlib/arraycopy have a special implementation for copy entire arrays.. It can be very useful! And in the other hand, if we need timbre classification TimbreID tabletool can be a excellent option to avoid overburden the patch with different externals libs.
Oops! Looks like something went wrong!