News:

SMF for DIYStompboxes.com!

Main Menu

Pitch detection

Started by potul, August 05, 2011, 05:21:48 PM

Previous topic - Next topic

Hides-His-Eyes

Just so you know, that's a REALLY clever way of making a pickup. Bravo.

Taylor

I agree. Really impressive, especially since your ultimate goal was to be able to play Guitar Hero with it.  :D

potul

Quote from: Ikedude on August 25, 2011, 12:23:45 PM
I ended up using a modified AMDF for my system like this. I got a little ambitious and built humbucker sized pickups so I could track each string individually. Here's a pic:

Wow, I'm impressed (and inspired) by your pickups....

AMDF is in fact a kind of autocorrelation and very similar to the algorithm I use for low notes. But I face the same issue you mention, I need at least one cycle sample before being able to calculate accurately the freq, and for the low notes this is around 20ms of data. (for a guitar... bass is even worse).

If you ever find a "half cycle AMDF" let us know!

AxeArt

Quote from: CynicalMan on August 06, 2011, 08:24:49 AM
Getting a chip that could track polyphonically would open up the door for a huge range of fun effects.

Well, in fact, these guys are doing just that: www.blackboxpedals.com/products 
I met the designer a few weeks ago at the NAMM gear show in Nashville.  He's pretty much
done what you guys are talking about and created a wah pedal that listens to what the guitarist
is playing and operates a virtual rocker pedal in an aesthetically acceptable manner. 

I'm pretty sure it uses an FFT and a digital pot to pan the usual inductor based band pass
filter.  Pretty box too. 

AxeArt

potul

Quote from: Ikedude on August 27, 2011, 11:54:58 AM
I don't really have a place to host the code. I'm not sure I ever did a schematic, but here is the layout.  Its a lot easier to find a place to host pictures than anything else, haha.




BTW, what kind of magnets did you use? Where are they located? I don't see them in the picture...

Ikedude

QuoteIf you look at the datasheets for those you'll see they have a little pocket on the bottom. This was the perfect size for these:
http://www.kjmagnetics.com/proddetail.asp?prod=D21B-N52

Those are the magnets I used.


jk-fm

Yamaha trained a neural network to do half-wave pitch detection.

zeptin

Quote from: jk-fm on August 29, 2011, 10:11:41 AM
Yamaha trained a neural network to do half-wave pitch detection.

That sounds really fascinating, do you have a link to any further information?

And Ikedude, you could always throw a zip file up on rapidshare or something similar. If you don't want anyone and everyone to get hold of it you could put a password on the archive and PM the password to any interested people. Like me :icon_smile:

Anyway, that's a nice-looking layout. What are A1 and A2? Op amps?

BlackBoxPedals

You can track multiple notes with an FFT and a decent DSP with only
about 100ms delay on most of the guitar spectrum (lower notes are
harder).  You can't do midi, but you can do a lot of cool stuff.  Potul,
is definitely on the right track with the combination of FFT, STFT et al,
but trying to get to sub 50 ms is going to be tough. 

Great stuff, though.  Love Ikedude's pickup. 

-BlackBoxPedals

jk-fm

Here's one of the Yamaha patents:

http://www.google.com/patents/about?id=o_klAAAAEBAJ

Looks like they bought it from Axon/Andras Szalay.

Axon's "Early Transient Recognition":

http://www.axon-technologies.net/index.php?name=EZCMS&menu=17&page_id=28

Szalay is working on a new wireless guitar MIDI system with Fishman:

http://www.youtube.com/watch?v=5WCIXxU-mr8

potul

Quote from: jk-fm on August 29, 2011, 06:28:23 PM
Here's one of the Yamaha patents:

http://www.google.com/patents/about?id=o_klAAAAEBAJ

Looks like they bought it from Axon/Andras Szalay.

Axon's "Early Transient Recognition":

http://www.axon-technologies.net/index.php?name=EZCMS&menu=17&page_id=28

Szalay is working on a new wireless guitar MIDI system with Fishman:

http://www.youtube.com/watch?v=5WCIXxU-mr8


thanks for the info! a lot of useful information in the patent document!

Interesting things I spotted:

-The algorithm is able to track the plucking point in the sting. This opens up for very interesting applications.... (Imagine a different MIDI instrument used depending on where you pluck). Unfortunately, from what I saw it will only work with hexaphonic data.... (I need to dig more into it...).
-They use 2 separated algorithms to track pitch: A fast one using neural network and peak detection,  and a second one (slower but more stable) using zero crossing averaging 3 periods. The zero crossing results are also fed into the neural network.
-They use the neural network to determine pitch and plucking position faster, but still looks to me they need a full wave to do it, based on the description of the algorithm.
-The zero crossing algorithm does 2 interesting things: Interpolation to have a higher time resolution, and use of the slope at each zero to determine how big the following peak will be. It also uses a zero point reduction process in order to keep only the relevant ones based on an envelope tracking. Looks interesting.
-There is a description as well around quantization and how to handle bends that can be useful.

thanks a lot for the information!

Mat

defaced

QuoteMaybe a strip of steel between each pair of coils would help isolate them, but I'm not too good with magnetics so I'm not sure.
Check out the pickup winders forum over a the Music Electronics Forum.  There are a ton of threads on theory, and you can also post your application and get some good advice. 
-Mike

Ikedude

A1 and A2 are opamps, and both have 4 separate circuits.

The Yamaha stuff is interesting, thanks! I've been trying to think of a way to do half-cycle detection but I don't think I can with this PIC. Right now the time between samples on each string is set to be the difference in period between the two highest frequency notes I expect to see on each string. To be able to have the time resolution to distinguish between half-cycles I'd need to double, or maybe quadruple (depending on the algorithm), the current sampling rates.

I read the pickup makers forum regularly but the couple of times I've posted I didn't get much of a response. Maybe I'll try again.

zeptin

Well, if you're looking for a processor with a little more horsepower, the dsPIC33FJ128GP802 can do 40Mhz, and its ADC can sample at least twice as fast as the 24F you're using. I think potul's used it quite a bit, he can vouch for it. I also recently discovered that there's a dsPIC33E series which can go up to 60 (!) Mhz. They also include USB capability, which I eventually want to try to use to make a cheap recording interface for a PC. So far I've only got audio loopback plus a little FIR filtering working on a dsPIC33F, but it's still early days. I'll probably post more information if/when I can get something workable.

joenoone

Wonderful work you've been doing - I am definitely interested in the problems/solutions you have with implementing this for bass as I'm a 5-string player (low B) and have been dreaming of a better system.

Have you looked at the ARM platform? I see that Arduino is planning to create an ARM version soon (the http://www.wired.com/gadgetlab/2011/09/arduino-arm-products) so lots of tools there, and I've seen other projects/platforms that use ARM processors that are fairly inexpensive. Also have you had a look at the XMOS platform (http://www.xmos.com/) which has some serious horsepower?

That said, I'm guessing the problem is more with the algorithm than the processor in terms of latency.

For places to post your code, there are sites like pastebin or dropbox you might look at.

earthtonesaudio

That pickup design is a brilliant project in itself.  Might be able to improve it for guitar by staggering the strings so two pickups are not so close to each other.  Regardless, a very nice application for available components.

Ikedude

This might be a little overdue but...

If anyone is still interested in the code:
http://dl.dropbox.com/u/10464544/MIDI%20Pickup%20Source.zip

I went through and added some comments where I though it might not be obvious what I was doing (was a good exercise to see if I knew what I was doing, ha).

If you have any questions, feel free to ask.

~arph

Hi,

Thanks for the source, I will look into it as me being a software engineer it's always nice to see some code that has audio elements in it opposed to the mostly boring code I see each day  ;D

I don't think I'll build the pickup, but congrats for the great design! and thanks a lot for sharing it with us.

zeptin

Thanks for the code, I'm sure that going through it will be quite educational :icon_biggrin:

I don't have any questions yet, as I still want to try to implement AMDF myself. But hopefully more people will come forward with algorithms or improvements of their own.

joenoone

Hey Potul - are you still working on this? If so I ran across this a few weeks ago that might help :

    Nearly Optimal Sparse Fourier Transform - http://arxiv.org/abs/1201.2501

I found a reference to it from Slashdot - http://science.slashdot.org/story/12/01/20/037236/faster-than-fast-fourier-transform

"MIT news reports on research done resulting in a Faster-than-fast Fourier Transform algorithm. 'At the Association for Computing Machinery's Symposium on Discrete Algorithms (SODA) this week, a group of MIT researchers will present a new algorithm that, in a large range of practically important cases, improves on the fast Fourier transform. Under some circumstances, the improvement can be dramatic — a tenfold increase in speed. The new algorithm could be particularly useful for image compression, enabling, say, smartphones to wirelessly transmit large video files without draining their batteries or consuming their monthly bandwidth allotments.'"