The Pitch Detector is a Python program that uses the Aubio and prrat libraries to detect and visualize the fundamental frequency of an audio signal in real-time. This program provides a graphical interface to display the detected pitch, frequency, and cents deviation from the closest note. You can choose between using the Aubio library, the prrat library, or a combined graphical interface for pitch detection.
- Real-time fundamental frequency detection and visualization using Aubio and prrat libraries.
- Display of the detected note name, frequency (Hz), and cents deviation.
- Visualization of the detected pitch using a moving circle.
- User-friendly graphical interface using the Pygame library.
- Option to run the Aubio library, prrat library, or both libraries simultaneously.
- Make sure you have Python installed on your system.
- Install the required libraries using the following command:
pip install pygame aubio parselmouth numpy pyaudio music21
- Download the
prratAlgo.py
andaubioAlgo.py
files, which contain the pitch detection algorithms using the prrat and Aubio libraries. - Run the
game.py
script to use the graphical interface, or run theprratAlgo.py
andaubioAlgo.py
scripts separately to use each library individually. - Follow the instructions in the graphical interface or console to sing or play a musical note into your microphone.
- Run the
game.py
script to use the graphical interface for pitch detection. - Alternatively, run the
prratAlgo.py
script for pitch detection using the prrat library. - Run the
aubioAlgo.py
script for pitch detection using the Aubio library. - Sing or play a musical note into your microphone.
- The graphical interface or console will display the detected note, frequency, and cents deviation in real-time.
- The moving circle on the screen (if using the graphical interface) represents the pitch height.
- Close the graphical window or stop the console process to exit the pitch detection.
This program requires the Pygame, Aubio, parselmouth, numpy, pyaudio, and music21 libraries to be installed on your system.
Fig. 1: The Pitch Detector in action, displaying the detected pitch, frequency, and cents deviation.
For any questions or feedback regarding the Pitch Detector program, please feel free to reach out to the developer:
Name: Morteza Hatami Email: m.hatami@live.com