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
-
@60hz Can you not do that with [route Arene Musee dog cat ... etc.] and send the output... the list of floats where you wish from each outlet of route.
I don't know why you need to keep track of the symbol id's, but they could be added back to the float lists once they drop out of the route...... using [list prepend Arene] etc.
Then you can re-filter the data as you wish.Is this position data from fiducial markers?
David. -
I try to keep no more than 4 or 8 abstractions running at the same time, since they are quite cpu intensive...
Dynamic patching is too experimental to use I think and will add lot of click when create/disconnect etc... (I don"t think it's a good idea to run a dynamic instance of a sound generator on osc messages at all...)
I have something working now and used clones, but I gave up on voice stealing. So I have 24 version of my abstractions with sound generators running in parallel :/ I would prefer a way to have less instances since I think I won't activate more than 4 or 8 of them at once.
-
@60hz Maybe you could [fudiformat] the name and hash its encoding?
I suck at standard CS numeric algorithms, but you get the idea. Plus I'm confused whether you need to assign voices based on the leading symbol or the trailing 4 numbers.Edit: wait, you only need to keep track of 4 to 8 voices? Dang, just manage things in [text] using search and don't worry about it.
-
@60hz If the OSC messages are coherent (on a curve or a straight line) then you will get a good result with devoted sound generators, but if they are jittery (too much noise) then they will be less useful for sound generation.... or anything else for that matter.
Yes..... if you are wanting to swop out generators based on the data then you will need to keep them all all running and pan between their outputs or you will have clicks.
You could use [switch~] to turn their dsp processing on and off, and fade their output in and out with [line] and [* ~] before activating [switch~]....... and that will save you loads of cpu.
There are ways to smooth the data if needs be.
David. -
@jameslo said:
Edit: wait, you only need to keep track of 4 to 8 voices? Dang, just manage things in [text] using search and don't worry about it.
Thanks @jameslo Yes, that's exactly what I am doing now, I get an ID from my list of leading symbol and route it to [clone 24 generators ... ]. It is not the best since if there is an updated messafge later, my list will be obscolete but it works. I need to see how it behave tomorow with OSC messages running...because I am worried about the parsing, since I am doing some process after all that and the pd order of executions need to be perfect.
You could use [switch~] to turn their dsp processing on and off, and fade their output in and out with [line] and [* ~] before activating [switch~]....... and that will save you loads of cpu.
Oh yes, I forgot about it thanks @whale-av WIll try tomorrow !
-
Joining a bit late here. But this discussion just reminded me of two abstractions that I created in the last days. Maybe they might be relevant (otherwise sorry for the noise).
This one will change the leading symbol or number of an incoming message to a sequential number starting from 0:
sequential_remessage.pdThe other one I used to create consistent numbers from a symbol to generate colors for symbols (using the checksum as seed) - I tried to recreate the adler-32 checksum algorithm here (same approach as @jameslo mentioned above with the hash):
checksum.pd -
@60hz Voice stealing is not all that difficult to have. Here is 90% of [poly] reworked for symbols and those OSC messages of yours, would be simpler to build this around [poly] but I just simplified an abstraction I already have. The few things it lacks is the ability to turn voice stealing off, changing the number of voices on the fly and an all off, all of which are easy enough to add. Just fire it up with the desired number of voices as an argument. Oh, I also skipped having it bump voices up the list on retrigger/changes since I don't know how retrigger works in your patch and when or if a voice should be bumped up, on retrigger, or on certain changes, or all changes, simple enough to add as well.
spoly.pd
Edit, General clean up of messiness and fixed a bug. And I forgot that I changed the [outlet] to a print for testing, fixed. -
@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.