Creation of user defined Plugin in Audacity .

Building and customizing Audacity from the source code.

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

Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by aishwarya1708 » Sat Dec 24, 2016 2:12 pm

Hi Everyone ,
I have developed an algorithm for Pitch/Time scaling for speech signals .
I want to create a plug- in for it in Audacity .For time being I want to create it locally , plug-in only system.How do I do it ?Could someone help me out ?
I have its .cpp file existing .Is there any way I could fork it into Audacity and create plugin using it .

Algorithm:
In my algorithm for time scaling , Upon running I need to enter a factor between 0.5 - 2 . 0.5 factor would scale down the speech signal and play the signal at a slow rate while factor 2 would would speed up the speech signal .In Pitch scaling : Similarly enter the factor between 0.5 -2 , 0.5 would change the pitch to a male voice (more base ) while factor 2 would result in a higher pitch resembling a female voice .The only input to my code is a input speech signal and a scale factor.

My .cpp code depends on two external libraries :armadillo and libsndfile
g++ TSM.cpp armadillo libsndfile -o tsm ( How I need to compile )

Hoping for your reply .
Hoping to find a solution to my problem


PS:
I work on Linux 16.04version
Audacity 2.1.2
aishwarya1708
 
Posts: 4
Joined: Sat Dec 24, 2016 1:49 pm
Operating System: GNU/Linux other

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by Gale Andrews » Sat Dec 24, 2016 2:23 pm

Moved to the correct board, because this is about recompiling Audacity.

I deleted your first post with the same but much more limited information.

Anyone helping can look at http://audacity.238276.n2.nabble.com/Plug-in-td7577466.html for more background and my general suggestion of what you need to do. Have you tried that? Have you asked your professor how to do it? If you get no answer here, I would try http://stackoverflow.com/.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 25276
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by steve » Sat Dec 24, 2016 2:34 pm

As you have a C++ implementation, I'd suggest that it will probably be easiest to modify an existing effect. For example, try making a trivial but obvious change to ChangePitch.cpp such as changing line 57 from:
Code: Select all
Param( Percentage,   double,  XO("Percentage"), 0.0,  -99.0,   3000.0,  1  );

to
Code: Select all
Param( Percentage,   double,  XO("Percentage"), 0.0,  -50.0,   3000.0,  1  );


The compile Audacity and ensure that the effect has changed as expected (the range of the slider should now be from -50% to 400 % rather than -99% to 400%).
Does that work for you?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 42929
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by aishwarya1708 » Fri Dec 30, 2016 6:57 am

@Gale Andrews
>Have you asked your professor how to do it?
> If you get no answer here, I would try http://stackoverflow.com/.

My Proff. has no clue about all these .
Yes I have asked the stackflow community ,waiting for their reply.

@Steve
> Modify an existing effect. For example, try making a trivial but obvious change to ChangePitch.cpp .
I did make the changes as mentioned.But I don't know what to do after that to see these changes in Audacity Software .Could you please shed some light on what should be done ?
aishwarya1708
 
Posts: 4
Joined: Sat Dec 24, 2016 1:49 pm
Operating System: GNU/Linux other

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by steve » Fri Dec 30, 2016 10:54 am

aishwarya1708 wrote:> Modify an existing effect. For example, try making a trivial but obvious change to ChangePitch.cpp .
I did make the changes as mentioned.But I don't know what to do after that to see these changes in Audacity Software

You then need to "build" Audacity from the source code ("building" is the process of compiling and linking to code to produce the executable application).

If you are on a Debian/Ubuntu based distribution of Linux, there are step by step instructions here: viewtopic.php?f=19&t=88922
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 42929
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by aishwarya1708 » Mon Jan 02, 2017 4:31 am

I tried this "build" Audacity , It works ,now the limit is from -50 to 400 instead of -90 to 400 .
This method has to be followed for every alteration done to the code ?
I don't intend to use any part of the actual ChangeTempo.cpp code ,for my code , the only input a scaling factor (floating value in the range of 0.5-2) ,and the speech signal on which it has to be .
Will retaining the header's in the actual ChangeTempo.cpp code and replacing the body of the code satisfy my requirement ?
aishwarya1708
 
Posts: 4
Joined: Sat Dec 24, 2016 1:49 pm
Operating System: GNU/Linux other

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by steve » Mon Jan 02, 2017 3:11 pm

Will your effect run in real-time ("real-time preview" like the WahWah effect) or "off-line" processing (like "Amplify" and "Normalize")?

Whichever type it will be ("real-time preview" or "off-line"), it will be easiest to use an existing effect as a starting point, modify the interface as required, and replace the DSP code with your code. For example, if it will be a real-time preview effect, the the "Bass and Treble" effect (Audacity 2.1.3 alpha) will probably be a good starting point.
https://github.com/audacity/audacity/bl ... ssTreble.h
https://github.com/audacity/audacity/bl ... Treble.cpp

As you can see in "Bass and Treble":

The interface layout is in void EffectBassTreble::PopulateOrExchange(ShuttleGui & S)
(this WxWidgets GUI code works in conjunction with the "Event Table")

The main DSP code is in EffectBassTreble::DoFilter which is called from EffectBassTreble::InstanceProcess


If the effect will be non-real-time, then the old version of "Bass and Treble" is one of the simplest effects, and is available from the Audacity 2.1.2 source code: http://www.audacityteam.org/download/source/
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 42929
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by Gale Andrews » Mon Jan 02, 2017 3:16 pm

aishwarya1708 wrote:I tried this "build" Audacity , It works ,now the limit is from -50 to 400 instead of -90 to 400 .
This method has to be followed for every alteration done to the code ?

Yes you have to recompile Audacity if you change its code.

aishwarya1708 wrote:I don't intend to use any part of the actual ChangeTempo.cpp code ,for my code , the only input a scaling factor (floating value in the range of 0.5-2) ,and the speech signal on which it has to be .
Will retaining the header's in the actual ChangeTempo.cpp code and replacing the body of the code satisfy my requirement ?

I have already expressed grave doubts about that, if your code requires an external library that Audacity knows nothing about. Your professor refusing to help you and refusing to let us see your code is unhelpful.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 25276
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by aishwarya1708 » Wed Jan 04, 2017 5:23 am

@Steve
Will your effect run in real-time or processing (like "Amplify" and "Normalize")?

I'm not 100% sure on what you meant by real-time/off-line .But as I mentioned my algorithm takes a scaling factor (0.5-2) and for time scaling , it scales the speech signal for the respective scaling factor for the entire speech signal. And in that I assume ,the answer to your question : Real -Time Processing (Am I right ?)

It will be easiest to use an existing effect as a starting point, modify the interface as required, and replace the DSP code with your code. For example, the "Bass and >Treble" effect (Audacity 2.1.3 alpha) will probably be a good starting point.

1) EffectBassTreble::PopulateOrExchange(ShuttleGui & S)
2) EffectBassTreble::DoFilter
3) EffectBassTreble::InstanceProcess

I did go through the Bass Treble 2.1.3 version source code .Which included parts mentioned in (1) , (2) , (3) , and I was not able to understand on how to edit them to suit my .cpp code .As previously mentioned ,my .cpp code uses 2 external libraries(armadillo and sndfile both included as headers in the main code ) .Sorry for being naive , but I'm not able to get a clear picture on how to edit it . I would be grateful if you could resolve my doubts .

@Gale
Yes you have to recompile Audacity if you change its code.

Thanks for the clarification .

If your code requires an external library that Audacity knows nothing about. Your professor refusing to help you and refusing to let us see your code is unhelpful.

Wont including the respective header in the .cpp code resolve this problem ?Yes , My Professor is not letting me share the code unfortunately .
As said , I just want to create a plug- in in audacity in some way or other . So if not this way , is there any other way to solve my problem ?
Last edited by Gale Andrews on Wed Jan 04, 2017 1:54 pm, edited 2 times in total.
Reason: Fixed quote tags
aishwarya1708
 
Posts: 4
Joined: Sat Dec 24, 2016 1:49 pm
Operating System: GNU/Linux other

Re: Creation of user defined Plugin in Audacity .

Permanent link to this post Posted by steve » Wed Jan 04, 2017 9:06 am

aishwarya1708 wrote:As said , I just want to create a plug- in in audacity in some way or other . So if not this way , is there any other way to solve my problem ?

Sorry but we are now going round in circles and I don't see how we can help you further.

As previously said, Audacity supports several plug-in formats: http://www.audacityteam.org/download/plug-ins/
We cannot teach you to program and we cannot do it for you, particularly as you will not let us even see your code or explain your algorithm.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 42929
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian


Return to Compiling Audacity



Who is online

Users browsing this forum: No registered users and 2 guests