Skip to content

Comment on Show HN: MeloCraft – Pitch detection in real-timeparent

Comments

Hi, nice tool. I just gave it a go and it seems reasonably accurate. I've recently been developing something similar - I'm detecting singing pitch for use in a game. I wonder did you use any particular method for detecting the pitch?

It's FFT-based. Then I do some basic computation to try and guess the « best » peak, taking the harmonics into account. Still need lots of work and I suck at math.

Not sure about OP, but I've always loved the simplicity of counting the zero cross-overs in one direction (E.g. positive to negative) with some gutter. With raw PCM this is trivial to implement in any language -- I last did this in bash. Then you just do a look up from frequency to note and you're done. It's also not very CPU intensive, and you can even sample less frequently and get pretty great results.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.