Poly~ instances individual pan

    Dec 16 2012 | 4:51 pm
    Hi there.
    I'm working on a Poly~ synth patch and I'm trying to have this elaborate panning system, where each poly voice gets its individual pan acordingly to haw many voices are playing at the time. And I wan't the panning to change if I release one voice, the remaining ones change their pan acordingly. My idea for panning scheme is. 1 voice: center 2 voices: one voice left .5 and one voice right .5 3 voices: one voice left .666 one voice center one voice right .666 4 voices: one voice left .75 one voice left .25 one voice right .25 one voice right .75 and so on.
    What I've managed to do, is monitor how many voices are active and wich ones. What I'm asking help for, is how to route the pan messages to the active voices. Because the active voices aren't neccesarely 1, 2, 3, 4, 5. It is also 2, 5, 8, 11 and how do I route the 4 voices pan message to these different instances?
    Thx so far. I wouldn't have gotten this far without this forum.
    Here is the Poly~ patch I'm working on:

    • Dec 16 2012 | 5:28 pm
      Could you also post the contents of "hzd_filter_synth_voice_spread", your [poly~] patch so we can see what you have set up inside so far? It's treated as a completely separate patch so it isn't included when you paste a compressed patch to the forum.
    • Dec 16 2012 | 10:40 pm
      Thanks for your interrest :)
      Here is the voice_spread patch.
    • Dec 16 2012 | 11:40 pm
      I changed the panning scheme, but the principle is the same, and my problem remains...
    • Dec 17 2012 | 5:49 pm
      you said they arent neccessarily 1,2,3,4. why not? couldnt oyu just organize the voicing like this?
    • Dec 17 2012 | 6:22 pm
      Well if I play a six voice chord, and release two voices these mught be voice 3 and 5 then voice 1, 2, 4 and 6 are playing and they need to panned like there are four voices. And if the release time is long and I play some sort of melody with chord the voices are al over the place.
      Not sure if I'm being clear enough...
    • Dec 17 2012 | 8:36 pm
      right, releasing some is another issue. however, i would try to have total control over voices in a patch outside the poly, it makes it much easier. alternatively try to make use of the busy messages and/or thispoly~ information about what and how many voices are playing.
    • Dec 17 2012 | 9:03 pm
      I have managed to have a count of active voices and idenfy what number these have. I'm looking for an elegant way of routing the pan message to the active voices. I imagine I could run through every voice every time the count changes. So the count triggers what the panning scheme is, and I somehow run through the voices. Voice 1 - on - gets pan message, voice 2 - off - move on to next, and so on
      I maybe to impatient, just need to spend more time with this.
      But thanks so far.
    • Dec 17 2012 | 10:44 pm
      this is how i'd do it-- get the busymap from your poly~ and then you can calculate how many voices are active and which ones they are:
    • Dec 18 2012 | 1:02 am
      Just what Terry did (busymap), but for any number of voices (yet another way):
    • Dec 18 2012 | 2:05 am
      ok, yes zl sub is better
    • Dec 18 2012 | 11:20 am
      This is beautiful...
    • Dec 21 2012 | 10:03 pm
      This is good. But I had to modify, how I was getting messages to all the targets. Had to send them through a "target 0, $1" message before the inlet. But works like a charm now. However, I am now trying to make it so, that when only one voice is playing it is panned centre. As is, it goes to the left. This should be easy though...
      Thx for now.
    • Dec 22 2012 | 1:15 am
      this should do it. Adding exception to an algorithm is not that obvious in Max. It feels like assembling a toy railroad set... :)
    • Dec 22 2012 | 3:23 am
      Nice. Neatly done.
      I managed with this one, where I just send a message 0.5 if the zl sum is 1. The target will be set by the previous message that state, there is one voice playing, target (something), pan 0.0. The target will then be set, and I then tell it to go from 0.0 to 0.5. Right? Works so far :)
      But yours looks more robust or correct.
    • Dec 23 2012 | 1:00 am
      You get exactly the same value from [zl sum] and the right outlet of [zl sub 1]. Everything is ok as long as your pan impl. is immune to receiving redundant messages.