Ben Overzat, MathWorks
You can build an automatic guitar tuner using Simulink® and its support package for Arduino® hardware. In this project, the user selects which string to tune by using a push button that is connected to an Arduino. An LED display at the output of the Arduino shows which string was selected. The Stateflow® portion of the model makes this possible. As the user plays the selected string, the tuner uses a pitch detection algorithm written in MATLAB® to determine whether the string is in tune. A motorized gripper then turns the corresponding tuning peg on the guitar until the string is in tune. Simulink allows the user to visualize inputs—in this case, the audio waveform from the guitar—as the model is running on the Arduino. The Simulink model developed for this project is deployed on the Arduino, so that the tuner can work as a standalone.
The Simulink model and other files associated with this project can be found on MATLAB Central File Exchange: