Circular panning in 8 channel
Hi everyone, I'm using Max for controlling an 8 channels panning, I made a circular movement using two oscillator (offset etc), and it all work good, but I have a problem with the loudness:
pitctslider is a square, my movement is a circle, it means that it will never reach the 4 angles, causing loudness differences.
I draw a little sketch for better comprehension.
Suggestion?
Thank you guys in advance, any help will be appreciate!
calculate the distance of the mouse/output to the center point of the control.
if it is bigger than half the controls size (the radius of the inside circle), reset any further output values to the last value which still matched inside and sent "set (thisvalue)" to your picture control or lcd or whatever that is.
now you have a circular field to move the mouse in.
forgot to add that you also need to calculate the angel to display things.
here is an old example. it can easily be optimized or modified for your needs. i sometimes use it as starting point for such "round GUI objects".
you will find that it has a little bug; it works best when the circle size is an odd number of pixels and all calculations are done in float.
-110
Thank you so much, for your reply, but I think it is not the solution I'm looking for.
If I can understand your patch, disable output when my path goes outside the circle. What I want is quite the opposite.
As you can see, if I move in circle in ptcslider I will never reach the angles, meaning that I'll loose some gain in the output, on the other hand, when my circle touch the right or left limits of the ptcslider, I'll have full gain, that it means different level on my loudspeaker.
In the image you can see what I mean:
when the purple dot, moving on the circle, reach the left border it means that have reach the max, so the output will be, for ex, 1
but when the dot is in the green position, it doesn't reach the max, so the output will not be 1, but
How can I have a linear circle movement with all the same value on the output?
thank you so much, but, If I understand correctly what you say it is not what I'm looking for.
I do not need a limiter, I need quite the opposite. See, in ptcslider if my trajectory reachs the purple point, my value is max, ex =1.
But when it reachs the green point, it is not at the max value, that means that I surely will not have 1, ex
Different values causes different amplitudes, and I'm looking for a solution that can output all same value.
I hope I can explain me correctly :)
split the GUI from the DSP and do the the audio stuff elsewhere.
except when your speakers are on the outline. then it is (n/pi) % 1. :)
how you need to control your audio depends on a lot of things... if that what is in your picture is you actual speaker setup then one of the third party spat externals will do it.
Have a look at poltocar and cartopol... That will do the calculations for you if you want to map radius to volume...
if that is really your speaker setup you´d need to split the arrangement up into 4 parts, and have different panning for L to R and for the sides with 4 speakers.
the vertical transition is easy, that is "normal" panning.
for 4 speakers in the line you will find various examples when searching the forums.
Thanks you very much guys, your answers are really really appreciate :)
Those are only drawings, the physical speaker setup doesn't affect the fact that I will not have same amplitude values.
My problem is that with this patch I can do whatever I want, (elliptical, circular, Pulsations from point to point) just changing some values in the oscillator combination.
At this point I think I have to replace all that stuff with something that work, do you have any suggestion?
I just want a linear loop from speaker 1 to 8, with the ability to change the velocity and the direction clockwise and counterclockwise.
Is that possibile? :)
And one last thing.. I'm sorry I'm asking you such things, but I'm not a Max Msp expert or particullary brillant in Math and Trigonometry, so, sorry if I can't understand your thinking or suggestions at full!
well you said you are producing this circular movement using 2 cos~ or something, this makes sense, but this doesnt change anything in the direction of problem solving methods.
now when you say you want to be free to do other movements, too, this makes things a bit more complicated, because you are going to convert a whole area to the parameters for each of the 8 speakers (which are gain, interpolation to the next on the left and to the right)
dont try to do this at all at once! brake it down into smaller problems.
best would be to post your patch or we can only guess wat you already have.
Here I post a simple patch with counter clock and counter clock wise trajectory. Open Traj.maxpatch and turn on the DAC, choose form the menu one movement and set the VELOCITY to 0.2, as you can see you have a perfect circle moving in the scope obj. Open the sub patch traiettoria 1, and see what is happening in the meter at the bottom of the patch. As you can see L1 L2 L7 and L8 have a nice smoothing amplitube, the others run quite good, but in the end they increase velocity and value really fast.
Hope this will help make my quenstions more specified and precise :)
Thanks again, I really appreciate your interest and help!
your patch looks very organized and clear but your approach is grmblfx.
i believe you got sidetracked when trying to build something which gives you the impression of "could work" because it gives you visual feedback of something which is "circular". :)
(assumed that the listener position is in the center of your speaker setup) you most likely do not need to code anything along circles here.
instead of your coordinate signal bins made of two cycle objects you could as well use a [phasor~] or a [line] and use a ramp from 0. to 1. to pan between the channels.
(and you probably know it, but: you could also save some 3000 scale objects by using *~ instead of the graphical gain sliders)
1. the transition between you channels can be calculated from their angle to theor neighbours
2. the weighting of each of the channels can be calculated by the distance to the listener.
to 1.:
you can almost tell these angles by heart: 4 of them are in 90 degree (0.25 of one "round") to each other, the others are having a distance of 30 degree (0.83333% of one round from 0. to 1.) to each other.
to 2.:
the weighting of the corners should be left at 1., the side speakers must probably be multiplicated with around 0.9 .
you are right here that we need trigonometry to find the relationship between the *distance of listener to corner speakers* versus *distance of listener to mid speakers*.
but you can also just use your ears and set a constant value.
(if you actually calculate the distances, then you can also implement a proper delay for it - the side speakers should be delayed for approx. 2,994 milliseconds per meter.)
Thanks you ROMAN THILENIUS your help is very appreciate (again) and I admire your intention to help me find a solution :)
Thanks for the nice words, but this patch is not made by me, it's a class project we've built with out teacher, and the reason behind all those scale obj and calc are is because we can have more trajectory than just the simple circle. In the "big patch" we have ellipses, counterclock wise ellipses, pulsation between speakers, vertical and horizontal movement, and other -+30 different movement, all with the same objects, and I think if you try to reproduce all of that, you find out you will need more calc than this :)
To be honest, I don't actually mind the position of the listener, things such reverb, delay, filter are other pieces of the "big patch", this is only a piace where I want a smooth linear transition between all the loudspeaker, even the physical configuration of the speaker doesn't matter (for this piece of patch), because all the controls for such a things are in other patch.
The patch I shared, is a semplification for keep things simple and clear.
I think that maybe there are some math errors in the p traiettoria 1 subpatch, scaling amp or the log ramp that the scale obj do..
At this moment I'm really looking for a simple method to do the movement as good as possibile, I'll now try to figure out somthing from your words, but at this moment I don't have too much time to spend on it :(
Doing some variation in the subpatch I' ve reached a good compromise, I've modified the scale at the bottom of the L5 channel to 0. 1. 0 106 - and in the top scale I've added 1.02 at the end - I added 1.06 at the scale obj after the abs. I've just tried it on a two channel system and it's seems quite good, not perfect, and I have to try it on an 8 ch system, but it's better than before :)
Maybe when I will have some time I'll try to make a good working patch, but other suggestion, patches, method or alternatives are always welcome :)
you really should tell your teacher that he needs to take care of the listener position, which is essential. :)
i dont see any errors in your subpatch, but i wonder why there are so many objects to do such a simple thing as a linear crossfade.
like i said there are several, strictly non academic approaches in the forum already.
for example 110.dekamix~
rotation, with interpolation and an option to control the brooadness of the source
https://cycling74.com/forums/rotate-in-4-speakers
for example 110.pan-4~
all-signal crossmixing based on lookup tables
for example 110.distribution~
https://cycling74.com/forums/rotate-in-4-speakers
the picture lower in the last thread is half a solution using messages.
Well, you asked for simple... I think this is what you are after, but it uses the nodes object instead of clever maths!
Thank you LUKE WOODBURY! I will check it out for sure! :)