Hi, Max.

You could have a looper feeding into a variable delay line whose delay is modulated appropriately.

A looper would be an N-sample feedback loop with some input feeding into it, where the input gain and the feedback gain are mutually exclusive. That would prevent new elements from being added and you'd have the same recirculating material when you freeze it:

y[n] = Rx[n] + (1-R)y[n-N]

with R being 1 to write into it, or 0 to freeze it.

The output of the looper could then feed an N-sample delay line whose delay is offset consistently to always point to the same buffer position:

delay[n] = (lineN[n] + element[n]) % N

where

lineN[n] = (1[n-1] + lineN[n-1]) % N

and element[n] is an int between 0 and N - 1 determining the array element that is being output.

I don't have this in PD but here's the Faust implementation: 

https://faustide.grame.fr/?autorun=1&voices=0&name=lotkavolterra_A&inline=aW1wb3J0KCJzdGRmYXVzdC5saWIiKTsKc2l6ZSA9IG1hLlNSOyAvLyBhc3N1bWluZyBhIDk2IGtIeiBzYW1wbGUtcmF0ZQpyZWMgPSBjaGVja2JveCgiRnJlZXplIik7IC8vIGNoZWNrIHRvIGZyZWV6ZSwgdW5jaGVjayB0byBhZGQgbmV3IGVsZW1lbnRzCnBvc2l0aW9uID0gKGJhLnBlcmlvZChzaXplKSArIGhzbGlkZXIoImFycmF5IGVsZW1lbnQiLCAwLCAwLCA5NjAwMCwgMSkpICUgKHNpemUpOwpsb29wZXIoeCkgPSArKHggKiAoMSAtIHJlYykpCiAgICAgICAgICAgIH4gZGUuZGVsYXkoc2l6ZSAtIDEsIHNpemUgLSAxKSAqIHJlYzsgLy8gbGVuZ3RoIGlzIHNpemUgLSAxIGJlY2F1c2Ugb2YgdGhlIGltcGxpY2l0IG9uZS1zYW1wbGUgZGVsYXkgaW4gZmVlZGJhY2sgbG9vcHMKYXJyYXkocG9zKSA9IGRlLmRlbGF5KHNpemUsIHBvc2l0aW9uKTsKcHJvY2Vzcyh4KSA9IGFycmF5KHBvc2l0aW9uLCBsb29wZXIoeCkpOwo%3D

Ciao,
Dario


On Fri, 26 Feb 2021 at 14:03, Max <abonnements@revolwear.com> wrote:
Hi list,

I'm looking for concepts like a queue or arrayDeque in Pd.
Like a delay line which I can pause adding new elements into and it will
act like an array until I decide to add more. At audio rate.
Is there something simple that I have overlooked? What's the best
strategy to implement this?

M.



_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list