Invert a stereo channel and remix

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Invert a stereo channel and remix

Beinan Li
Hi,

I'm having difficulty implementing a vocal-cut utility using SoX by remix two stereo channels with one of them inverted first.
This can be done with an GUI audio utility like Audacity but requires at least a few interactions. I want to 
have a one-click tool. So I've tried SoX for this with the following method:

# 1. Split the channels of an input file: in.wav
sox in.wav in_left.wav remix 1 sox in.wav in_right.wav remix 2

# 2. Invert the right channel.

sox -v -1 in_right.wav in_right_inv.wav

# 3. Remix channels

sox in_left.wav in_right_inv.wav --channels 2 --combine merge out.wav



However, the result out.wav still has the vocal part intact. The same file has been tested under Audacity
and the method itself works. I've also tested the the products of Step2 by importing the two mono into
Audacity and played them together. That also worked.

Something seems to be wrong in my remix step. Could anyone shed some lights?

Thanks!



------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Jan Stary
On Aug 08 05:47:43, [hidden email] wrote:

> Hi,
>
> I'm having difficulty implementing a vocal-cut utility using SoX by remix
> two stereo channels with one of them inverted first.
> This can be done with an GUI audio utility like Audacity but requires at
> least a few interactions. I want to
> have a one-click tool. So I've tried SoX for this with the following method:
>
> # 1. Split the channels of an input file: in.wav
> sox in.wav in_left.wav remix 1 sox in.wav in_right.wav remix 2
>
> # 2. Invert the right channel.
>
> sox -v -1 in_right.wav in_right_inv.wav
>
> # 3. Remix channels
>
> sox in_left.wav in_right_inv.wav --channels 2 --combine merge out.wav

This whould be written more easily as
sox -M in_left.wav in_right_inv.wav out.wav

Are you sure you are merging in_right_inv.wav
and not the orignial right by accident?

If the original in.wav is small enough,
can you post it somewhere so we can try it?


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Mew, Peter
Hi
On a similar note
If I have 2 identical files, except that one has a couple of seconds of
hiss (or other program) on the front,
Is it possible to "line up" the 2 files so that the audio is in sync,
sample accurate, so that one can be inverted against the other to
produce a zero output
In other words, does sox have function that will correlate 2 files
exactly

Thanks for any ideas

-pm

-----Original Message-----
From: Jan Stary [mailto:[hidden email]]
Sent: Thu 08 Aug 2013 11:33
To: [hidden email]
Subject: Re: [SoX-users] Invert a stereo channel and remix

On Aug 08 05:47:43, [hidden email] wrote:

> Hi,
>
> I'm having difficulty implementing a vocal-cut utility using SoX by
> remix two stereo channels with one of them inverted first.
> This can be done with an GUI audio utility like Audacity but requires
> at least a few interactions. I want to have a one-click tool. So I've
> tried SoX for this with the following method:
>
> # 1. Split the channels of an input file: in.wav sox in.wav
> in_left.wav remix 1 sox in.wav in_right.wav remix 2
>
> # 2. Invert the right channel.
>
> sox -v -1 in_right.wav in_right_inv.wav
>
> # 3. Remix channels
>
> sox in_left.wav in_right_inv.wav --channels 2 --combine merge out.wav

This whould be written more easily as
sox -M in_left.wav in_right_inv.wav out.wav

Are you sure you are merging in_right_inv.wav and not the orignial right
by accident?

If the original in.wav is small enough,
can you post it somewhere so we can try it?


------------------------------------------------------------------------
------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clk
trk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Jan Stary
On Aug 08 12:06:59, [hidden email] wrote:
> Hi
> On a similar note
> If I have 2 identical files, except that one has a couple of seconds of
> hiss (or other program) on the front,
> Is it possible to "line up" the 2 files so that the audio is in sync,
> sample accurate, so that one can be inverted against the other to
> produce a zero output
> In other words, does sox have function that will correlate 2 files
> exactly

Not that I know of.
But if you only have these two files,
it should beeasy enough to find
the exact offset manually.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Mew, Peter
Thanks
That's a pity
Of course it can be done manually in a workstation, the trick would be
to do it automatically, thus saving time messing about with waveforms
and offsets

Cheers
-pm

-----Original Message-----
From: Jan Stary [mailto:[hidden email]]
Sent: Thu 08 Aug 2013 15:39
To: [hidden email]
Subject: Re: [SoX-users] Invert a stereo channel and remix

On Aug 08 12:06:59, [hidden email] wrote:
> Hi
> On a similar note
> If I have 2 identical files, except that one has a couple of seconds
> of hiss (or other program) on the front, Is it possible to "line up"
> the 2 files so that the audio is in sync, sample accurate, so that one

> can be inverted against the other to produce a zero output In other
> words, does sox have function that will correlate 2 files exactly

Not that I know of.
But if you only have these two files,
it should beeasy enough to find
the exact offset manually.


------------------------------------------------------------------------
------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clk
trk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Ulrich Klauer-2
In reply to this post by Beinan Li
Beinan Li wrote:

> I'm having difficulty implementing a vocal-cut utility using SoX by remix
> two stereo channels with one of them inverted first.

> sox in.wav in_left.wav remix 1; sox in.wav in_right.wav remix 2
> sox -v -1 in_right.wav in_right_inv.wav
> sox in_left.wav in_right_inv.wav --channels 2 --combine merge out.wav

This will give you a file where the right channel is inverted and the  
left channel is as before. The two channels are not mixed, though. To  
achieve this, you will either need --combine=mix, or an explicit  
remix, in the third step.

Actually, it is much easier to do all of this in one step:
   sox in.wav out.wav remix 1,2i
There is also the "oops" alias, which is equivalent to "remix 1,2i 1,2i":
   sox in.wav out.wav oops
This will give you "double mono" (i.e. two channels, but with  
identical content).

Ulrich


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Fmiser
In reply to this post by Beinan Li
> Beinan wrote:
>
> I'm having difficulty implementing a vocal-cut utility using SoX
> by remix two stereo channels with one of them inverted first.

Have you tried the "oops" effect?

--   Philip

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Beinan Li
In reply to this post by Beinan Li
Thanks for the help.

Ulrich's and Philip's tips work. 
Oops effect is the one I want.

However, this doesn't work and I didn't mix up files. 
Would be interesting to know why ...
sox -M in_left.wav in_right_inv.wav out.wav


Beinan

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Invert a stereo channel and remix

Mew, Peter
shouldn't that be

sox -m in_left.wav in_right_inv.wav out.wav

cheers
-pm


-----Original Message-----
From: Beinan Li [mailto:[hidden email]]
Sent: Fri 09/08/2013 01:10
To: [hidden email]
Subject: Re: [SoX-users] Invert a stereo channel and remix
 
Thanks for the help.

Ulrich's and Philip's tips work.
Oops effect is the one I want.

However, this doesn't work and I didn't mix up files.
Would be interesting to know why ...

sox -M in_left.wav in_right_inv.wav out.wav



Beinan

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

winmail.dat (3K) Download Attachment