Cockos Incorporated Forums Add pan tapers to pan law selection (DONE)
 Register Track Bugs/Feature Requests Search Today's Posts Mark Forums Read

01-10-2010, 09:20 PM   #1
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664
Add pan tapers to pan law selection (DONE)

Tracker Issue: http://forum.cockos.com/project.php?issueid=1860
Sample implementation (JS): http://forum.cockos.com/attachment.p...2&d=1263391142
Sample implementation V2 (JS): http://forum.cockos.com/attachment.p...1&d=1274516421
Sample implementation VST (partially done): http://electric-snow.net/plugins.html (jsFader)

Mercado created a nice visualization of the problem:

Quote:
 Originally Posted by Mercado_Negro These are a couple of examples (-3dB): REAPER Native Panner: Sinusoidal Panner: As we can see the sinusoidal panner would give us a 'natural' and somehow 'expected' panning which is, imo, critical for mixing (I know most people don't care about middle points between hard left/right and center but this is important for some of us, at least, an option would be nice).
During the discussion in this thread, it became clear that Reaper uses a very odd pan taper. To bring it more in line with other DAWs I'd suggest adding a pan taper selection to the current pan law selection (as a second listbox. maybe the compensated/uncompensated could also be turned into a checkbox, which would halve the length of the pan law list -- and be slightly less confusing for beginners methinks).

The pan tapers would be:
Reaper (which should be the default, as this might otherwise break older projects / workflow for new projects)
Square-root
Sinusoidal

If you are about to complain, that both square-root and sinusoidal tapers are fixed to a -3 dB law, they can easily be extended as so:

P = Pan amount [0:1] (0 = left, 0.5 = center, 1 = right)
L = Pan law (reduction at center in dB, must be unequal 0dB. example -6dB => L = 6)

For square-root (or maybe it should be simply be called root, as it isn't necessarily a square root):

Ch1 = (1-P)^(L/6)
Ch2 = P^(L/6)

For -3 dB we get the standard square-root taper and for -6 dB a proper linear taper.

The sinusoidal law could be adapted in the same fashion:

Ch1 = sin(0.5*pi*(1-P))^(L/3)
Ch2 = sin(0.5*pi*P)^(L/3)

For -3 dB the result is a regular sin/cos taper, and for -6dB we get a squared sinusoidal taper.

Other tapers would be possible as well, such as piecewise linear which would approximate how actual potentiometers are built.

Last edited by l0calh05t; 12-02-2010 at 09:48 AM. Reason: link updated

 01-10-2010, 09:38 PM #2 Tallisman Human being with feelings     Join Date: Jan 2007 Location: in the middle of the icecube. Posts: 7,405 I think this is worthy of being put into the tracker. greetings .t __________________ .t _____________________________ http://jomei.bandcamp.com <--My Middle Son. http://tallisman.bandcamp.com <--Me. "Excuse me. Could you please point me in the direction of the self-help section?"
01-10-2010, 10:46 PM   #3
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by Tallisman I think this is worthy of being put into the tracker. greetings .t
Done. http://forum.cockos.com/project.php?issueid=1860

01-12-2010, 09:34 PM   #4
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Since this topic is not an easy concept, here are a few graphs to help out.

First, let's compare the 3 tapers using the classic -3dB law (constant power):

As you can see, unlike the two classic tapers, the reaper taper has a discontinuity. Furthermore the purpose of a -3dB law is generally to be a "constant power" law. But if you observe the lower right graph, this only applies to the reaper taper in 3 distinct points. The center and the two extremes.

Now, the -6dB law (constant amplitude):

In this case the reaper taper becomes continuous, but it's action is pronounced towards the extremes of the panning range. Which may, or may not be desired. All three tapers achieve a correct constant amplitude law (lower left).

Third and last, the -4.5dB law, which is designed to split the error between constant power and amplitude (for signals which are neither fully correlated nor uncorrelated):

For all three tapers, the error is now split between the linear and power summing. The reaper taper is discontinous as in the -3dB case, and shows a larger error than the other two in the power sum.

If there are any questions feel free to ask. If anyone wants a small VST (or JS, although I've never tried that) to compare these in practice, I think I could throw one together quickly.

EDIT: Added the gnuplot source for the plots
Attached Images
 pan3.0.jpg (41.5 KB, 10004 views) pan6.0.jpg (41.8 KB, 10206 views) pan4.5.jpg (42.4 KB, 9801 views)
Attached Files
 pantapers.plt.txt (1.4 KB, 382 views)

Last edited by l0calh05t; 01-12-2010 at 09:37 PM. Reason: New attachment

 01-13-2010, 04:56 AM #5 semiquaver Human being with feelings   Join Date: Jun 2008 Posts: 4,839 I know this sounds arcane but.... the OPs two suggested pan functions make perfect sense, are really standard, and should be implemented. the sin/cos should be called "constant power" the expontential should be called as such and should be the default the current default should be moved to the bottom and eventally moved out to a preference - "original Reaper Panning"
01-13-2010, 05:08 AM   #6
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by semiquaver I know this sounds arcane but.... the OPs two suggested pan functions make perfect sense, are really standard, and should be implemented. the sin/cos should be called "constant power" the expontential should be called as such and should be the default the current default should be moved to the bottom and eventally moved out to a preference - "original Reaper Panning"
In fact the exponential (maybe a misnomer as its a linear taper raised to a power - maybe it should just be called root taper as the exponent is generally <= 1) one is also constant power if the exponent is 0.5 (square root). Which is why I would call the sin/cos version sinusoidal.

And anyone who is in support of this feature, don't forget to vote for the associated issue :-)

 01-13-2010, 05:59 AM #7 airon Human being with feelings     Join Date: Aug 2006 Location: City Posts: 9,488 I certainly wouldn't mind testing these Pan tapers to see if they do a better job and deliver a more natural panning. __________________ Dialogue/FX Editor & Re-Recording Mixer Using Latch Preview "My ego comes pre-shrunk" - Randy Thom
01-13-2010, 07:05 AM   #8
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by airon I certainly wouldn't mind testing these Pan tapers to see if they do a better job and deliver a more natural panning.
As promised here's a JS implementation of all 3 pan laws for comparison (in fact, this is my first JS effect, yay :-P)
Attached Files
 JSPantest.zip (650 Bytes, 755 views)

 01-13-2010, 10:01 AM #9 semiquaver Human being with feelings   Join Date: Jun 2008 Posts: 4,839 I'm going to play as well - let us know what you find, Airon. ... back in the dark ages I recall swapping out the pan pots in our MCI console for sinusoidal equal power pots! - so much cheaper in software...
01-14-2010, 01:13 AM   #10
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by semiquaver ... back in the dark ages I recall swapping out the pan pots in our MCI console for sinusoidal equal power pots! - so much cheaper in software...
Yeah, not only cheaper, probably also quite a bit closer to perfect sinusoidal than those physical pots.

 01-16-2010, 02:38 AM #11 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 So, have you guys tested it? Personally I liked the sinusoidal one best. In any case, one small implementation note: Since sines and exponentials are fairly costly functions, it might be best to use a small lookup table. ~64 entries with linear interpolation should do without significant loss of panning quality. These could be precomputed at startup.
 01-16-2010, 02:56 AM #12 EricM Human being with feelings     Join Date: Jul 2009 Location: Ljubljana, Slovenia Posts: 3,800 Hey, a bit off topic but may I ask how did you make these measurements and put them into graphs (I mean specifically for this)? I'd like to know more on measuring/testing apps for DAWs and audio in general e
01-16-2010, 03:10 AM   #13
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by EricM Hey, a bit off topic but may I ask how did you make these measurements and put them into graphs (I mean specifically for this)? I'd like to know more on measuring/testing apps for DAWs and audio in general e
Well, in this case I didn't actually measure anything for the graphs. I used the equations directly to plot them (see the plt file attached to the corresponding posts). The plots were made with gnuplot (wgnuplot to be precise).

When measuring audio, you always need a reference. This can be a test tone, a sweep, white noise, pink noise etc. it really depends on what you want to measure. In any case, I would generate my references via Octave (or Matlab if you can afford it... or have a student version or so) and export it as a wav file (via the wavwrite function). Now you can apply this wav to whatever you are testing and record the output to another wav. You can then import the result into octave (wavread) and do your computations on that.

Simple example for the pan laws:
Open Octave
>input = ones(44100,1);
>wavwrite(input, 44100, 16, "blabla/input.wav");
Now you have a wav with one second of a DC level of 1.
Run a pan automation over it
Record output of the track to output.wav (only left or right channel)
Back in Octave
>plot(output);
Now you have a plot of reapers pan taper.

 01-16-2010, 03:28 AM #14 EricM Human being with feelings     Join Date: Jul 2009 Location: Ljubljana, Slovenia Posts: 3,800 Ah ok I though this was done in real time in order to directly compare the test signal to a modified one. Thank you for the informative post!
01-16-2010, 03:40 AM   #15
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by EricM Ah ok I though this was done in real time in order to directly compare the test signal to a modified one. Thank you for the informative post!
There are a few measurement VSTs and applications which do the measurements in real time, but unless you want to write one for individual measurements, the non-real time version is an adequate solution.

01-17-2010, 11:10 AM   #16
Mr. Data
Human being with feelings

Join Date: Sep 2008
Location: Location
Posts: 5,203

Quote:
 Originally Posted by l0calh05t So, have you guys tested it? Personally I liked the sinusoidal one best. In any case, one small implementation note: Since sines and exponentials are fairly costly functions, it might be best to use a small lookup table. ~64 entries with linear interpolation should do without significant loss of panning quality. These could be precomputed at startup.
Yes, this was a point I was worried about a bit when using e.g. pan envelopes on many tracks at the same time. But I'd propose to use a lookup table of 100 (mirrored) entries, 'cos it would represent the settings that you can achieve and see (when finetuning a fader with ctrl) and hence you'd have no rounding errors between what you see and what is really set.

-Data

01-17-2010, 11:22 AM   #17
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by Mr. Data Yes, this was a point I was worried about a bit when using e.g. pan envelopes on many tracks at the same time. But I'd propose to use a lookup table of 100 (mirrored) entries, 'cos it would represent the settings that you can achieve and see (when finetuning a fader with ctrl) and hence you'd have no rounding errors between what you see and what is really set. -Data
You can't simply mirror it at the center setting, maybe you meant one LUT used mirrored for the other channel (which I would do anyways)? In that case 201 entries (100%L to center to 100%R) entries would be needed.

In any case, you'd still want to use linear interpolation, because during automation the pan values can be in between these values.

Personally I don't think so many entries are truly necessary, but that should probably be evaluated empirically.

 01-17-2010, 12:54 PM #18 Mr. Data Human being with feelings     Join Date: Sep 2008 Location: Location Posts: 5,203 Yes, that's what I meant. 100 +1 for center. Anyway, I don't doubt the devs know the right way. -Data
 01-22-2010, 06:55 AM #19 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 Bump. Aren't there a few more people who'd like to have at least one correct pan taper?
 01-23-2010, 09:43 AM #20 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 Here's some general info on panning laws, and which laws and tapers are provided and used by a few _DAWs. http://www.harmony-central.com/artic.../panning_laws/
 02-01-2010, 10:43 AM #21 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 Bump. Are there really so few people who want a correct pan?
 02-01-2010, 01:16 PM #22 norbury brook Human being with feelings     Join Date: Mar 2007 Location: London UK Posts: 1,979 I want correct pan laws only just seen this post.The pan laws have always been a little 'strange'to me mainly because of the early mistakes i made having the default set to -3db like in my other DAW. Since realising I've kept everything at default 0 and used my ears,however i was aware something was a little 'different' so now you've cleared up why. MC
02-01-2010, 01:47 PM   #23
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by norbury brook I want correct pan laws only just seen this post.The pan laws have always been a little 'strange'to me mainly because of the early mistakes i made having the default set to -3db like in my other DAW. Since realising I've kept everything at default 0 and used my ears,however i was aware something was a little 'different' so now you've cleared up why. MC
Yes, I noticed that the way I pan in Reaper is different from how I used to do it in other DAWs and after seeing the pictures in the other thread (linked in the original post) I knew why. For static pans this is mainly a workflow issue, but when pans are automated Reaper's strange pan can be a bit of a problem (luckily I rarely need automated pans).

But I was initially expecting more responses, but I guess all the math in the first post scared most people away Although it's so simple...

 02-01-2010, 02:53 PM #24 JHughes Human being with feelings     Join Date: Aug 2007 Location: Too close to Charlotte, NC Posts: 3,132 I voted for it. One of the things I like to do is sweep a fill from one side to the other. Without an appropriate pan law I also have to automate volume which takes valuable time. __________________ You can only Reverse, Switch, Invert or Flip POLARITY, not "PHASE".
 02-01-2010, 05:47 PM #25 Mercado_Negro Moderator     Join Date: Aug 2007 Location: Caracas, Venezuela Posts: 8,046 I'd also like to see this added as an option. +1 (I voted for this since it appeared here ) __________________ Pressure is what turns coal into diamonds - Michael a.k.a. Runaway
02-04-2010, 09:58 AM   #26
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by Mercado_Negro I'd also like to see this added as an option. +1 (I voted for this since it appeared here )
Good to hear I'm not that alone, although 18 votes is still quite low imo... oh well.

The problem as a programmer and perfectionist, whenever I see mistakes like these I want to start "rolling my own", but then I'd never finish any tracks...

 02-04-2010, 02:23 PM #27 antiClick Human being with feelings     Join Date: Mar 2007 Location: Mediterrenean Sea Posts: 902 Definetly +1111111111 What about fader tappers? Do you like the action of the Reaper faders? And have you noted pans are not pans but balances? Some little but elemental basic things that should have been there since v0.99 thanks for posting this tracker __________________ http://estudi.canreco.com ProTools theme: http://forum.cockos.com/showthread.php?t=9422 Lighter theme: http://forum.cockos.com/showthread.p...653#post109653 Last edited by antiClick; 02-04-2010 at 02:29 PM.
02-04-2010, 02:58 PM   #28
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by antiClick Definetly +1111111111 What about fader tappers? Do you like the action of the Reaper faders? And have you noted pans are not pans but balances? Some little but elemental basic things that should have been there since v0.99 thanks for posting this tracker
the action of the faders can be a bit strange, yes, but the automation is linear as i would expect so this hasn't bothered me too much so far. about the pans being balances, the 0db "pan" definitely is, but due to the unclear definition of mono, stereo and bus tracks in reaper there's not much that can be done about this. and the other pans are plain wrong... but if you mean the lack of a true stereo pan (dual pan or pan+width), yes that would be nice to have too, but there's another tracker issue for that one iirc.

 02-04-2010, 04:24 PM #29 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 about those faders: I was just experimenting a little and the fader taper is most definitely also strange (but as mentioned, this does not affect drawn automation, unlike for pan). When you record the automation from the fader, there is a kind of "plateau" around 0dB which doesn't really belong there IMO.
02-04-2010, 06:46 PM   #30
antiClick
Human being with feelings

Join Date: Mar 2007
Location: Mediterrenean Sea
Posts: 902

Quote:
 Originally Posted by l0calh05t about those faders: I was just experimenting a little and the fader taper is most definitely also strange (but as mentioned, this does not affect drawn automation, unlike for pan). When you record the automation from the fader, there is a kind of "plateau" around 0dB which doesn't really belong there IMO.
thre is an option in preferences to adjust that "plateau".... it's just that
I cant find satisfactory numbers

02-05-2010, 02:04 AM   #31
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by antiClick thre is an option in preferences to adjust that "plateau".... it's just that I cant find satisfactory numbers
Yes, you can adjust the curvature of the function, but not the location of the plateau which is the problem, as it should be at the top end of the fader range, not somewhere in the middle.

02-05-2010, 05:22 AM   #32
antiClick
Human being with feelings

Join Date: Mar 2007
Location: Mediterrenean Sea
Posts: 902

Quote:
 Originally Posted by l0calh05t Yes, you can adjust the curvature of the function, but not the location of the plateau which is the problem, as it should be at the top end of the fader range, not somewhere in the middle.
Thanks so much for the valuable info. Is there an issue tracker for that?

02-05-2010, 05:30 AM   #33
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by antiClick Thanks so much for the valuable info. Is there an issue tracker for that?
Not that I know of. You could post one and a corresponding thread (you'd have my vote). BTW you can try setting the maximum of the fader range to +1 (for some reason reaper won't allow 0dB for whatever reason) and see if it behaves more naturally then (it does IMO, but obviously you loose the ability to boost volume)

02-05-2010, 10:51 AM   #34
antiClick
Human being with feelings

Join Date: Mar 2007
Location: Mediterrenean Sea
Posts: 902

Quote:
 Originally Posted by l0calh05t Not that I know of. You could post one and a corresponding thread (you'd have my vote).
found it!
http://forum.cockos.com/project.php?issueid=1736

02-05-2010, 10:56 AM   #35
l0calh05t
Human being with feelings

Join Date: Nov 2008
Posts: 664

Quote:
 Originally Posted by antiClick found it! Please vote http://forum.cockos.com/project.php?issueid=1736
Not exactly the same thing, no? We were talking about the faders, not the envelopes. So I think you need to do some writing yourself

 02-08-2010, 01:18 AM #36 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 Any mods out there: maybe posts #27-#35 could be moved over to http://forum.cockos.com/showthread.php?t=51408 ? If it's possible to move individual posts that is.
 03-02-2010, 09:09 PM #37 strunkdts Human being with feelings   Join Date: Jun 2009 Posts: 2,565 good bump, i didnt see this thread last time it was around. +1 from me too. Absolutely!
 04-05-2010, 11:36 PM #38 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 considering that the stereo panning request has been an elevated fr for some time now, wouldn't it be smart to take care of correct panning while panning is already being reworked?
 04-20-2010, 12:39 AM #39 l0calh05t Human being with feelings     Join Date: Nov 2008 Location: Darmstadt, Germany Posts: 664 since it's already been a while and nothing has happened about this truly basic problem: bump
04-20-2010, 05:35 AM   #40
AudioWonderland
Human being with feelings

Join Date: Jun 2009
Posts: 677

Quote:
 Originally Posted by semiquaver I know this sounds arcane but.... the OPs two suggested pan functions make perfect sense, are really standard, and should be implemented. the sin/cos should be called "constant power" the expontential should be called as such and should be the default the current default should be moved to the bottom and eventally moved out to a preference - "original Reaper Panning"
Why? So it can be like "other daws"? Whats there now works damn good for me. If I wanted what the other daws do I would use one ofthe other daws.

I am all for change for the better. I don't see it here. I just see change for the sake of being something else.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General Discussion     General Discussion (aka spam trap) REAPER Forums     REAPER General Discussion Forum     REAPER OS X Forum     REAPER Color Themes and Icon Sets     REAPER Q&A, Tips, Tricks and Howto     REAPER Compatibility     REAPER Bug Reports     REAPER Feature Requests     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     Dstruct's Casa De Nitpicks     Recording Technologies and Techniques     MIDI and other music/audio protocols     JSFX and ReaScript Discussion     REAPER Music/Collaboration Discussion     newbieland     REAPER Developer Forum     REAPER Pre-Release Discussion     REAPER lounge NINJAM Discussion     User Discussion     NINJAM Developer Discussion Cockos and Friends Software Discussion     WDL users forum     LICEcap Discussion     SnapEase Discussion     OSCII-bot forum     PathSync Discussion     Assniffer Discussion     TunnelVision Discussion     LanMon Discussion     Debris Discussion     Wifight Discussion     The Camel Farm     Stashbox & Shup

All times are GMT -7. The time now is 08:51 AM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top