Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Raphaël BOLLEN

On 03/24/2013 04:11 PM, Fons Adriaensen wrote:

On Sun, Mar 24, 2013 at 02:01:27PM +0100, Raphaël BOLLEN wrote:


With the patch I sent, you can leave input 1 un-connected cpu %
stays at ~2% but if you stream silence to it cpu % rises again to
~10%


There should be no difference between those two cases. This
means that the 'silence' you sent isn't really silence and
contains denormals, NaNs, or Infs.

Ciao,




Thanks for looking into this, I can't check for NaNs or Infs right now but I've tried with an output 
from JAAA and have the same result. Anyways the problem is solved with denormals protection as 
suggested by Herman.


Cheers

--
Raphaël.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Fons Adriaensen
On Sun, Mar 24, 2013 at 02:01:27PM +0100, Raphaël BOLLEN wrote:

> With the patch I sent, you can leave input 1 un-connected cpu %
> stays at ~2% but if you stream silence to it cpu % rises again to
> ~10%

There should be no difference between those two cases. This
means that the 'silence' you sent isn't really silence and
contains denormals, NaNs, or Infs.

Ciao,


-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Raphaël BOLLEN

On 03/24/2013 12:56 PM, Fons Adriaensen wrote:

On Sun, Mar 24, 2013 at 01:57:18AM +0100, Jörn Nettingsmeier wrote:


On 03/23/2013 06:05 PM, Raphaël BOLLEN wrote:


Awesome, however cpu usage is ~12% on my system when playing silence and
drops to ~2% with some audio going through.


smells like a denormals issue.


It sure does, but I can't reproduce it on my P4 based system which is
normally very picky about denormals - CPU load is around 2.5% all the
time. Also checked all parts of the code that could produce denormals:
the HP processing filters, the k-meter and c-meter DSP code, and the
volume controls. All have denormal protection.

* Is the CPU load you mention the one measured by Jack, or some other ?


measured by jack 0.121.0 as reported by QJackCtl on 64bits system


* Try to find out which controls affect the CPU load. E.g. what happens
when you have a signal but the volume is set to off etc.


As I said, without any input connected or only streaming silence to input 1, 
the cpu % rises by ~10%.
To summarize:

- no input connected: cpu rise 10%
- silence on input 1: cpu rise 10%
- audio (not silence) on input 1: no cpu rise
- silence on 1 ch of input 1, audio on the other channel: cpu rise by ~5%, same if you reverse the 
input channel


other inputs are not affected by this. They can be left un-connected or streamed with silence cpu % 
doesn't change.


With the patch I sent, you can leave input 1 un-connected cpu % stays at ~2% but if you stream 
silence to it cpu % rises again to ~10%


With the modifs suggested by Hermann, problem is gone.

Cheers

--
Raphaël.



Ciao,



___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Fons Adriaensen
On Sun, Mar 24, 2013 at 01:57:18AM +0100, Jörn Nettingsmeier wrote:

> On 03/23/2013 06:05 PM, Raphaël BOLLEN wrote:
>
> >Awesome, however cpu usage is ~12% on my system when playing silence and
> >drops to ~2% with some audio going through.
> 
> smells like a denormals issue.

It sure does, but I can't reproduce it on my P4 based system which is
normally very picky about denormals - CPU load is around 2.5% all the
time. Also checked all parts of the code that could produce denormals:
the HP processing filters, the k-meter and c-meter DSP code, and the
volume controls. All have denormal protection.

* Is the CPU load you mention the one measured by Jack, or some other ?
* Try to find out which controls affect the CPU load. E.g. what happens
when you have a signal but the volume is set to off etc.

Ciao,

-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Raphaël BOLLEN

On 03/24/2013 10:49 AM, hermann meyer wrote:

Am 24.03.2013 09:46, schrieb Raphaël BOLLEN:

Aargh, although only if the inputs are left un-connected, if you stream silence 
on input 1 cpu %
increase is back.

I use when ever possible SSE2 to avoid denormals, compile with  -msse2 
-mfpmath=sse
flags and implement as followed:

/ DENORMAL PROTECTION WITH SSE /

#ifdef __SSE__
/* On Intel set FZ (Flush to Zero) and DAZ (Denormals Are Zero)
flags to avoid costly denormals */
#ifdef __SSE3__
#include 
inline void AVOIDDENORMALS()
{
   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
   _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
}
#else
#include 
inline void AVOIDDENORMALS()
{
   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
}
#endif //__SSE3__

#else
inline void AVOIDDENORMALS() {}
#endif //__SSE__

//



now run once
AVOIDDENORMALS();

somewhere in init()

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev




It's working fine, nice

Thanks

--
Raphaël.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread hermann meyer

Am 24.03.2013 09:46, schrieb Raphaël BOLLEN:
Aargh, although only if the inputs are left un-connected, if you 
stream silence on input 1 cpu % increase is back. 
I use when ever possible SSE2 to avoid denormals, compile with  -msse2 
-mfpmath=sse

flags and implement as followed:

/ DENORMAL PROTECTION WITH SSE /

#ifdef __SSE__
/* On Intel set FZ (Flush to Zero) and DAZ (Denormals Are Zero)
   flags to avoid costly denormals */
#ifdef __SSE3__
#include 
inline void AVOIDDENORMALS()
{
  _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
}
#else
#include 
inline void AVOIDDENORMALS()
{
  _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
}
#endif //__SSE3__

#else
inline void AVOIDDENORMALS() {}
#endif //__SSE__

//


now run once
AVOIDDENORMALS();

somewhere in init()

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Raphaël BOLLEN

On 03/24/2013 09:06 AM, Raphaël BOLLEN wrote:

On 03/23/2013 06:05 PM, Raphaël BOLLEN wrote:

On 03/16/2013 07:23 PM, Fons Adriaensen wrote:

On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:

On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:



A lot of mixing consoles don't provide a mono switch, but it's usually
possible to work around it with sub groups. I still have to work out a
convenient method for mono checking in Ardour 3.



which means i need to write up a page or two for http://manual.ardour.org/


And which reminds me of an app I've been using for years but
never released.

Zita-mu1 is a simple Jack client used to organise stereo monitoring
during recording and mixing. More here:

and download from


Ciao,



Awesome, however cpu usage is ~12% on my system when playing silence and drops 
to ~2% with some
audio going through.


This patch solves the problem for me.
8><---


Aargh, although only if the inputs are left un-connected, if you stream silence on input 1 cpu % 
increase is back.


--
Raphaël
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-24 Thread Raphaël BOLLEN

On 03/23/2013 06:05 PM, Raphaël BOLLEN wrote:

On 03/16/2013 07:23 PM, Fons Adriaensen wrote:

On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:

On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:



A lot of mixing consoles don't provide a mono switch, but it's usually
possible to work around it with sub groups. I still have to work out a
convenient method for mono checking in Ardour 3.



which means i need to write up a page or two for http://manual.ardour.org/


And which reminds me of an app I've been using for years but
never released.

Zita-mu1 is a simple Jack client used to organise stereo monitoring
during recording and mixing. More here:

and download from


Ciao,



Awesome, however cpu usage is ~12% on my system when playing silence and drops 
to ~2% with some
audio going through.


This patch solves the problem for me.

--- /home/rapha/Downloads/kokkinizita/zita-mu1-0.2.0/source/jclient.cc.orig
+++ /home/rapha/Downloads/kokkinizita/zita-mu1-0.2.0/source/jclient.cc
@@ -207,38 +207,43 @@
 {
k = prepare (frames);

-   q0 = selout [0];
-   q1 = selout [1];
-   for (i = 0; i < 4; i++)
-   {   
-   m = _inpstat [i].state ();
-   if (m)
-   {
-   p0 = moninp [2 * i];
-   p1 = moninp [2 * i + 1];
-   if (m == DelayAct::ON)
-   {
-   for (j = 0; j < k; j++)
-   {
-   q0 [j] += p0 [j];
-   q1 [j] += p1 [j];
-   }
-   }
-   else
-   {
-   g = _ipg [i];
-   t = (m == DelayAct::UP) ? 1.0f : 0.0f;
-   d = (t - g) / _frcnt;
-   for (j = 0; j < k; j++)
-   {
-   g += d;
-   q0 [j] += g * p0 [j];
-   q1 [j] += g * p1 [j];
-   }
-   _ipg [i] = g;
-   }
-   }
-   }
+q0 = selout [0];
+q1 = selout [1];
+for (i = 0; i < 4; i++)
+{
+m = _inpstat [i].state ();
+p0 = moninp [2 * i];
+p1 = moninp [2 * i + 1];
+for (j = 0; j < k; j++)
+{
+p0[j] += 1e-20;
+p1[j] += 1e-20;
+}
+if (m)
+{
+if (m == DelayAct::ON)
+{
+for (j = 0; j < k; j++)
+{
+q0 [j] += p0 [j];
+q1 [j] += p1 [j];
+}
+}
+else
+{
+g = _ipg [i];
+t = (m == DelayAct::UP) ? 1.0f : 0.0f;
+d = (t - g) / _frcnt;
+for (j = 0; j < k; j++)
+{
+g += d;
+q0 [j] += g * p0 [j];
+q1 [j] += g * p1 [j];
+}
+_ipg [i] = g;
+}
+}
+}

_kmdsp [0].process (q0, k);
_kmdsp [1].process (q1, k);


Cheers

--
Raphaël.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-23 Thread Jörn Nettingsmeier

On 03/23/2013 06:05 PM, Raphaël BOLLEN wrote:

On 03/16/2013 07:23 PM, Fons Adriaensen wrote:

On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:

On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:



A lot of mixing consoles don't provide a mono switch, but it's usually
possible to work around it with sub groups. I still have to work out a
convenient method for mono checking in Ardour 3.



which means i need to write up a page or two for
http://manual.ardour.org/


And which reminds me of an app I've been using for years but
never released.

Zita-mu1 is a simple Jack client used to organise stereo monitoring
during recording and mixing. More here:


and download from



Ciao,



Awesome, however cpu usage is ~12% on my system when playing silence and
drops to ~2% with some audio going through.


smells like a denormals issue.


--
Jörn Nettingsmeier
Lortzingstr. 11, 45128 Essen, Tel. +49 177 7937487

Meister für Veranstaltungstechnik (Bühne/Studio)
Tonmeister VDT

http://stackingdwarves.net

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-23 Thread Raphaël BOLLEN

On 03/16/2013 07:23 PM, Fons Adriaensen wrote:

On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:

On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:



A lot of mixing consoles don't provide a mono switch, but it's usually
possible to work around it with sub groups. I still have to work out a
convenient method for mono checking in Ardour 3.



which means i need to write up a page or two for http://manual.ardour.org/


And which reminds me of an app I've been using for years but
never released.

Zita-mu1 is a simple Jack client used to organise stereo monitoring
during recording and mixing. More here:

and download from


Ciao,



Awesome, however cpu usage is ~12% on my system when playing silence and drops to ~2% with some 
audio going through.


Thanks

Cheers

--
Raphaël.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-17 Thread John Rigg
On Sat, Mar 16, 2013 at 06:23:09PM +, Fons Adriaensen wrote:
> Zita-mu1 is a simple Jack client used to organise stereo monitoring 
> during recording and mixing. More here: 
> 
> and download from
> 

Very useful, thanks.

John
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-17 Thread John Rigg
On Sun, Mar 17, 2013 at 06:54:18AM -0400, Paul Davis wrote:
> On Sun, Mar 17, 2013 at 5:17 AM, John Rigg  wrote:
> 
> > On Sat, Mar 16, 2013 at 03:47:12PM -0400, Ricardus Vincente wrote:
> > >  Doesn't A3 have a mono button on the new monitor section?
> >
> > Yes it does. I had (stupidly) switched off the monitor section and
> > forgotten about it. Thanks for the reminder.
> >
> > It appears to be impossible to add the monitor section to sessions that
> > were created without it, so it needs to be turned on in the config
> > before session creation IIUC.
> >
> 
> not so. Session -> Properties -> Monitoring.
> 
> you can add it and remove it to any given session.

Great, thanks. Another new A3 menu item discovered :-)

John
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-17 Thread Paul Davis
On Sun, Mar 17, 2013 at 5:17 AM, John Rigg  wrote:

> On Sat, Mar 16, 2013 at 03:47:12PM -0400, Ricardus Vincente wrote:
> > On 03/16/2013 09:25 AM, John Rigg wrote:
> >
> > > A lot of mixing consoles don't provide a mono switch, but it's usually
> > > possible to work around it with sub groups. I still have to work out a
> > > convenient method for mono checking in Ardour 3.
> >
> >  Doesn't A3 have a mono button on the new monitor section?
>
> Yes it does. I had (stupidly) switched off the monitor section and
> forgotten about it. Thanks for the reminder.
>
> It appears to be impossible to add the monitor section to sessions that
> were created without it, so it needs to be turned on in the config
> before session creation IIUC.
>

not so. Session -> Properties -> Monitoring.

you can add it and remove it to any given session.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-17 Thread John Rigg
On Sat, Mar 16, 2013 at 03:47:12PM -0400, Ricardus Vincente wrote:
> On 03/16/2013 09:25 AM, John Rigg wrote:
> 
> > A lot of mixing consoles don't provide a mono switch, but it's usually
> > possible to work around it with sub groups. I still have to work out a
> > convenient method for mono checking in Ardour 3.
> 
>  Doesn't A3 have a mono button on the new monitor section?

Yes it does. I had (stupidly) switched off the monitor section and
forgotten about it. Thanks for the reminder.

It appears to be impossible to add the monitor section to sessions that
were created without it, so it needs to be turned on in the config
before session creation IIUC.

John
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Fred Gleason
On Mar 16, 2013, at 06:16 46, Ralf Mardorf wrote:

> I don't know how they handle it today, in the past German radio station
> didn't play recordings with phase errors and they neither fixed it in
> any way to play it.

This is very much the way it is in the US today, where phasing errors (or even 
gross differences in average power between L and R channels) can play havoc 
with the MPX stereo encoding used on analog FM carriers.  If you want airplay 
there, your mix better be right!

Cheers!


|-|
| Frederick F. Gleason, Jr. |   Chief Developer   |
|   |   Paravel Systems   |
|-|
| "You see, wire telegraph is a kind of very, very long cat.  You pull|
| his tail in New York and his head is meowing in Los Angeles.  Do you|
| understand this?  And radio operates exactly the same way:  you send|
| signals here, they receive them there.  The only difference is that |
| there is no cat."   |
| |
|  -- Albert Einstein, upon being asked to describe radio |
|-|

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Ralf Mardorf
On Sat, 2013-03-16 at 18:23 +, Fons Adriaensen wrote:
> On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:
> > On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:
> > 
> > >
> > > A lot of mixing consoles don't provide a mono switch, but it's usually
> > > possible to work around it with sub groups. I still have to work out a
> > > convenient method for mono checking in Ardour 3.
> > >
> > 
> > which means i need to write up a page or two for http://manual.ardour.org/
> 
> And which reminds me of an app I've been using for years but
> never released.
> 
> Zita-mu1 is a simple Jack client used to organise stereo monitoring 
> during recording and mixing. More here: 
> 
> and download from
> 

It would be good if the buttons could be aligned to MIDI controllers, to
use it as a replacement for an expensive hardware device. Compliment, a
good application.

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Ricardus Vincente
On 03/16/2013 09:25 AM, John Rigg wrote:

> A lot of mixing consoles don't provide a mono switch, but it's usually
> possible to work around it with sub groups. I still have to work out a
> convenient method for mono checking in Ardour 3.

 Doesn't A3 have a mono button on the new monitor section?

(which I detach and never look at again, which is why I don't know for
sure!)

 Ricardus...
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Fons Adriaensen
On Sat, Mar 16, 2013 at 09:25:46AM -0400, Paul Davis wrote:
> On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:
> 
> >
> > A lot of mixing consoles don't provide a mono switch, but it's usually
> > possible to work around it with sub groups. I still have to work out a
> > convenient method for mono checking in Ardour 3.
> >
> 
> which means i need to write up a page or two for http://manual.ardour.org/

And which reminds me of an app I've been using for years but
never released.

Zita-mu1 is a simple Jack client used to organise stereo monitoring 
during recording and mixing. More here: 

and download from


Ciao,

-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Paul Davis
On Sat, Mar 16, 2013 at 9:25 AM, John Rigg  wrote:

>
> A lot of mixing consoles don't provide a mono switch, but it's usually
> possible to work around it with sub groups. I still have to work out a
> convenient method for mono checking in Ardour 3.
>

which means i need to write up a page or two for http://manual.ardour.org/
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread John Rigg
On Sat, Mar 16, 2013 at 11:16:46AM +0100, Ralf Mardorf wrote:
> On Sat, 2013-03-16 at 09:50 +, John Rigg wrote:
> > ... check for phase errors ... on hardware mixing consoles ...
> 
> I'm doing it too. Mono compatibility seems to be less important for the
> Linux community.

There's possibly a lack of awareness. Anyone who mixes sound as a job
(and wants to keep it) knows it's important to check in mono. Even if
it will only be played back in stereo a phase reversal on one side will
cancel low frequency centre-panned signals when listening between the
speakers.

Judging by the comments I hear from mastering engineers about dimwits
putting a phase reversed bass or kick drum in the mix and not noticing,
it isn't just a problem in the Linux audio community.

> My hardware mixing console doesn't provide a mono switch and since I
> won't mis-adjust the pan pots I rout it mono by subgroups.

A lot of mixing consoles don't provide a mono switch, but it's usually
possible to work around it with sub groups. I still have to work out a
convenient method for mono checking in Ardour 3.

John
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Ralf Mardorf
On Sat, 2013-03-16 at 11:16 +0100, Ralf Mardorf wrote:
> A mono switch is needed.

If possible with loudness compensation.

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread Ralf Mardorf
On Sat, 2013-03-16 at 09:50 +, John Rigg wrote:
> ... check for phase errors ... on hardware mixing consoles ...

