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

Option to take volume into consideration #188

Closed
bali182 opened this issue Dec 18, 2023 · 2 comments · Fixed by #189
Closed

Option to take volume into consideration #188

bali182 opened this issue Dec 18, 2023 · 2 comments · Fixed by #189
Assignees
Labels

Comments

@bali182
Copy link

bali182 commented Dec 18, 2023

Hello, first of all thanks for the lib, it's pretty intuitive to use!

I was wondering if it would possible to somehow take volume into consideration. For now I'm just trying to make an example that prints the note name from a guitar played through an audio interface. It works well, but sometimes when nothing is played, some notes are still picked up, (even though I only print the note detected, if the accuracy number is above 0.8).

I didn't really check the audio APIs in much detail, but would it be possible to somehow put a limit on the minimum volume needed to detect as a pitch? Eg.:

const [measuredFrequency, accuracy] = detector.findPitch(
    input, 
    sampleRate, 
    -15 /* stuff below -15 db would come back with 0 accuracy or something */
)

I hope it makes sense

@ianprime0509
Copy link
Owner

Thanks for the suggestion! I think that would be a good feature to have. I'll take a look and investigate the best way to implement this.

@ianprime0509 ianprime0509 self-assigned this Dec 19, 2023
ianprime0509 added a commit that referenced this issue Dec 27, 2023
ianprime0509 added a commit that referenced this issue Dec 27, 2023
ianprime0509 added a commit that referenced this issue Jan 4, 2024
ianprime0509 added a commit that referenced this issue Jan 4, 2024
Copy link

github-actions bot commented Jan 4, 2024

🎉 This issue has been resolved in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants