Thread: Capture line in input and get frequency

  1. #1
    Registered User
    Join Date
    Aug 2007

    Capture line in input and get frequency

    I want to make a simple software to aid in learning the guitar fretboard.
    I have some experinece with C++ API programming, and some with fourier analysis in MATLAB.

    I believe I need one thread to sample the line input, and hold such a buffer of samples.Every 1/4 seconds (empirically chosen), the last n samples of the buffer will be analyzed for frequency.

    Another thread will start this analysis. Yet, another thread (main) will ask the user "play B", get the response from the analysis thread and give a result (right/wrong, too low, too high, etc).

    Is this the right way to go? What are you opinions?

    What are the API functions i'm looking for? Also, is there a class or API implementation for fourier analysis (or frequency analysis, whichever is right). I do not want to implement this kind of stuff, since my math is pretty weak.


  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    In Windows, look for the wave* functions for communicating with the sound card. Another option is DirectMusic.

    As for fourier analysis, I'm sure there's something out there. Google is your friend.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    May 2007
    mmmhhh...Multimedia Audio (wave* windows APIs) is not very good because it has a considerable latency...I would use DirectSound because is simple to use, is relatively fast and if there is no directsound driver for the soundcard it uses the Multimedia Audio APIs internally.

    Then for FFT I would reccomend FFTW or FFT Real

Popular pages Recent additions subscribe to a feed