I'm doing it too. Mono compatibility seems to be less important for the
Linux community. If I take a look at screenshots for TotalMix, it does
provide a mono switch, never noticed that for hdspmixer :(.

I don't know how they handle it today, in the past German radio station
didn't play recordings with phase errors and they neither fixed it in
any way to play it.

My hardware mixing console doesn't provide a mono switch and since I
won't mis-adjust the pan pots I rout it mono by subgroups.

What I want to point out is, that using pan pots isn't good, since you
will switch between the wanted panning and mono. A mono switch is
needed.

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-16 Thread John Rigg
Nobody has mentioned it yet but there is a good reason why it's
useful to have pan controls on each channel of a stereo bus: it
makes it easy to check for phase errors by panning both sides
to the middle to check in mono. I do this in Ardour 2 (and on hardware
mixing consoles) all the time. The end and middle detents on A2's
panners make this quick and easy.

John
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-15 Thread Tim E. Real
On March 14, 2013 11:42:41 AM you wrote:
> On 03/12/2013 08:08 PM, Tim E. Real wrote:
> > But having said that, yes I'm wondering about a true 'stereo pan' feature.
> > How would such a feature work?
> 
> there is no one true stereo pan.
> 
> a pan law for intensity stereo (i.e. a panned image or an XY coincident
> microphone pair) would increase one channel and decrease another such
> that the total energy remains constant. a cosine/sine law is usually
> used, because
> 
> cos^2 + sin^2 = 1

OK got it thanks, was wondering what curves to use.
Any easy way to obtain some of the other laws, like 4.5dB?

> 
> ardour3 attempts to do this, by allowing you to reduce the width (by
> introducing crosstalk), and then letting you move the compressed image
> left or right. sort of works, but only for pan-potted stuff.
> 
> a pan law for run-time stereo (i.e. spaced omnis) would have to use
> delays, leaving the original level intact.
> 
> the ardour3 panner gets this type of signal horribly wrong, because you
> _never_ want to introduce crosstalk in spaced omnis - instant
> comb-filtering hell.
> 
> for stereo techniques that incorporate both run-time and intensity, such
> as ORTF, NOS, EBS, you-name-it, you need different amounts of gain
> change _and_ delay.
> 
> that's why nobody wants to use a ready-made stereo balance control - it
> is almost guaranteed to do the wrong thing for the source material at hand.
> 
> best,
> 
> 
> jörn

I know what you guys mean about potentially disastrous results panning 
 stereo input material having already complex relationships between its 
 two channels. Probably no-one should try to pan that type of material 
 unless they know what they're doing or have a sophisticated panner. 
Try to take care of that stuff earlier on in the chain, hopefully where the 
 sources are mono, even then the relationship could be complex.

But my own use case is a much simpler desire: To position or blend two 
 completely independent L and R sources - I double track my guitars. 
So two resulting mono 'wave' tracks having mono strips both fed into 
 a stereo strip where a dual-instance shared-gui-controls mono distortion
 is placed in its plugin rack. The shared plugin controls are a major 
 convenience of the stereo strip - I want the same sound from each guitar.
Currently there's no way for me to adjust the positions of what comes out 
 of this stereo strip - which is still completely independent L/R material 
 stuck all they way to the left and right.

So I cleaned up some code, trashed some old stuff, readied the system
 for easily adding any new controllers, such as new panning controls.
After that, factor them into the mixing code. Then have some GUI fun.

So far so good, useful fixes even before proceeding, but...  should I? 

Question:
A3's modular panners make a lot of sense in light of these discussions -
 let the user pick the "right tool for the right job". 
Is there a suite of plugins, say LADSPA, that could do this for me?
Each plugin would arrange the four factors in different ways, like one
 would arrange it as basic four faders, another would have one fader and 
 two panners and balance, another maybe two faders and two panners,
 maybe add some sophistication like the delays and crossovers mentioned. 
Basically entire 'strips' all on their own. (Ironically MusE displays control 
 outputs as meters in our generic GUIs, so if 'level' outputs were provided, 
 these GUIs really would be cool complete alternative advanced 'strips'.)

Couldn't find any. If none exist, anyone up to the task? Useful for all DAW?

Thanks.
Tim.

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-14 Thread Paul Davis
On Thu, Mar 14, 2013 at 2:50 PM, Jörn Nettingsmeier <
netti...@stackingdwarves.net> wrote:

>
> the problem is, you usually have a mixture of the above. hence, no way to
> get the stereo panner right. unless the user knows exactly what s/he is
> doing, and then s/he doesn't really need a stereo panner :-D
>

Add New Track  -> (select stereo) -> Panner selector becomes sensitive ->
(select panner)

default would obviously do the least-bad thing.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-14 Thread Jörn Nettingsmeier

On 03/14/2013 12:37 PM, Paul Davis wrote:



On Thu, Mar 14, 2013 at 6:42 AM, Jörn Nettingsmeier
mailto:netti...@stackingdwarves.net>> wrote:

On 03/12/2013 08:08 PM, Tim E. Real wrote:

But having said that, yes I'm wondering about a true 'stereo
pan' feature.
How would such a feature work?


there is no one true stereo pan.

a pan law for intensity stereo (i.e. a panned image or an XY
coincident microphone pair) would increase one channel and decrease
another such that the total energy remains constant. a cosine/sine
law is usually used, because

cos^2 + sin^2 = 1

ardour3 attempts to do this, by allowing you to reduce the width (by
introducing crosstalk), and then letting you move the compressed
image left or right. sort of works, but only for pan-potted stuff.

a pan law for run-time stereo (i.e. spaced omnis) would have to use
delays, leaving the original level intact.

the ardour3 panner gets this type of signal horribly wrong, because
you _never_ want to introduce crosstalk in spaced omnis - instant
comb-filtering hell.

for stereo techniques that incorporate both run-time and intensity,
such as ORTF, NOS, EBS, you-name-it, you need different amounts of
gain change _and_ delay.

that's why nobody wants to use a ready-made stereo balance control -
it is almost guaranteed to do the wrong thing for the source
material at hand.


git add libs/panners/spaced_omni_panner
git commit
git push



point taken :)

the problem is, you usually have a mixture of the above. hence, no way 
to get the stereo panner right. unless the user knows exactly what s/he 
is doing, and then s/he doesn't really need a stereo panner :-D


btw, sorry for the pot shot at ardour specifically - in fact, most if 
not all DAWs get it wrong. iirc, some DAWs with a focus on classical 
(sequoia, pyramix) have some code to mogrify complex stereo, but i 
haven't used it.


my approach to complex stereo re-panning is: split the signal into two 
mono busses, add a delay, add eqs if you have to, move faders.
and while we're at it, the same approach works for processing in the MS 
domain. it's painful enough to only use it when you really need it, and 
hard enough to discourage casual users :)


for those who read german, here is a discussion we had about this in the 
VDT forum: http://www.tonmeister.de/forum/viewtopic.php?f=6&t=238&p=817



best,


jörn



--
Jörn Nettingsmeier
Lortzingstr. 11, 45128 Essen, Tel. +49 177 7937487

Meister für Veranstaltungstechnik (Bühne/Studio)
Tonmeister VDT

http://stackingdwarves.net

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-14 Thread Paul Davis
On Thu, Mar 14, 2013 at 6:42 AM, Jörn Nettingsmeier <
netti...@stackingdwarves.net> wrote:

> On 03/12/2013 08:08 PM, Tim E. Real wrote:
>
>  But having said that, yes I'm wondering about a true 'stereo pan' feature.
>> How would such a feature work?
>>
>
> there is no one true stereo pan.
>
> a pan law for intensity stereo (i.e. a panned image or an XY coincident
> microphone pair) would increase one channel and decrease another such that
> the total energy remains constant. a cosine/sine law is usually used,
> because
>
> cos^2 + sin^2 = 1
>
> ardour3 attempts to do this, by allowing you to reduce the width (by
> introducing crosstalk), and then letting you move the compressed image left
> or right. sort of works, but only for pan-potted stuff.
>
> a pan law for run-time stereo (i.e. spaced omnis) would have to use
> delays, leaving the original level intact.
>
> the ardour3 panner gets this type of signal horribly wrong, because you
> _never_ want to introduce crosstalk in spaced omnis - instant
> comb-filtering hell.
>
> for stereo techniques that incorporate both run-time and intensity, such
> as ORTF, NOS, EBS, you-name-it, you need different amounts of gain change
> _and_ delay.
>
> that's why nobody wants to use a ready-made stereo balance control - it is
> almost guaranteed to do the wrong thing for the source material at hand.
>

git add libs/panners/spaced_omni_panner
git commit
git push

:)
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-14 Thread Jörn Nettingsmeier

On 03/12/2013 08:08 PM, Tim E. Real wrote:


But having said that, yes I'm wondering about a true 'stereo pan' feature.
How would such a feature work?


there is no one true stereo pan.

a pan law for intensity stereo (i.e. a panned image or an XY coincident 
microphone pair) would increase one channel and decrease another such 
that the total energy remains constant. a cosine/sine law is usually 
used, because


cos^2 + sin^2 = 1

ardour3 attempts to do this, by allowing you to reduce the width (by 
introducing crosstalk), and then letting you move the compressed image 
left or right. sort of works, but only for pan-potted stuff.


a pan law for run-time stereo (i.e. spaced omnis) would have to use 
delays, leaving the original level intact.


the ardour3 panner gets this type of signal horribly wrong, because you 
_never_ want to introduce crosstalk in spaced omnis - instant 
comb-filtering hell.


for stereo techniques that incorporate both run-time and intensity, such 
as ORTF, NOS, EBS, you-name-it, you need different amounts of gain 
change _and_ delay.


that's why nobody wants to use a ready-made stereo balance control - it 
is almost guaranteed to do the wrong thing for the source material at hand.


best,


jörn

--
Jörn Nettingsmeier
Lortzingstr. 11, 45128 Essen, Tel. +49 177 7937487

Meister für Veranstaltungstechnik (Bühne/Studio)
Tonmeister VDT

http://stackingdwarves.net

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-13 Thread Paul Davis
On Wed, Mar 13, 2013 at 4:16 AM, Tim E. Real  wrote:

>
> Took me a while of staring at the 'Panning' picture on Ardour's features
>  page. There's the missing link -  the relative gain you mentioned - which
>  is the slider between the L and R icons.
> If I may refer to that little slider as 'balance'...
>
> I can see how the new panner would work for one channel strips too.
>

nope.

panners in A3 are modular, and loaded at runtime. a 1in/2out track or bus
uses a different panner than a 2in/2out bus.

all panners in A3 have access to 5 parameters, nominally titled: azimuth,
width, elevation, frontback, lfe. they can use as few or as many as they
want, and can interpret them as they choose.


>
> Very nice stuff, love the new usage of colours, shading and gradients.
>

thanks, I wish I did :)
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-13 Thread Tim E. Real
On March 12, 2013 09:22:39 PM Fons Adriaensen wrote:
> On Tue, Mar 12, 2013 at 04:24:49PM -0400, Tim E. Real wrote:
> > Interesting about the crossover bit.
> > Wow, I considered adding selectable pan laws but didn't realize
> > crossovers.
> 
> The rationale behind this is that at LF the L and R signals will add more
> or less in phase, while at HF the phases are random and what gets added is
> the power.
> 
> The mixer app I've been developing has only Ambisonic panning. If you
> want stereo, you use a first order horizontal only bus (3 channels),
> use the -45 to +45 degrees range of the panner, and decode to stereo
> in the master strip. Then it's that decoder that determines the relative
> center gain of the panner, and it's no problem to make it frequency
> dependent so you get -6 dB at LF and -3 dB at HF.
> 
> > I will look at having separate pan controls for each channel on one strip,
> > 
> >  as I'm reminded from talking to Paul that Ardour has this :)
> 
> A2 had this, but no way to change the relative gains of L and R.
> The full matrix from L,R to L',R' has four coefficients. One of
> those factors out as channel gain, so three remain. So a really
> universal stereo -> stereo 'panner' must have three independent
> controls.

Yeah, you're right. Four factors for a two channel strip. 
Either two faders and two pans, or one fader two pans and a balance.

Took me a while of staring at the 'Panning' picture on Ardour's features 
 page. There's the missing link -  the relative gain you mentioned - which 
 is the slider between the L and R icons. 
If I may refer to that little slider as 'balance'...

I can see how the new panner would work for one channel strips too.

Very nice stuff, love the new usage of colours, shading and gradients.

Hey Paul, Robert made an Ardour stylesheet for MusE. It's... uncanny!

Tim.

> 
> Ciao,
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Fons Adriaensen
On Tue, Mar 12, 2013 at 04:24:49PM -0400, Tim E. Real wrote:

> Interesting about the crossover bit. 
> Wow, I considered adding selectable pan laws but didn't realize crossovers. 

The rationale behind this is that at LF the L and R signals will add more 
or less in phase, while at HF the phases are random and what gets added is
the power.

The mixer app I've been developing has only Ambisonic panning. If you
want stereo, you use a first order horizontal only bus (3 channels),
use the -45 to +45 degrees range of the panner, and decode to stereo
in the master strip. Then it's that decoder that determines the relative
center gain of the panner, and it's no problem to make it frequency
dependent so you get -6 dB at LF and -3 dB at HF.
 
> I will look at having separate pan controls for each channel on one strip, 
>  as I'm reminded from talking to Paul that Ardour has this :)

A2 had this, but no way to change the relative gains of L and R.
The full matrix from L,R to L',R' has four coefficients. One of
those factors out as channel gain, so three remain. So a really
universal stereo -> stereo 'panner' must have three independent
controls.

Ciao,


-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Tim E. Real
On March 12, 2013 04:28:19 PM you wrote:




On Tue, Mar 12, 2013 at 4:24 PM, Tim E. Real  wrote:


I will look at having separate pan controls for each channel on one strip,
 as I'm reminded from talking to Paul that Ardour has this :)


not anymore ...



Oh wow, haven't tried A3 yet.

[Looks at, drools actually, the mixer on the new Ardour features web page...]

I see.
Now that's a smart looking mixer.

Tim.___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Paul Davis
On Tue, Mar 12, 2013 at 4:24 PM, Tim E. Real  wrote:

>
> I will look at having separate pan controls for each channel on one strip,
>  as I'm reminded from talking to Paul that Ardour has this :)
>

not anymore ...
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Tim E. Real
On March 12, 2013 09:56:15 AM Fons Adriaensen wrote:
> On Tue, Mar 12, 2013 at 01:23:02AM -0400, Tim E. Real wrote:
> > I noticed our app uses this pan formula:
> > vol_L = volume * (1.0 - pan);
> > vol_R = volume * (1.0 + pan);
> > 
> >  where volume is the fader value, pan is the pan knob value
> >  which ranges between -1.0 and 1.0, and vol_L and vol_R are the
> >  factors to be applied to the data when sending a mono signal
> >  to a stereo bus.
> > 
> > When pan is center, 100% of the signal is sent to L and R.
> > At pan extremities, the signal is boosted by 3dB.
> 
> 6 dB actually.

Sorry I thought the wiki pages were referring to power so
 I expressed it as power.

> 
> > But according to [1], we should be using a Pan Law [2],
> > 
> >  where pan center is around 3dB to 6dB down and pan
> >  extremities is full signal.
> 
> There are two independent issues involved here:
> 
> 1. The attenuation at the center w.r.t. to extreme L and R.
> 2. Whether the center or the extremes should be 0 dB.
> 
> (2) is very much a matter of taste and of virtually no practical
> consequence : you will adjust the fader (channel gain) to get
> the right balance anyway.
> 
> Regarding (1), if you take psycho-acoustics into account you'd
> want -6 dB at the center for low frequencies and -3 dB for high
> frequencies, with a gentle crossover at around 500 Hz or so.
> So the SSL compromise of -4.5 dB makes sense.
> Note that unless you use the panner to move a sound around
> during a mix, all of this hardly matters: you will adjust
> the balance anyway and compensate for whatever the panner
> is doing.
> 
> Returning to (2): for a panner (mono -> stereo) I'd prefer
> 0 dB at L and R. For a balance control (stereo -> stereo)
> I'd prefer 0 dB at the center position.

OK thanks. Makes sense to me. That obeys the pan rules.

Interesting about the crossover bit. 
Wow, I considered adding selectable pan laws but didn't realize crossovers. 

I will look at having separate pan controls for each channel on one strip, 
 as I'm reminded from talking to Paul that Ardour has this :)

Tim.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Tim E. Real
On March 12, 2013 03:13:44 PM you wrote:




On Tue, Mar 12, 2013 at 3:08 PM, Tim E. Real  wrote:

lance, but slightly different levels, but not a true 'stereo pan'.

But having said that, yes I'm wondering about a true 'stereo pan' feature.


first, terminology. just as when describing track or bus I/O configuration, 
"mono" and 'stereo" just doesn't really work very well. 

simpler to describe things in terms of number of inputs and number of outputs.

with 1 input to 1 output: no panning
1 input to 2 output: simple panning
2 inputs to 2 outputs:  

in this last case you have to consider the desired "width" of the signal, as 
well as possible phase relationships between the 2 inputs. in many scenarios 
it would be technically wrong to ever sent the "L" input to the "R" speaker 
and vice versa, but in others it may be ok. and the user might want it to be 
ok in every case.

etc.
 



Ah yes, I would lose separation 'width' when this 'stereo pan' would be 
 adjusted from center. Which may cause phasing problems. More to consider.
One option might be to give each channel its own pan and be done with it.

Cool that Ardour and NON have multi-channel strips and NON 'spatialization'. 
I painstakingly considered making all our strips multi-channel but decided
 against it due to complexity, so I only support multi-channel
 soft synthesizers, not the strips themselves which remain max 2 channels. 

