Author Topic: Coding in Vamp and Compiling it..  (Read 13657 times)

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Coding in Vamp and Compiling it..
« on: January 19, 2009, 15:36:14 »
Good day!

I already started coding my project, and used PercusionOnsetDetector  codes and modify it. I will be using audio-signal processing for the plugin.

I would like to ask for help if anybody here got some idea on how to code the actual process of my plugin. To recall, I will have a pre-recorded track and the plugin will get the range of frequencies of the high and low notes. By that, it will output the vocal range which is soprano, bass, etc.

And, what compiler should I use to compile the codes in Vamp SDK?. I can't compile/build it using MS Visual C++ 2005 Express Edition. Do i have to compile something first before i could compile my own codes?..

I've downloaded all that has to be downloaded as stated in the Vamp website.

Thanks ahead.

cannam

  • Administrator
  • Sr. Member
  • *****
  • Posts: 273
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #1 on: January 20, 2009, 12:57:21 »
Hazel,

There is a VC++ project file for the Vamp example plugins (VampExamplePlugins.vcproj) in the build folder of the Vamp SDK 2.0 release.  This could easily be modified to build other plugins -- just remove the examples\*.cpp files from the project and replace them with your own.

The project file provided is for Visual C++ 2008 (full or express edition), rather than 2005.  However, I had thought that project files for VC++ projects were backward compatible and could be opened in VC++ 2005 as well -- I know that this is not the case for solutions or .NET projects, but I thought it was true of pure C++ projects like these.  I may be wrong about that.  What sort of errors are you seeing?

I'm not especially familiar with pitch detection algorithms, I'm afraid.  There is quite good overview with several promising-looking references on the Wikipedia page on the subject (http://en.wikipedia.org/wiki/Pitch_detection_algorithm) -- some of those links may be worth a try.

Remember that to carry out a frequency-domain algorithm, you should need only to have your plugin return FrequencyDomain from its getInputDomain() method and the host will provide data that has already been processed through FFT (you just need to make sure you've properly understood the format of the data that is passed to the process() call!).  For time domain methods, return TimeDomain and the host will give you the original audio samples, block by block, in process() calls.


Chris
« Last Edit: January 20, 2009, 13:09:57 by cannam »

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #2 on: January 21, 2009, 07:59:15 »
Hi,

As i open VampExamplePlugins.vcproj, there opens a Visual Studio Conversion Wizard which says that 'the solution or project was created in a previous version of Visual Studio. It must be converted to the format used by this version...' As I proceed it cannot be converted. What is that?

I used some of the codes of aubio pitch detection plugin, does it also mean that i have to include the aubio shared library? Where could I get the documentation of the aubio plugins? I mean the documentation of their codes.

Hazel

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #3 on: January 21, 2009, 08:06:10 »
Also, do i need to add DSP application on my plugin such as filtering the noise? Or Vamp already caters DSP.

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #4 on: January 23, 2009, 07:22:52 »
hi..

I got to compile and build .vcproj in MVSC++ 2008.

I would like to ask if it would be possible if I put these sample codes to process() method:

    if(range){
           while(m_minfreq >= 270 && m_maxfreq <= 1100) {
               std::cerr<<"(soprano)"
            }
           while....

--that is by basis of frequency. soprano is in the range of 270-1100 hz. could that be possible?.

thanks.

Hazel

cannam

  • Administrator
  • Sr. Member
  • *****
  • Posts: 273
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #5 on: January 26, 2009, 14:30:13 »
Hazel,

No, the Vamp plugin host does not do any filtering or other DSP preprocessing on the audio data you receive.

I'm not aware of whether there is documentation available for the methods and code used in the Aubio library or not.  You could try its author's PhD thesis (http://aubio.org/phd/) which is quite informative about some of the methods involved, although I'm not sure whether it really covers coding documentation.

If you were using the Aubio library, you could link either dynamically or statically against it -- linking statically would mean you did not need to distribute the library separately, but you would need to build Aubio as a .lib static library.  Alternatively, you could simply draw techniques from it via copy and paste, or use the Aubio code as inspiration.

Note that Aubio is licensed under the GPL, which means that if you draw code from it either by copying it or linking to it, you will need to license your own code under the GPL also (if you publish it), which means providing your source code and properly acknowledging the copyright of the Aubio code, among other things.

I'm not sure that I understand the other question -- it is certainly possible to discriminate on the basis of frequency if your code calculates it, although maintaining a stable frequency estimate (i.e. without artifacts like wild diversions at note onsets) is not all that simple.  That "while" you have should probably be an "if", of course.  The process() function receives a single block of audio each time it is called, so if it can process one block and make a pitch discrimination based on only that block and any prior information it may have, then it can return a feature, perhaps one having a single value that indicates the class of voice (0 for soprano, 1 for tenor or whatever) with an appropriate label.  Check the AmplitudeFollower example plugin for a plugin that returns one single-featured value per process call.  Of course, I'm making an assumption that may not be correct about what your plugin is intended to calculate in terms of returned feature structure.


Chris

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #6 on: January 27, 2009, 14:06:13 »
hi,

If vamp doesn't have any filtering or DSP, can i add to the vamp codes on filtering the audio input because I am required to filter the noise first before analyzing the range? Also, where on the codes will I add it, is it still in the process() function or I'll add another function for it.

My sample codes is supposed to be "if" instead of "while", sorry for that.

Thanks.

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #7 on: January 27, 2009, 15:45:28 »

The process() function receives a single block of audio each time it is called, so if it can process one block and make a pitch discrimination based on only that block and any prior information it may have, then it can return a feature, perhaps one having a single value that indicates the class of voice (0 for soprano, 1 for tenor or whatever) with an appropriate label. 


This idea could be considered, if ever, the labels will be in the output() , right?.

haze

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Coding in Vamp and Compiling it..
« Reply #8 on: January 29, 2009, 17:34:12 »
Hi

Would it be possible to add a DSP Application for Vamp Plugin? Specifically filtering of sound signals.

If so, could you help me to do it. This is a part of my undergrad study which I should filter first the sound signals before analyzing the voice ranges.

Thank you.

Hazel
« Last Edit: January 30, 2009, 01:22:48 by haze »