Jump to content

pitch to midi thru ain?


Alkex

Recommended Posts

Hi,

I was wondering if the pic is powerfull enough to analyse the pitch of an audio input by measuring it's frequency thru ain pins.

Ultimately, I would like to analyse 6 channels at once (one for each guitar string) and convert them to midi.

I think I could get my head around the programming side of it, but need to know if this is a realistic or too ambiscious project.

midi guitar anybody?  ;D

Link to comment
Share on other sites

Quick answer:  probably not.  While the PIC may be powerful enough (if you're lucky, but I doubt it would be to do this with a quick response rate in realtime), unless you've studied signal processing and assembly language programming, this is probably too ambitious.

Longer answer:

However, I seem to recall someone once making a PIC frequency analyzer for a contest a few years back.  The PIC hardware has improved since this point, and if you were to selectively filter around the guitar string frequencies, it may be possible.  However, you'll probably have to code this in assembly for speed, and have enough signal processing knowledge to figure out how to do the analysis.  That part could be done on a PIC, given enough time and knowlege.

The real challenge would be doing this fast enough to trigger MIDI note events, and that is where I'm 99 44/100% sure the PIC will not be fast enough.  You'd probably want something more along the lines of a 56303 DSP.

Check this out for a start, though...: http://www.circuitcellar.com/library/print/0998/Lacoste98/index.htm

Link to comment
Share on other sites

Hi Andrew,

Thanks for your comments, but i think there is still hope  :D

Check this out:

http://tomscarff.tripod.com/pitch_midi/pitch_to_midi.htm

Tom seems to have succeded, using a pic16f877, so surely our 18f series can do it...

I will build one of his pitch to midi devices (source code and pcb free for download) and will see how I can come to make this a midibox compatible module, because allthough a standalone device would be cool, the real fun come in when it speaks in "MIOS"  ;D

I'll keep you posted...

Best

Alex

Link to comment
Share on other sites

Very interesting.  It sounds like his approach would work very well for single notes; it's essentially a threshold detector that then does a period -> frequency -> MIDI note conversion.  Trying to process all six strings from a guitar would be a different matter, though (unless you wired a custom pickup so that the element for each string went to a different output)...

Link to comment
Share on other sites

I would have said that it's probably quite easy to get a crude implementation of pitch to MIDI going.

You wouldn't really need to mess too much with frequency analysis or any of that stuff.

I would run a hex pickup, with a 24db low-pass filter (to filter out harmonics and produce the fundamental), each feeding comparator. This will produce a square wave approximately the frequency of the string vibrations. Once you have your square wave, it would (in theory) be a relatively simple task to feed it into a PIC running the appropriate pitch to MIDI converter.

As far as the conversion goes, I'd be inclined to do it using some sort of frequency comparison table. That is, have the PIC compare the incoming frequency with a table of frequencies within the range of the guitar, ie. all the strings at all the frets, and maybe those in-between for bent strings if you're ambitious.

If it's clocked at a reasonable speed, and can lock onto the pitches and remain stable, I would think it is quite possible to implement a pitch to MIDI MB.

Having said all that, I just read the link posted and it pretty much does what i've said!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...