Thanks.
Tim.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Tim E. Real
On March 12, 2013 03:08:18 PM Tim E. Real wrote:
> On March 12, 2013 08:41:01 PM you wrote:
> > On 03/12/2013 04:23 PM, Tim E. Real wrote:
> > > Hi, I need some advice, clear up some confusion:
> > > 
> > > I noticed our app uses this pan formula:
> > >   vol_L = volume * (1.0 - pan);
> > >   vol_R = volume * (1.0 + pan);
> > >   
> > >   where volume is the fader value, pan is the pan knob value
> > >   which ranges between -1.0 and 1.0, and vol_L and vol_R are the
> > >   factors to be applied to the data when sending a mono signal
> > >   to a stereo bus.
> > > 
> > > When pan is center, 100% of the signal is sent to L and R.
> > > At pan extremities, the signal is boosted by 3dB.
> > > 
> > > But according to [1], we should be using a Pan Law [2],
> > > 
> > >   where pan center is around 3dB to 6dB down and pan
> > >   extremities is full signal.
> > > 
> > > So I want to change how we mix mono -> stereo and use
> > > 
> > >   true Pan Law. I could add a Pan Law selector, seems like it
> > >   might be useful for various studio acoustics.
> > > 
> > > Then I noticed we use the same formula above to apply 'balance'
> > > 
> > >   (using the same pan knob) when sending a stereo signal to
> > >   a stereo bus.
> > > 
> > > But according to [3] we should be using a true balance control, not
> > > those
> > > 
> > >   same pan factors above. And according to [1]:
> > > "Note that mixers which have stereo input channels controlled by a
> > > single
> > > 
> > >   pan pot are in fact using the balance control architecture in those
> > >   channels, not pan control."
> > > 
> > > So I want to change how we mix stereo -> stereo and use true balance.
> > > 
> > > But then I checked some other apps to see what they do.
> > > In an unofficial test I noticed that QTractor seems to do the same
> > > thing,
> > > 
> > >   that is, when pan is adjusted on a stereo track, one meter goes up
> > >   while
> > >   the other goes down. RG seems not to have stereo meters and Ardour
> > >   I couldn't seem to make pan affect the meters, I will try some more.
> > > 
> > > My questions:
> > > 
> > > Is the pan formula above popular?
> > > 
> > > What is the consensus on stereo balance - use a Pan Law, being the
> > > 
> > >   formula above or otherwise, or use a true balance?
> > > 
> > > What should I do in the remaining case sending a stereo signal to a mono
> > > bus? If I am using a Pan Law as balance, the two signals will have
> > > already been>
> > > 
> > >   attenuated at pan center so I could simply sum the two channels
> > >   together.
> > > 
> > > But if instead I use true balance, at center the two signals are 100%.
> > > So should I attenuate the signals before summing them to a mono bus?
> > > Currently as our pan formula above shows, there would be no attenuation.
> > 
> > you are right - it should attenuate in the middle and gain increase as
> > you move. i hate balance controls because you can't move the image
> > around the panorama. if you have a stereo piano sample for example, you
> > need to move all the "sample data" around the sound stage - not hear an
> > amplified L channel and an attenuated R channel which is the balance
> > model. Balance is for home stereo's. Pan is for grown ups :)
> 
> OK just to be clear I was not implying that the given pan formula
>  would be used to do a true 'stereo pan', just that the formula would be
> used to adjust stereo 'balance' giving almost the same results as a true
> stereo balance, but slightly different levels, but not a true 'stereo pan'.
> 
> But having said that, yes I'm wondering about a true 'stereo pan' feature.
> How would such a feature work?
> I imagine that if for example if there is sound exclusively on the L
> channel, and 'stereo pan' is at center then moved all the way to the right,
> the sound that was exclusively on the L channel now moves to the exact
> center? That is, all the sound in the stereo field now moves 90 degrees to
> the right? It means you'd never be able to completely move an exclusive
> sound which was strictly on L, all the way to the right.

Ah, the answer might be an 'expanded' pan range of -180 to +180 degrees
 instead of the normal -90 to +90.
That way something all the way on L could be moved all the way to R.
Right?
Tim.

> 
> Does that sound correct Geoff?
> I can easily implement a true 'stereo pan', given some rules.
> Just, now I'd have to give the user the option of using either pan or
> balance, complicating things a wee bit more, but probably nothing an
> additional small pushbutton or two couldn't fix.
> 
> Thanks.
> Tim.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Paul Davis
On Tue, Mar 12, 2013 at 3:08 PM, Tim E. Real  wrote:

> lance, but slightly different levels, but not a true 'stereo pan'.
>
> But having said that, yes I'm wondering about a true 'stereo pan' feature.
>

first, terminology. just as when describing track or bus I/O configuration,
"mono" and 'stereo" just doesn't really work very well.

simpler to describe things in terms of number of inputs and number of
outputs.

with 1 input to 1 output: no panning
1 input to 2 output: simple panning
2 inputs to 2 outputs:  

in this last case you have to consider the desired "width" of the signal,
as well as possible phase relationships between the 2 inputs. in many
scenarios it would be technically wrong to ever sent the "L" input to the
"R" speaker and vice versa, but in others it may be ok. and the user might
want it to be ok in every case.

etc.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Tim E. Real
On March 12, 2013 08:41:01 PM you wrote:
> On 03/12/2013 04:23 PM, Tim E. Real wrote:
> > Hi, I need some advice, clear up some confusion:
> > 
> > I noticed our app uses this pan formula:
> > vol_L = volume * (1.0 - pan);
> > vol_R = volume * (1.0 + pan);
> > 
> >   where volume is the fader value, pan is the pan knob value
> >   which ranges between -1.0 and 1.0, and vol_L and vol_R are the
> >   factors to be applied to the data when sending a mono signal
> >   to a stereo bus.
> > 
> > When pan is center, 100% of the signal is sent to L and R.
> > At pan extremities, the signal is boosted by 3dB.
> > 
> > But according to [1], we should be using a Pan Law [2],
> > 
> >   where pan center is around 3dB to 6dB down and pan
> >   extremities is full signal.
> > 
> > So I want to change how we mix mono -> stereo and use
> > 
> >   true Pan Law. I could add a Pan Law selector, seems like it
> >   might be useful for various studio acoustics.
> > 
> > Then I noticed we use the same formula above to apply 'balance'
> > 
> >   (using the same pan knob) when sending a stereo signal to
> >   a stereo bus.
> > 
> > But according to [3] we should be using a true balance control, not those
> > 
> >   same pan factors above. And according to [1]:
> > "Note that mixers which have stereo input channels controlled by a single
> > 
> >   pan pot are in fact using the balance control architecture in those
> >   channels, not pan control."
> > 
> > So I want to change how we mix stereo -> stereo and use true balance.
> > 
> > But then I checked some other apps to see what they do.
> > In an unofficial test I noticed that QTractor seems to do the same thing,
> > 
> >   that is, when pan is adjusted on a stereo track, one meter goes up while
> >   the other goes down. RG seems not to have stereo meters and Ardour
> >   I couldn't seem to make pan affect the meters, I will try some more.
> > 
> > My questions:
> > 
> > Is the pan formula above popular?
> > 
> > What is the consensus on stereo balance - use a Pan Law, being the
> > 
> >   formula above or otherwise, or use a true balance?
> > 
> > What should I do in the remaining case sending a stereo signal to a mono
> > bus? If I am using a Pan Law as balance, the two signals will have
> > already been> 
> >   attenuated at pan center so I could simply sum the two channels
> >   together.
> > 
> > But if instead I use true balance, at center the two signals are 100%.
> > So should I attenuate the signals before summing them to a mono bus?
> > Currently as our pan formula above shows, there would be no attenuation.
> 
> you are right - it should attenuate in the middle and gain increase as
> you move. i hate balance controls because you can't move the image
> around the panorama. if you have a stereo piano sample for example, you
> need to move all the "sample data" around the sound stage - not hear an
> amplified L channel and an attenuated R channel which is the balance
> model. Balance is for home stereo's. Pan is for grown ups :)

