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
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:
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?
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).
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 ?
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.
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.
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: 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.