×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 45
  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Guitar Tuner in Python

    I need a free guitar tuner for my 6680, but looks like none of the existing ones is compatible.
    So I'd like to write it by myself.

    I collected some documentation with google, so I know that I need to perform a Fast Fourier Transformation on the captured sound; being pys60 not able to process real-time microphone input, I'll have to record small chunks of sound to WAV file and analyze them.

    I found a python example, but I can't figure out how FFT fucntion works.

    I also found that probably pymedia or numpy or numarray modules would be suitable for this task, but I can't understand if they are available for pys60. Any idea?

    I guess it should be enough to pass to the FFT function above just a simple array containing all raw samples contained in the WAV file, putting to "0" the imaginary part.... Is this correct?!?

    Any help would be appreciated...

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Guitar Tuner in Python

    I haven't had time to get into python programming yet so I can't help with the module availability.

    However, FFTs I can help with. That must really be the slowest FFT in the world, even without having to run it in Python. You should just be able to pass it the raw sample data though and the algorithm accepts real numbers (note, this version almost certainly won't work on integers properly, fractional parts will be used in the calculations, not sure how Python handles that).

    That transforms your data from the time domain to the frequency domain. After that the sample with the greatest magnitude should correspond to the frequecy of the note you are playing - working out what that frequency is will be slightly less easy I suspect.

    I had a quick google for guitar tuners (I'd quite like one too) and assuming it's still available this one:
    http://www.handango.com/ampp/store/P...oductId=199274
    Is only $6.29 and supports the 6680. That's nearly free. Particularly compared to the time it would take you to develop it to this level.

    While I'm all for Python and rapid prototyping I think you might find the delays involved in trying to do the FFT like that make the application a bit less usable than you'd like.

    Sorcery

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Guitar Tuner in Python

    P.S. If you do still want to go down the free open source tuner route I think an FFT extension module for Python could be really useful. If no-one else does one I might make that my next hobby project... I'll probably have time before the end of next year at least! If someone else wants to do it first I'd be happy to help with debugging.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Guitar Tuner in Python

    Quote Originally Posted by Sorcery-ltd View Post
    I haven't had time to get into python programming yet so I can't help with the module availability.

    However, FFTs I can help with. That must really be the slowest FFT in the world, even without having to run it in Python. You should just be able to pass it the raw sample data though and the algorithm accepts real numbers (note, this version almost certainly won't work on integers properly, fractional parts will be used in the calculations, not sure how Python handles that).

    That transforms your data from the time domain to the frequency domain. After that the sample with the greatest magnitude should correspond to the frequecy of the note you are playing - working out what that frequency is will be slightly less easy I suspect.
    Sorry, I can't understand: are you talking about you writing a python module which implements FFT? Or you already did? Or you just wrote the algorithm in another language? Or you just THOUGHT the algorithm?!?
    Ah, wait... maybe you are talking about the source I posted??
    In that case... maybe you can explain better how I should use that function?

    I had a quick google for guitar tuners (I'd quite like one too) and assuming it's still available this one:
    http://www.handango.com/ampp/store/P...oductId=199274
    Is only $6.29 and supports the 6680. That's nearly free. Particularly compared to the time it would take you to develop it to this level.

    While I'm all for Python and rapid prototyping I think you might find the delays involved in trying to do the FFT like that make the application a bit less usable than you'd like.

    Sorcery
    Cool finding... but I think it would be more interesting to use my need for a guitar tuner to learn python programming.

    Quote Originally Posted by Sorcery-ltd View Post
    P.S. If you do still want to go down the free open source tuner route I think an FFT extension module for Python could be really useful. If no-one else does one I might make that my next hobby project... I'll probably have time before the end of next year at least! If someone else wants to do it first I'd be happy to help with debugging.
    Don't forget not to reinvent the wheel (or... well, just reinvent it if you like, I know amateur programmers usually like reinventing algorithms just to enjoy programming ): numarray, numpy, scipy modules already exist and are opensource...

  5. #5
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: Guitar Tuner in Python

    @cassioli:

    You should implement FFT in C++ for making a fast python extension module !
    There's a very large choice of source code on FFT ...

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Guitar Tuner in Python

    Quote Originally Posted by cyke64 View Post
    @cassioli:

    You should implement FFT in C++ for making a fast python extension module !
    There's a very large choice of source code on FFT ...

    BR
    Cyke64
    I don't know c++, that's why I'm looking for python modules...
    Anyway I guess I do NOT need such a fast algorithm: for guitar tuning, analyzing a sample of just 1 second or 2 sholuld be enough.

  7. #7
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Guitar Tuner in Python

    Hi,

    Ah, wait... maybe you are talking about the source I posted??
    Yes, that was it, sorry for the confusion. What you posted was a beautifully simple but extremely inefficient implementation of the FFT algorithm. It was also using real numbers rather than fixed point (what you actually want is a Discrete Fourier Transform or DFT) which is even slower since they aren't supported natively on ARM. I'm not saying don't use that source, just be aware that it will be very slow, even for a short sample I'd guess!

    You should implement FFT in C++ for making a fast python extension module !
    This is what I was suggesting I'd do for my next project (if I ever find some time). In fact a signal processing module would be quite good I think. I would only plan to port some open source math library code to Symbian and put some Python wrappers (bindings?) around it.

    Then you could just have functions to get the current sound frequency in Python for guitar tuner and all the audio stuff could be done in C++ in real time.

    Sorcery

  8. #8
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Guitar Tuner in Python

    Have you tried Musician?

    I quickly found a link at http://www.allaboutsymbian.com/softw...m/Musician.php. I'm not sure if this is the author webpage.


    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

  9. #9
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: Guitar Tuner in Python

    Quote Originally Posted by lfd View Post
    Have you tried Musician?

    I quickly found a link at http://www.allaboutsymbian.com/softw...m/Musician.php. I'm not sure if this is the author webpage.


    LFD
    It's not really the same thing that Casioli want to do
    He want a real time sampler what he play with his instrument so he need a FFT !
    The software you link is a very simple sound emitter of fixed freq.

    Read the entire thread before commenting

    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  10. #10
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Guitar Tuner in Python

    Hello

    So It means a new module for real time tunning of Guitar!
    Great! Waiting

    Best Regards
    croozeus
    Last edited by croozeus; 2007-12-02 at 14:26. Reason: Corrected: playing to tunning :-)
    Pankaj Nathani
    www.croozeus.com

  11. #11
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Guitar Tuner in Python

    Quote Originally Posted by croozeus View Post
    Hello

    So It means a new module for real time playing of Guitar!
    Great! Waiting

    Best Regards
    croozeus
    for playing?!? No! For TUNING!

    lfd, a program like that one is as simple that... I already wrote it, in OPL, for UIQ. But it is useless for me, I'm not able to compare guitar sounds to phone-generated sounds. I thought about making the phone play a pre-recorded guitar (tuned ) sound... but I never implementd it.

    Having a REAL tuner would be much better!

  12. #12
    Registered User
    Join Date
    Feb 2008
    Posts
    1

    Re: Guitar Tuner in Python

    Hi !

    I'm really interested in realtime pitch identification, but not for a guitar tuner.

    I'd like to develop a voice pitch mouse controller, for disabled people.

    Unfortunately, I haven't found something useful (python related)

  13. #13
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Guitar Tuner in Python

    thanks for giving me a new clue to do a google search!

    So I found tcSnack python module, which allows pitch detection!
    http://www.speech.kth.se/snack/man/s...ython-man.html

    But I couldnt find a pys60 port....

  14. #14
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Guitar Tuner in Python

    I am developing a strobe tuner emulation using PyS60 and a Python extension for audio steaming, FFT, and calculating the phase for the strobe display. Right now its working except for pitch detection. Once everything is cleaned up I will post the sources. Anyway, it looks like this:

  15. #15
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Guitar Tuner in Python

    cool.
    I stay tuned.

Similar Threads

  1. Could we have a Guitar Tuner?
    By resolectric in forum General Development Questions
    Replies: 14
    Last Post: 2010-09-09, 16:16
  2. Please help installing Python libraries on S60
    By ericroijen in forum Symbian
    Replies: 11
    Last Post: 2009-07-18, 10:43
  3. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Symbian
    Replies: 35
    Last Post: 2008-01-17, 09:12
  4. Replies: 1
    Last Post: 2008-01-08, 09:58
  5. Replies: 11
    Last Post: 2007-10-03, 19:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×