OK just to be clear I was not implying that the given pan formula
 would be used to do a true 'stereo pan', just that the formula would be used
 to adjust stereo 'balance' giving almost the same results as a true stereo
 balance, but slightly different levels, but not a true 'stereo pan'.

But having said that, yes I'm wondering about a true 'stereo pan' feature.
How would such a feature work?
I imagine that if for example if there is sound exclusively on the L channel, 
 and 'stereo pan' is at center then moved all the way to the right, the sound 
 that was exclusively on the L channel now moves to the exact center?
That is, all the sound in the stereo field now moves 90 degrees to the right?
It means you'd never be able to completely move an exclusive sound 
 which was strictly on L, all the way to the right.

Does that sound correct Geoff? 
I can easily implement a true 'stereo pan', given some rules.
Just, now I'd have to give the user the option of using either pan or balance,
 complicating things a wee bit more, but probably nothing an additional 
 small pushbutton or two couldn't fix.

Thanks.
Tim.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Fons Adriaensen
On Tue, Mar 12, 2013 at 01:23:02AM -0400, Tim E. Real wrote:
 
> I noticed our app uses this pan formula:
> 
>   vol_L = volume * (1.0 - pan);
>   vol_R = volume * (1.0 + pan);
> 
>  where volume is the fader value, pan is the pan knob value
>  which ranges between -1.0 and 1.0, and vol_L and vol_R are the 
>  factors to be applied to the data when sending a mono signal 
>  to a stereo bus.
> 
> When pan is center, 100% of the signal is sent to L and R.
> At pan extremities, the signal is boosted by 3dB.

6 dB actually.

 
> But according to [1], we should be using a Pan Law [2],
>  where pan center is around 3dB to 6dB down and pan 
>  extremities is full signal.

There are two independent issues involved here:

1. The attenuation at the center w.r.t. to extreme L and R.
2. Whether the center or the extremes should be 0 dB.

(2) is very much a matter of taste and of virtually no practical
consequence : you will adjust the fader (channel gain) to get
the right balance anyway. 

Regarding (1), if you take psycho-acoustics into account you'd
want -6 dB at the center for low frequencies and -3 dB for high
frequencies, with a gentle crossover at around 500 Hz or so. 
So the SSL compromise of -4.5 dB makes sense.
Note that unless you use the panner to move a sound around 
during a mix, all of this hardly matters: you will adjust
the balance anyway and compensate for whatever the panner
is doing.

Returning to (2): for a panner (mono -> stereo) I'd prefer
0 dB at L and R. For a balance control (stereo -> stereo)
I'd prefer 0 dB at the center position. 


-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Mixing audio: Implementing pan and balance

2013-03-12 Thread Geoff Beasley

On 03/12/2013 04:23 PM, Tim E. Real wrote:

Hi, I need some advice, clear up some confusion:

I noticed our app uses this pan formula:

vol_L = volume * (1.0 - pan);
vol_R = volume * (1.0 + pan);

  where volume is the fader value, pan is the pan knob value
  which ranges between -1.0 and 1.0, and vol_L and vol_R are the
  factors to be applied to the data when sending a mono signal
  to a stereo bus.

When pan is center, 100% of the signal is sent to L and R.
At pan extremities, the signal is boosted by 3dB.

But according to [1], we should be using a Pan Law [2],
  where pan center is around 3dB to 6dB down and pan
  extremities is full signal.

So I want to change how we mix mono -> stereo and use
  true Pan Law. I could add a Pan Law selector, seems like it
  might be useful for various studio acoustics.

Then I noticed we use the same formula above to apply 'balance'
  (using the same pan knob) when sending a stereo signal to
  a stereo bus.

But according to [3] we should be using a true balance control, not those
  same pan factors above. And according to [1]:
"Note that mixers which have stereo input channels controlled by a single
  pan pot are in fact using the balance control architecture in those channels,
  not pan control."

So I want to change how we mix stereo -> stereo and use true balance.

But then I checked some other apps to see what they do.
In an unofficial test I noticed that QTractor seems to do the same thing,
  that is, when pan is adjusted on a stereo track, one meter goes up while
  the other goes down. RG seems not to have stereo meters and Ardour
  I couldn't seem to make pan affect the meters, I will try some more.
  
My questions:


Is the pan formula above popular?

What is the consensus on stereo balance - use a Pan Law, being the
  formula above or otherwise, or use a true balance?

What should I do in the remaining case sending a stereo signal to a mono bus?
If I am using a Pan Law as balance, the two signals will have already been
  attenuated at pan center so I could simply sum the two channels together.
But if instead I use true balance, at center the two signals are 100%.
So should I attenuate the signals before summing them to a mono bus?
Currently as our pan formula above shows, there would be no attenuation.

you are right - it should attenuate in the middle and gain increase as 
you move. i hate balance controls because you can't move the image 
around the panorama. if you have a stereo piano sample for example, you 
need to move all the "sample data" around the sound stage - not hear an 
amplified L channel and an attenuated R channel which is the balance 
model. Balance is for home stereo's. Pan is for grown ups :)


you're on the right track fior sure Tim

hth

g
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev