Example Code

Guitar Tuner in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

1. Overview

The application continuously acquires sound, extracts tones, guesses at what string is being tuned, and gives you a dial-type indicator to help zoom in on a perfect tuning. The application can also play the tone for the string you are trying to tune, and will play custom frequencies too (such as a 440 A).

 

2. Description

I have done a few wingnut things with LabVIEW every now and then. A few years ago I used LabVIEW, an old monitor, some cardboard boxes 2x4’s and drainage pipe to make a robot for our church’s vacation bible school. The robot recorded kid’s voices talking and played them back with echo / robot effects and then periodically stopped and spoke the bible verses of the day. It was a big hit!
I keep a bunch of guitars in my office at home that I grab and play when I need a break or when I am seeking inspiration. One night, I was playing with a rather out-of-tune instrument (when I should have been working) and I thought to myself that LabVIEW is pretty good at data acquisition and analysis (an understatement). Making a guitar tuner in LabVIEW should be a piece of cake! After a little screwing around to figure out how to analyze acquired guitar sounds from my computer’s built-in mic I built Guitar Zapper – a LabVIEW powered guitar tuner application.

 

3. Requirements

  • NI LabVIEW Professional Development System 2012 or above.

 

4. Steps to Implement or Execute Code

  1. Load the “Guitar Zapper” project
  2. Load and run the “Guitar Zapper Main.vi”
  3. When you pluck a string, the VI will guess what string you are tuning and display the current frequency in the gauge.
  4. When you tune up or down, you will see the frequency gauge move.
  5. When it hits top-dead-center, it will become green and you are dead-on.
  6. You can also pick a string on the right-hand side of the application and click “Play String” to hear the tone you are trying to tune to.
  7. You can also type in a custom frequency and play that tone as well.
  8. Once you are done, click the stop button or close the panel.

 

5. Additional Information or References

Guitar Zapper Screenshot.PNG

 

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Member
Member
on

Great job! I'm not a guitar tuner expert but if I may suggest you something, you could get some inspiration from a simple common guitar tuner interface like the one in the picture.

harleybenton.jpg

Luiz Carlos Maia Junior