Pitch / Note detection using Aubio or PyAudio

1.2k views Asked by At

Problem: I am trying to write some code in python which will detect the pitch/note of the live feed from the microphone. So basically I will be playing a note on my guitar and my code has to check and tell me which note it is.

Research: I have searched for multiple libraries to do this and the best one I could find were Aubio and PyAudio. So any help doing this will be appreciated.

NOTE- I don't want it in an array. I just want it like.

if note == 'A':
   keyboard.press_and_release('w') 

Any help for this ??

1

There are 1 answers

0
day On

pyaudio actually has a demo that converts microphone audio into a stream of numbers that correspond to unnamed notes. From there, you can convert the numbers to int, tune the numbers to notes and use that as your note detection.