App idea, Any idea on implementation?

Discussion in 'Python' started by Dr Mephesto, Feb 4, 2008.

  1. Dr Mephesto

    Dr Mephesto Guest

    Hi Guru's,

    As a python newb, I was thinking about trying to implement a program
    that converts whistled music into midi; the idea coming from a
    proposed application in the Mydreamapp competition hosted last year,
    more details here: http://stratfordisland.com/whistler/

    So, does anyone have a suggestion as to the best way to implement
    this? I was thinking maybe a fast fourier ever 20th of a second,
    selecting the dominant frequency, and then mapping that onto a real
    musical scale, then stretching or cutting the notes to a preselected
    timing scheme. Is this a stupid idea? Can one do a real time fourier
    transform in python? Or is there some other way to find the frequency
    of a whistle easily? I want to do this in real time, so as you whistle
    a tune, you see the notes appear, but if this is too hard, the
    prerecorded should be also good I guess.

    Im just looking for some vague opinion on how to start, so please post
    any idea you might have, every thing helps! Also, If you know of any
    code that already exist that might help, please post a link!

    Thanks in Advance,
    Dave
    Dr Mephesto, Feb 4, 2008
    #1
    1. Advertising

  2. On Mon, 4 Feb 2008 09:28:36 -0800 (PST), Dr Mephesto
    <> declaimed the following in comp.lang.python:

    > Hi Guru's,
    >
    > As a python newb, I was thinking about trying to implement a program
    > that converts whistled music into midi; the idea coming from a
    > proposed application in the Mydreamapp competition hosted last year,
    > more details here: http://stratfordisland.com/whistler/
    >

    <eep> It's the return of the Pitch-Rider... <G>

    Something I recall was available back in the days of the Amiga; was
    a small hardware box with microphone input and MIDI output... A way to
    use an analog instrument (flute, guitar, etc) to generate MIDI data.

    Strangely, the more powerful the computer system, the less flexible
    I see MIDI becoming... Standardized instrument assignments on soundcards
    and keyboards; do they still make MIDI synthesizers with full waveform
    control? [I think my antique CZ-101 is still functional -- it used
    digital emulation of VCO, ADSR, VCW, etc.; I seem to recall Yamaha FM
    models taking over the industry]

    But back to your project... If a pitch-rider could be created using
    c1985 hardware, I'd think a modern computer might be able to do it...
    Not sure if Python itself will be fast enough, may need C-extensions for
    crunching data samples. A Google on pitchrider midi finds lots of
    entries from 1992 for a $700 product...

    General comment:
    http://www.indiana.edu/~emusic/etext/MIDI/chapter3_MIDI11.shtml
    http://www.celemony.com/cms/index.php?id=melodyne_audiomidi

    Unfortunately, no theoretical information... Hardware versions might
    have used a PLL, with an A/D conversion of the PLL control voltage into
    a MIDI note number (and some software to do the note-off/note-on
    message)... IE, vary the PLL control voltage until the loop oscillates
    with the same dominant (probably filtered to remove harmonics) of the
    input signal, then map the voltage to defined notes...


    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
    Dennis Lee Bieber, Feb 4, 2008
    #2
    1. Advertising

  3. Dr Mephesto

    Dr Mephesto Guest

    thanks for the pointers!

    I just found a program that does more or less what I want, but I would
    still like to have a go myself. The link is: http://www.akoff.com/music-composer.html

    I gave the program a go, as there is a free trial. I found that it had
    a hard time doing the conversion (or I am a really bad whistler),
    maybe there is room for improvements.

    So, I know it can be done, the question is, does Python have to power
    to do it? And how did they actually do it anyway...
    Dr Mephesto, Feb 4, 2008
    #3
  4. I'd originally gone direct email for this response (I don't have
    news group posting ability from where I work, but can read via Google).

    On Mon, 4 Feb 2008 13:11:04 -0800 (PST), Dr Mephesto
    <> declaimed the following in comp.lang.python:

    > thanks for the pointers!
    >
    > I just found a program that does more or less what I want, but I would
    > still like to have a go myself. The link is: http://www.akoff.com/music-composer.html
    >
    > I gave the program a go, as there is a free trial. I found that it had
    > a hard time doing the conversion (or I am a really bad whistler),
    > maybe there is room for improvements.
    >
    > So, I know it can be done, the question is, does Python have to power
    > to do it? And how did they actually do it anyway...
    >
    >


    You might like to try a Google search on "pitch determination
    realtime" -- since that is the difficult step; mapping a frequency to a
    MIDI note and generating on/off messages on changes should be relatively
    easy (unless you also want to generate pitch(bend)-wheel messages).

    Or you could try to reverse engineer the BOSS TU-15. All
    chromatic tuners have to do real-time pitch determination, and the TU-15
    actually displays the octave (for about a 6 octave span, you won't get
    the really high notes of a piano).

    Some links that might be of interest:

    TU-15 specs, etc.
    http://www.bosscorp.co.jp/products/en/TU-15/specs.html

    http://www.bosscorp.co.jp/products/...hBy=RcId&dst=P&iRcId=0000009993&dsp=1&iStcd=4
    An actual paper (vs all those sites that just give the citation and want
    to sell the publication to you)
    http://www.caip.rutgers.edu/~lrr/Reprints/095_hardware pitch detector.pdf
    Another paper -- this one has code (appears to be Matlab, might be
    possible to port it into NumPY/SciPY)
    http://online.physics.uiuc.edu/cour...Time-Domain_Pitch_Tracking_Using_Wavelets.pdf

    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
    Dennis Lee Bieber, Feb 5, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    1,230
    Big K
    Feb 2, 2005
  2. Replies:
    0
    Views:
    630
  3. Michael Tsang
    Replies:
    32
    Views:
    1,103
    Richard Bos
    Mar 1, 2010
  4. Michael Tsang
    Replies:
    54
    Views:
    1,189
    Phil Carmody
    Mar 30, 2010
  5. Ryan Paul

    Rite Implementation Idea

    Ryan Paul, May 12, 2004, in forum: Ruby
    Replies:
    2
    Views:
    129
    Mikael Brockman
    May 13, 2004
Loading...

Share This Page