Is there any equivalent to [poly] but for that support symbols?
I would like to route many osc messages list starting with a symbol names, not an ID... and having the same multichannel features and voice stealing.
-
[poly] for anything
-
@oid The tagging is working but It needs to send all messages once in order to work properly.
-
@60hz If I understood your needs correctly, it should be working? What is your input, what is your desired output and what do you get out?
-
@ben.wes said:
sequential_remessage.pd
I think this one is already nice because It works well for giving any input message starting with a name, a new ID to feed [clone].
my list is
Arene 0.2 1 0 0.5
Musee 0.2 1 0 0.4
...what is your desired output and what do you get out?
I am trying to add a [poly] behaviour to the tag ID object, so I have no more than N channel playing at same time with voice stealing.
But with @whale-av advice about using [switch~], I can load many abstractions in clone and activate only active ones. -
@60hz Ohh, I forgot to have it send out
voice# 0
for the stolen voice so it actually turns off the old voice? Is that the issue? Very simple to fix if that is the case, just a [$1 0( added in. If that is not the issue then we seem to be experiencing a failure in communication. Fixed that and updated the original post. -
Thanks @oid, I tried [spoly] but still dont't full y understood how it is working. Maybe I am not clear using english, but what I am searching to do is simply tagging the first 4 id depending on their leading symbol, and then keeping only 4 or more last active ones because I don't want to have too many active ID's.
-
@60hz Maybe? spoly3.pd This one keeps the symbols and just prepends the voice number. If that is not what you are looking for then tell me exactly what those 6 messages it prints out should be for the input in the screenshot.
Also fixed a bug, the note off bit still was not right.
Edit: noticed I forgot to connect a wire on that last update.
-
@60hz Realized my testing methodology was flawed and there was a bug which could cause it to fail, fixed that and had some time so cleaned it up and added the [clear( and {stop( messages, default value of 99 voices if run without arguments and an inlet for number of voices although that is done simple and brute force by stopping all voices and clearing memory first. Still not clear if you wanted the symbol to be replaced by the voice number or the voice number to be prepended though or if I am still missing what you are after. Updated in the original post.
-
Hey, this is fun!
My needs are slightly different in that I usually can't tell when a voice is going to become free to be allocated again, so I make it the voice's responsibility to tell me when it's available. Voices also have to figure out when to retrigger, which happens during voice stealing but also when commands are routed back to the voice that's currently handling a previous instance. Here's pseudo code for my allocator:
next command is issued has it already been assigned a voice? yes: send next command to that same voice no: are there free voices? yes: record that that command is being handled by that voice note the order that that voice was allocated send next command to that voice no: find the oldest allocated voice record that that command is being handled by that voice note the order that that voice was (re)allocated send next command to that voice when a voice becomes free add it back into the list of available voices clear whatever command it was previously associated with clear whatever order that it was last allocated
And then inside each voice:
next command comes in what state are we in? stopped: trigger the action, go to running state running: retrigger the action when the action is finished, go to stopped state and tell the allocator you are available
-
@jameslo said:
Hey, this is fun!
It is, spent the last few days reworking the massive abstraction I simplified the above from. Never even considered having the voice free itself when done, seems obvious now that you brought it up and easy to implement. Thanks for that one.
-
great @oid, it's working well now! (the one updated from https://forum.pdpatchrepo.info/topic/14537/poly-for-anything/16 because I think spoly3.pd was faulty)
Thanks also @jameslo for this very nice patch! It's more than I need but it is very useful.
I really think this kind of multipurpose abstraction should be shiped in puredata, along with [clone] to fullfill basic need and be consistent with Miller clone logic.