Creation of user defined Plugin in Audacity .

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

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

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:

Param( Percentage,   double,  XO("Percentage"), 0.0,  -99.0,   3000.0,  1  );

to

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?

@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 ?

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: Building Audacity 2.1.2 on Ubuntu 15.10

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 ?

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/blob/master/src/effects/BassTreble.h
https://github.com/audacity/audacity/blob/master/src/effects/BassTreble.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/

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

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

@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 ?

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: Redirecting to: https://plugins.audacityteam.org/
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.