Pitch Detection


#1

This topic has been discussed a couple of times herel. It would still be amazing to have good reliable cheap pitch detection in axoloti, especially for guitar to midi aplications.

I'm following this guys blog and the last post seems kind of interesting. He seems to have come up with a cheap and efficient solution and open sourced the code as well:

I'm not programmer so I can't really use it myself but I thought I'd share it here, maybe it's helpful for someone.


#2

Ah, I'm also a follower of Joel's blog, and his hexaphonic pickup is on my wishlist since a long time...
And btw, have you tried @SirSickSik and @Sputnki zero crossing objects? As said in the article you need an extreme Lowpass filtering before, but doing that I had fairly decent results... of course monophonic.


#3

I'm really hyped about the hexaphonic sustainer (wich the pitch detection is made for). Having a built in ebow for each string would be extremly epic but since this guy does everything alone it might take him some time to develope it.

I tried the one from SirSickSik but it was a bit glitchy. Maybe I need more filtering then? Need to check out the from Sputnki.


#4

That does look interesting!


#5

I'm just thinking...
in theory, you could use machine learning to learn pitch detection for any instrument, though, this would probably take quite some cpu and some time to teach the module the tonal character of your instrument and the related pitches..


#6

I'm busy on a new pitch detector.
This one seems to be quite precise and quick.
I managed to make it follow a pitch that was changing at 140BPM at 1/16 beat.
Also trying now to use it duo-phonic and see if I can get it to track 2 pitches and at least can follow the lowest pitch and it's kinda working (the second note still wobbles quite a bit, but it is detected)
I'm using a short delay, controlled by the first pitch-detector, which then subtracts the delayed version of the signal from the original. This way it more or less removes the detected note and leaves the rest of the audio for another detector to be able to detect the next pitch.


#7

its been done, quite a few articles... though many not publically available, but this one gives an insight, and said it worked quite well doc link

that doesn't matter, the point of using something like a FF neural net is you do offline training, i.e. do the training on your desktop , then once 'complete' transfer the training data to the axoloti to execute. the normal execution is much lower in cpu consumption, as its basically just lots of multiplications ... though i don't know, even this low consumption, is still low enough for axoloti.

also note: creating training sets can be pretty time consuming, as you need many examples to make it work ... that said i wonder, if in this case you could automate the creation of the training sets?
e.g. play lots of notes in on your guitar, then auto slice it , and run it thru a slow but accurate pitch detector.
this could work quite well, as another thing about training is you need to randomise the order the notes are played, otherwise the NN will just start predicting what you are going to play next :wink:


#8

I think the cpu consumption of all these multiplications and additions will come pretty high in the end, at least higher then other simple ways to do pitch detection.
My current version seems to behave pretty well, at least better then my previous versions.
Though, getting the second note pitch value is pretty distorted, let alone the third.. which basically came out as pitched noise..
I'll try to tweak more a bit first, in the hope that I can get 6 pitch values. Would be nice :stuck_out_tongue:


#9

btw, is getting the pitch in 5ms fast enough for pitch detection? :slight_smile:


#10

I've uploaded the modules:
fDtct frequency detector
pDtct: pitch detector (+ some added controls for finetuning and cascading)

cascading is roughly doable for 2 pitch values, but might need some combfiltering (ftod and delay modules) and highpass filtering. To be honest.. still pretty shitty haha


#11

I been playing a bit with this and it works quite well!!!
here is a little vid:

Sometimes there is glitches, especially on the lower notes, but for the rest it's nice and responsive!


#12

:open_mouth:
Great! Let me ask you to show your patch!
I tried many times and never be able to make something like that, whether for the envelope tracker or pitch detection...


#13

I'm not shure if that's the original patch of that video, my later patches were made for working with a roland gk pickup but it should be about it.

Guitar Synth.axp (6.6 KB)

P.S. sometimes with envelope tracking you need to adjust the ranges, or even clip the max or min, and smoothing is very important.


#14

Thanks for our patch!

I still have a big glitch on the G open string (and same for this G played on the D string). The note begins well but passes to octave up after one second. I tryed all types of filters but to me it works better with dry signal.

Now I'm working on to have a better retrig for contiguous notes.


#15

what kind of pickup are you using?
From my experience neck position works a lot better, because in bridge position there are so many harmonics that the algorythm will think it's an octave up because it takes the first harmonic.

You can try to apply lowpass filters, less harmonics = less confusion


#16

Yes it's a little better in neck position (mini-humbucker). I tried with LP filters to the point where high notes don't play but still have this...


#17

Do you go directly into the board or do you have a pedal/preamp/buffer inbetween?

If you go directly you will loose lowend because of impedance mismatch. less lowend = more harmonics = more confusion. So it's good to have pedal with no true bypass that buffers the signal before going into axoloti.


#18

No I don't use any buffer! I’ll try that when I get home, so... in March.