nakakq / AudioPitchEstimatorForUnity

A simple real-time pitch estimator for Unity
The Unlicense
30 stars 1 forks source link

Unable to detect higher/lower octaves #3

Open Mewwee opened 19 hours ago

Mewwee commented 19 hours ago

Hi, thank you for this package!

I've been trying to test this out for bass range and soprano ranges, but the algorithm is unable to detect the correct octave beyond G3-C5.

After the note C5/D5, if I try to reach a higher note like E5, it registers as E4. Similarly with lower notes, after the note G3, if we try to reach F3, it registers as F4.

Any idea of how to fix this?

nakakq commented 6 hours ago

If you're facing to an "octave error" problem, it is good to start tuning Frequency Min and Frequency Max parameters.

Since this repository does not have any clever tracking algorithms, such an error can be occur. The SRH method (used in this repository) relieves this problem in simple way, but it is still far from perfect. Generally, you have to tune some parameters (in the AudioPitchEstimator class) depending on the characteristics of some typical input signals (e.g., input pitch range) in your use case.

An easy solution is, switching the parameter settings between the bass and soprano range. For example, tune Frequency Min/Max for bass range and soprano range respectively, and then apply either of them according to "bass mode" or "soprano mode" which is set by user.