The Panning plug-in (updated January 10, 2006, last modified: Feb 2008) (R.I.P. David Sky) defines the control value as an “int”, so it’s either fully-left or fully-right. The control should be a “float” or a “real” - someone with more knowledge than I can decide which. I made it a float, and It Works For Me.
In all honesty, I rarely use this plug-in, because it converts Stereo to Mono, then pans that, but I greatly prefer to keep the original stereo signal. This time, though, I started with a mono signal…
That link goes to the “old” Audacity stuff (http://old.audacityteam.org/nyquist/pan.ny) which has been retained purely as a historical archive. I’m not able to modify anything on that site as it is “frozen in history” (it’s “read only”).
As it is a “version 1” plug-in, it would be correct to change “int” to “real”, but as we are updating it, then we may as well update it to “version 4”, in which case the correct syntax is “float”.
If we’re “updating” the plug-in, then I think we need to retain it’s original functionality, but we could add an option that retains the original stereo signal. There’s a number of different ways that could be done. Each “choice” needs a name.
Perfect, for both actions! As soon as I saw “old” in the link name, I knew it would take something other than just updating in-place.
You’re right about multiple-choice panning options - I saw one method (possibly from you, but I forget) which preserved overall-equal power by reducing the input by 3dB. While it’s well-intentioned, I’m pretty sure I’d never use that approach. I’m going to be experimenting later, but I think what I’m looking for is reducing the panned-away side of the stereo signal, and adding that “reduced” signal to the other side. Obviously, that risks clipping on the panned-to side…
My first choice would be the “obvious” one - do what the Pan control (on the Track Control Panel) does. I’ve never looked into exactly what that does, but I’m guessing it reduces the panned-away side, leaving the panned-to side untouched. It’s been fine for my (limited) needs in the past.
I think the disadvantage of this approach for stereo tracks, is that it isn’t actually “panning”, it’s just adjusting the amount of left and right channels (sometimes referred to as “balance”). The term “panning” in a strict sense refers to the left/right positioning of sounds in the stereo image.
Here’s some code that I think should do “real” stereo panning. It can be run in the Nyquist Prompt.
Please try this plug-in and say if you find any problems, or can suggest any improvements: panning.ny (2.16 KB)
“Pan mono” is similar to the original ‘Panning’ plug-in effect
in that it mixes the track to mono, and then pans the mono sound.
Unlike the original ‘Panning’ effect, which had a tendency to clip,
this implementation ensures overall unity gain.
“Pan Stereo” is ‘true stereo’ panning. When panning to the right, a
portion of the left channel is moved to the right channel, and the right
channel is scaled for overall unity gain. Panning to the left is achieved
in like fashion.