poly~ send message to most recent voice
Sep 11 2015 | 8:18 am
I'm struggling (once more) with the poly~ object and it's built in voice management. Everytime I use it in a project I find a different solution which never satisfies me entirely so I guess it's time for some input.
Let's imagine having a sampler which is a note on/off sampler (no one shot). When a note is pressed on the keyboard, it chooses the corresponding buffer and provides some further information, flags like "follow velocity on/off", "gain", "output channel" etc. The information is provided from outside the poly~ and sent to a second poly~ inlet. The poly~ does it's voice allocation via "midinote" message and here the struggle begins. How do I provide the mentioned additional information through the second inlet to the correct voice? Messages sent to inlet 2 are always ending up in the first voice not the last one used, unless I specify it via "target xy" which is not possible since I don't know (do I, apart from the ID?) which voice this particular note is occupying. Another approach would be to do the voice allocation all by myself via "target". Then I would need to store every note and the target it was sent to in order to get the note-off message to the right voice which is not really satisfying as well.
What I'm currently doing as a workaround is using "forward" and "receive" objects combined with the #0 message to get each voices ID. So when a note is triggered the poly~ sends the corresponding voice ID out to the main patch where this information is fed into a "forward" object (inst_#0) to send the buffer/velocity/gain/... information to a receive object (inst_#0) in the poly~. In this way I make sure the information is send to the last note triggered. It works but still seems to be a complicated solution for a basically quite simple task.
Placing the list with the buffer/velocity/... information inside the poly~ is not an option since this sampler is only one amongst others. It all has to be controlled from one master list (a coll or maybe IRCAM's antescofo) and cannot be spread into several lists. This is usability reasons since I'm not the one who will be using the patch.
Am I missing something essential? How would you solve that problem?
thank you Dominik
P.S. I'm not quite sure if this thread should be labeled "beginner" of "advanced". I'm definitely no beginner but I have the feeling there is a very simple solution which I'm just not able to see.