Split Stereo Track Into 2 Mono Tracks

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
tim_v
Posts: 5
Joined: Thu Feb 05, 2009 9:15 pm
Operating System: Please select

Split Stereo Track Into 2 Mono Tracks

Post by tim_v » Sun Feb 08, 2009 5:17 pm

I would like to suggest an improvement to the Audacity "split stereo track feature": Instead of splitting the Stereo track into Left and Right tracks as it does now, it should split into 2 Mono tracks.

I have already made this modification by compiling from Source Code on Linux and find it an excellent feature which saves loads of tedious mouse clicking.

If anyone would like my amended source code (for version 1.3.6) just email [email protected]. It is just one line of code in TrackPanel.cpp

If some users prefer the existing method, how about 2 seperate menu items "Split Stereo Track" and "Split into 2 Mono Tracks"?

Tim

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Split Stereo Track Into 2 Mono Tracks

Post by steve » Sun Feb 15, 2009 3:27 am

In most situations you can just select "Stereo Tracks to mono" from the Tracks menu.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

tim_v
Posts: 5
Joined: Thu Feb 05, 2009 9:15 pm
Operating System: Please select

Re: Split Stereo Track Into 2 Mono Tracks

Post by tim_v » Sun Feb 15, 2009 6:24 pm

I have tried "stereo track to mono" and it doesnt do what I want. It creates one single mono track, but I want 2 different mono tracks.

I am doing 2 track recording using a stereo mixing desk, so I need to convert a single stereo track into 2 seperate mono tracks. At the moment this involves doing "split stereo track" then changing both tracks from "left" and "right" to "mono". This works, but is very irritating because of the amount of mouse acrobatics involved every time you do it!

Tim

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Split Stereo Track Into 2 Mono Tracks

Post by steve » Sun Feb 15, 2009 6:56 pm

:D That's why I said "most situations".
That's the time when an extra couple of mouse clicks are needed (unless you hack the code as you have done).
As a matter of interest, what exactly did you change? (I'm not a programmer, but I've built Audacity from source a couple of times so I might try out your modification and see if it works on 1.3.8).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

tim_v
Posts: 5
Joined: Thu Feb 05, 2009 9:15 pm
Operating System: Please select

Re: Split Stereo Track Into 2 Mono Tracks

Post by tim_v » Mon Feb 16, 2009 7:17 pm

This is my modification to Audacity 1.3.6

TrackPanel.cpp, Line 6,132, add the following:

//make the split tracks mono
mPopupMenuTarget->SetChannel(Track::MonoChannel);
if(partner)
partner->SetChannel(Track::MonoChannel);

Make sure this occurs before the call to MakeParentPushState() otherwise undo/redo wont work properly.

I would be really happy if this or similar modification was included in the official audacity, because its a feature I cant live without and Id rather not have to build from source every time. However I do realise its not a priority for anyone other than myself!

Tim

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Split Stereo Track Into 2 Mono Tracks

Post by steve » Mon Feb 16, 2009 10:36 pm

Well I've just amazed myself - knowing nothing about coding I had a play and hacked it around a bit....

Building from cvs (Audacity ® 1.3.8-alpha_Feb 16 2009),
I Changed the TrackPanel.cpp to this:

[attachment=]Temporarily removed while I test a minor change to it[/attachment]

And in TrackPanel.h

After (line 338)

Code: Select all

   void OnSplitStereo(wxCommandEvent &event);
added

Code: Select all

   void OnSplitStereoMono(wxCommandEvent &event);
The result is this:
screenshot.png
screenshot.png (20.64 KiB) Viewed 14826 times
And it works :shock:

Thanks for the input Tim. With your skills I'm sure that the Audacity developers would welcome you with open arms. If you are interested in developing Audacity, you can sign up to the Audacity Developers mailing list here: https://lists.sourceforge.net/lists/lis ... city-devel

I think that an option to split a stereo track into 2 mono tracks is an excellent idea for exactly the reasons that you give. I don't know how many users would find this feature useful (but then again, what % of Audacity users ever use "hh:mm:ss + NTSC non-drop frames"?) Certainly I will find it useful from time to time. I'll suggest it on the audacity-devel list and see what they say.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Split Stereo Track Into 2 Mono Tracks

Post by steve » Tue Feb 17, 2009 6:47 am

Made a slight change so that the undo history works correctly.

The patch file is attached.
This has been tested on Audacity 1.3.8 alpha but I think it will work on 1.3.7 (release) as well. (I'm testing that now)

For any other users that may want to try this patch:
To use the patch file, unzip it into the same directory as the unpacked tarball. The unpacked audacity folder should be named "audacity" or the patch file edited appropriately. In a terminal, cd to the directory that contains both the audacity folder and the patch file and enter

Code: Select all

 patch -p0 <patchfile.diff
[Edit]Have now tested on Audacity 1.3.7 in Ubuntu 8.10 and it works fine[/Edit]
Attachments
patchfile.diff.zip
(1.19 KiB) Downloaded 255 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

tim_v
Posts: 5
Joined: Thu Feb 05, 2009 9:15 pm
Operating System: Please select

Re: Split Stereo Track Into 2 Mono Tracks

Post by tim_v » Wed Feb 18, 2009 6:42 pm

Hi Steve, I am delighted to hear that the Split To Mono feature is being considered. Hope it makes it into the next version.

As to me doing dev work for Audacity: I have already contributed to the project some years ago when I helped with the "Precise Volume Controls" feature.

I would like to do more work for Audacity, but unfortunately I have a problem with my eyes. After years of being a C/C++ developer I now get bad pain in my eyes and head if I use a computer monitor.

I can use this computer only for a few hours per week, using a projector screen instead of a monitor. I will also be off line completely for several months starting Friday 20th Feb.

So basically Id like to help more, but it looks a bit impractical for now. Maybe in the future though? Email me privately if you wish to discuss this. Thanks.

Tim

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Split Stereo Track Into 2 Mono Tracks

Post by steve » Wed Feb 18, 2009 8:29 pm

You'll be pleased to know that the patch has been added to cvs so it is now available when you build the 1.3.8alpha version. (Audacity 1.3.8 has a couple of other tasty new features also).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply