Forums > MaxMSP

Unknown Amplitude Fluctuation in Stereo Panning Mixer

October 15, 2012 | 11:52 am

Dear All,

Just trying to make sure that my stereo panning mixer is made correctly.
Actually it works, but the thing is when the peak amplitude is at 0.707 i get a wierd fluctuation of
amplitude from cycle~. During my first test: say with the frequency at 440 hz, the sound is stable but then
in a short amount of time it sounds like there is an increase in amplitude, then a bit later it gets back to it’s
normal amplitude (i couldnt detect the variation via any meters). the annoying thing is that when i tested the patch
a second time there was no wierd fluctuation…was wondering if i’m missing out on something.

As a beginner level in Max i would very much appreciate the help.

All the best & cheers!


October 15, 2012 | 4:49 pm

This looks like a good, equal-power panner to me.


October 15, 2012 | 6:17 pm

hello mark,

thx very much for your feedback, it’s much appreciated!…so if you havent heard any irregular fluctuations
in amplitude then theres no reason for me to be paranoid about it, :) and it’s been a relief to get confirmation!

thx again, all the best & cheers!
PS: will be nice to check out your website, great stuff!


October 15, 2012 | 7:11 pm

wihout looking at your patch:
0.707 is the center position .. is there everything ok with
the phase, can it for example be that the left and the right
side have an offset of 1? so that when one channel is in
the centerposition the other one is one step off from the center?


October 15, 2012 | 7:35 pm

Minor point: there actually will be a minor fluctuation in your volumes. It may or may not matter for your purposes, but it’s going to happen because the line~ is transitioning linearly, even though the destinations are set with sqrt.

If you use a longer transition time, you’ll hear it. (Try going from 0 to 1 over 1000 ms)

Two ways of solving it: use sqrt~ on the output of line~ (you can just use one line~, and then invert its output with !-~ 1 and then sqrt~ for the other channel) or make a lookup table. You can read through a stereo buffer use wave~ with a 0-1 signal.

– Pasted Max Patch, click to expand. –
Attachments:
  1. StereoPanCurve.aif

October 17, 2012 | 8:05 pm

Hi Roman,
by offset of 1, do you mean a phase difference of 360?.
in regards to phase, that was one of the things i thought that might be the problem
after i heard the fluctuations, but i couldnt see how that could have happened since the
left and right side are processed equally in center position. however as Peter points out,
"there actually will be a minor fluctuation in your volumes, because the line~ is transitioning
linearly…


October 17, 2012 | 9:01 pm

Hi Peter,
thx much for your help!…the fluctuations seems to be gone after i used the sqrt on the output of line, but
then you get a click at the end of the each transition…how do you think i can get rid of the clicks?…as to the lookup
table, although i understand the logic, i couldnt get it to work out yet so i couldnt test it, will see what i
can do.

thx much again, cheers!


October 18, 2012 | 1:24 pm

You shouldn’t be getting clicks (with the one I posted), but if you post your patch, I’ll take a look.


October 18, 2012 | 10:08 pm

Hi Peter,
Your probably right because my revision of the patch maybe incorrect.
As to the clicks, it’s especially audible when you pan suddenly from hard right
to hard left and vice versa and also when you suddenly pan from right or left to center.
In any case i think i’m missing something, so i really appreciate that you’ll take
a look at it…by the way do you think the fluctuations are gone for good?

hope to talk soon, all the best & cheers!


October 18, 2012 | 10:37 pm

This is correct; it’s an equal power pan curve. You’re changing the volume rapidly (100 ms) which is usually going to introduce some sort of artifact if it’s extreme. (and going from hard left to hard right over 100 ms will be extreme)

Sudden changes usually produce artifacts in digital audio. There’s ways of compensating for some of them (e.g. antialiasing measures in oscillators).


October 21, 2012 | 8:45 am

i’m aware of what your saying, i’m only hoping to attain a simple panner like the one in
"ableton live" where sudden shifts dont introduce clicks, but the good thing is the learning process,
so any objects/externals/abstractions for "antialiasing measures in oscillators"?

PS: even if i change the pan with a 1000ms ramp it still clicks at the end, so that was my actual concern.

have good sunday, cheers!


October 21, 2012 | 11:05 am

I don’t get clicks with the last patch you posted, and you absolutely shouldn’t be getting them with a ramp of 1000 ms!

Is this the entire patch? (and is the panner constrained to 0-1 for its input?)

These have pretty useful explanations of many current approaches, though they’re not for the faint-hearted of math:
http://www.cs.washington.edu/education/courses/cse490s/11au/Readings/Digital_Sound_Generation_1.pdf

http://www.cs.washington.edu/education/courses/cse490s/11au/Readings/Digital_Sound_Generation_2.pdf


October 21, 2012 | 6:45 pm

the last one i posted was the revised version: single line~ to √~.
the one i posted now includes the clip~ which doesnt make any difference(hope it’s correct).

ex: when i ramp from hard L to hard R or vice versa you get the click at the end of each
ramp and like a said it doesnt matter if i constrain the panner via clip~.

…the patch will be the abstraction, "panner" for my stereo mixer.

by the way i found the user that i’d lost track of whose the maker of an 8-Channel Mixer.
I learned the panning algorithm from his patch: http://cycling74.com/toolbox/8-channel-mixer/.

as to the links thx very much, i’m not a math guy, but i’ve just started working trying to understand
the FFT which i’m especially interested in but i’ve yet to study the nature of imaginary numbers and how
singals are represented mathematically. will be getting back to fft after i finish the stereo mixer i’m working on.

cheers to the big apple from izmir-tr!


October 22, 2012 | 2:23 am

Can you post a recording? I can’t duplicate this. (Mac/Windows? Max 5/6? and which version? (e.g. 6.0.7))


November 10, 2012 | 6:35 pm

Hi Peter,
Sorry for my late response, my schedule with school and my projects has really intensified in
the past couple of weeks so i didnt have the chance to respond/record…i’ll post a recording as soon
as i can…as to my Max version: 6.0.5 with Mac.

Cheers, and have a good weekend!…by the way hope you werent effected by the hurricane,
and hope everythings getting better down there.


November 10, 2012 | 8:22 pm

by "offset of 1" i was thinking about an integer number coming from a GUI object – a frequent source of such errors.


December 1, 2012 | 9:46 am

Hi Peter,

Sorry for the long delay, i posted the recording. As i’ve said the clicks are heard at
the end of each ramp at the opposite channel (so if i pan from hard left to hard right,
the click is heard from the L-channel). The ramp is set to 1000 ms.

DL: https://dl.dropbox.com/u/36325883/pantest.wav

all the best, cheers!


December 1, 2012 | 9:55 am

Hi Roman,

could you please give an example because i dont understand what you mean by,
"an integer number coming from a GUI object", how would it create such errors?

all the best & cheers!


January 10, 2013 | 9:53 pm

Just an FYI.

A strictly accurate equal power curve is 6 dB down in the center and that’s what you have here. Most pro consoles use 3 dB down (Neve and most) or 4.5 dB down (SSL) in the center since two speakers in an acoustic space tend to sum roughly to +3dB instead of the electronic +6dB. (if they sum at all)

If you pan something and leave it there, this makes little difference. If your stereo pair is also used in mono, some instruments may balance differently than you expect. Most people will not notice, but if you have worked on pro gear for a long time, it will feel different.


Viewing 19 posts - 1 through 19 (of 19 total)