Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect_pitch_in_range can return results outside range #9

Open
jangler opened this issue Jan 5, 2025 · 4 comments
Open

detect_pitch_in_range can return results outside range #9

jangler opened this issue Jan 5, 2025 · 4 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@jangler
Copy link

jangler commented Jan 5, 2025

I'm encountering this behavior with HannedFftDetector. I don't know whether it also applies to the other algorithm. Let me know if you need test data!

@mherrerarendon
Copy link
Owner

Thank you for submitting an issue, @jangler ! Yeah, send me the test data you were using and I can take a look

@jangler
Copy link
Author

jangler commented Jan 7, 2025

Thanks! Here's the audio file I encountered the problem with. The range I passed was 20-1046.4 Hz (C6), and the result I got back was 1066 Hz.

banjo.zip

@mherrerarendon
Copy link
Owner

@jangler
The issue is that the code runs an algorithm to improve the accuracy of the pitch detected, but it does it after the range was constrained, which could skew the result slightly. In your case it shifted it outside of the range.

I think the fix is 2 parts, the algorithm should be run optionally, and there should be some documentation around what the algorithm does and how it's not restrained by the range.

@mherrerarendon
Copy link
Owner

Adding a new parameter would be a breaking change. I'm going to publish this change along with another branch I already had that also contains breaking changes.

@mherrerarendon mherrerarendon added this to the 0.4 milestone Jan 11, 2025
@mherrerarendon mherrerarendon added bug Something isn't working documentation Improvements or additions to documentation labels Jan 11, 2025
@mherrerarendon mherrerarendon self-assigned this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants