“Detecting music notes from the audio signal is difficult to do especially on Arduino due to limited memory and processing power. Especially when the note is not a pure sine wave, which is generally the case. If we take the frequency transform of various musical instruments, it may contain multiple harmonics based on the note being played. Every instrument has its own signature combination of various harmonics. In this code, I tried to make a program that can cover as many instruments as possible. You may refer attached video in which I tried to test the various types of instruments, various types of tones generated by the keyboard, and even sound of vocal are checked. Accuracy of the detection varies instrument to instrument. For some instrument (i.e. piano) in a limited range (200-500Hz) it is accurate, while some instrument it has low accuracy (i.e. Harmonica).
This code makes use of a previously developed FFT code called EasyFFT.
The demonstration of the code is shown in the above video with various types of instrument sound as well as vocal.
- Arduino Nano/Uno or above
- Microphone module for Arduino”