Old 01-27-2015, 10:30 AM   #1
jsd1982
Human being with feelings
 
Join Date: Apr 2014
Posts: 21
Default Free auto-pan effect for stereo guitars!

I wrote my own effect for processing stereo guitar tracks to automate pan moves based on stereo width of the incoming signals.

It's a little hard to explain in a one-liner, but basically it monitors the stereo width of the incoming stereo guitar sound (e.g. direct from a stereo effects unit or an Axe-Fx or similar) and adjusts the panning of the inputs from a configurable starting position to a configurable ending position for each channel when the width crosses a certain threshold. A simple attack/sustain/release envelope controls how the panning is interpolated between the starting and ending positions. The open and close thresholds as well as attack/release times are configurable as sliders.

I use it for my band's rehearsals. We rehearse via headphones with all inputs mixed in software. Both our guitars are direct in and make no noise in the room. Same with bass. The only things making noise in the room are the drum kit and the singer so it makes it easy to mix in software and pump through headphones.

The way I use this effect is to move a guitar part from either the left or right channel into a stereo sound half-way towards the center depending on the incoming stereo depth. The incoming stereo depth change is just a trigger for when a guitar lead is played with lots of stereo effects enabled, e.g. a ping-pong stereo delay, or stereo flangers or choruses. The guitar widens out so you hear the width when it is introduced and then collapses back into mono and pans back to where it started when the lead part is over.

https://github.com/JamesDunne/Reaper...o-pan-width.js
File is also attached to this post.

Thanks!
Attached Files
File Type: txt auto-pan-width.js.txt (2.7 KB, 161 views)
jsd1982 is offline   Reply With Quote
Old 01-27-2015, 02:43 PM   #2
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

That sounds pretty cool. I like automated panning. Actually, I like automated anything. I'm super lazy.
IXix is offline   Reply With Quote
Old 01-28-2015, 11:50 AM   #3
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

I would suggest changing these lines.

Code:
s0=spl0; s1=spl1;

// Find RMS of difference of L/R:
diff=s0-s1;
If spl1 is negative and spl0 is positive then the difference will be exaggerated. Instead, perhaps something more like this...

Code:
s0 = abs(spl0); s1 = abs(spl1);
diff = max(spl0,spl1) - min(spl0,spl1);
SaulT is offline   Reply With Quote
Old 02-02-2015, 06:17 PM   #4
jsd1982
Human being with feelings
 
Join Date: Apr 2014
Posts: 21
Default

Thanks! I think I'll keep it the way it is though. I'm not interested in exact sample differences, which is why I've got the averaging window over it (a small trick I picked up from another JS effect that measures RMS levels in dB).

I was going for mid-side processing and wanted to use the amplitude of the side channel to trigger on. Basic mid-side conversion from stereo is:

mid = left + right;
side = left - right;

Since I don't need the mid channel for my effect I didn't bother to calculate it. I think the left - right order is arbitrary here but it's standard convention. It only matters if you have to combine M/S back into L/R which I'm not doing.
jsd1982 is offline   Reply With Quote
Old 02-03-2015, 12:38 AM   #5
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Makes sense if you're doing mid-side, that makes sense. Compare mid vs side, etc.

I would suggest a more encapsulated version of the RMS function, though. I just added an RMS function to the JS Snippets sticky.

http://forum.cockos.com/showthread.p...52#post1472152
SaulT is offline   Reply With Quote
Old 02-03-2015, 10:43 AM   #6
jsd1982
Human being with feelings
 
Join Date: Apr 2014
Posts: 21
Default

Nice! I wasn't aware JS had instance support. Gotta read the docs more carefully I guess . I also went through the RMS algorithm I had to make sure it was logically the same as your JS snippet. Good thing it is.

My latest version https://github.com/JamesDunne/Reaper...o-pan-width.js includes a conditional gain boost to make up for any perceived loss in volume, or as an effect to boost the lead part louder if it isn't already.
jsd1982 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump


All times are GMT -7. The time now is 04:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.