is there a way to dynamically change the length of the delayline for delwrite~, or is there an alternative object? delwrite~ seems to occupy memory even when dsp is switched off. i have a patch with lots of delwrites and it eats a lot of resources. is there a way to allocate the memory space only when i really need it?
i know i could use dymanic object creation, but i'd like to avoid that because it seems a bit shaky.
any ideas?
-
Delwrite~ question
-
Well, reallocating memory isn't too efficient, and can lead to dropouts during the allocation. So the best overall solution is to just make sure your delay lines aren't too big. And with the gigs of RAM available on modern computers, it would take considerable effort to max out your memory with delay lines. You can get about 100 minutes of 32-bit audio in one gigabyte. Are you sure it's the problem?
Anyway, if you do want to dynamically change your delay buffer, you kind of have to make your own using tables. They're a little tricky, and there are several approaches. But the way I like to do it is to use [count~] to keep track of the write/read pointers, [poke~] to write to the table, and [tabread4~] to read from it. You have to take into account the guard points for [tabread4~], otherwise you'll end up with some aliasing when reading from the ends of the http://www.pdpatchrepo.info/hurleur/diy-delay.mmb.pd