LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Roadmap to a Guitar tuner

Hello LabVIEW Community,

 

As the subject say i need help to program an acoustic guitar tuner. And by help I mean a lot help because i am relatively new to LabVIEW  (version 2015 SP1) and to the concepts this software brings.

At the moment the surface of the VI is nearly finished and I wouldn’t like to change it a lot. (For the guitar players: Yes the design is heavily based on the KORG GA30 guitar tuner.)

The main concept of the program is that I constantly record the sound with my integrated laptop microphone, then a FFT should separate the frequencies and the program choose automatically the right chord and tell when its tuned right.

 

Functions I want to implement:

-Start/Stop button  let u begin/end the  recording/tuning and will not end the program itself (To end the Program u go to the Menu > Stop)

-The scale should automatically change the frequencies scale  according to the cord

-In the menu u can change the cord to the one u want (Menu > Choose note >Acoustic guitar > E, A, D…)

-The LEDs light up if you are near the right tuning

-rest of the buttons are placeholders right now but maybe i can implement them later

 

Right now I need some kind of roadmap what to do first and what I can do later because I’m lost at the moment and don’t know how to go on. I don’t want a ready program but it would be nice if you tell me the techniques i need and i search for examples and tutorials so I can understand how it works for myself.

 

 

 

Sorry for bad English, i am not a native English speaker

0 Kudos
Message 1 of 5
(3,403 Views)

Congratulations in an interesting choice of "Learning LabVIEW" projects -- this sounds like something where you have a good understanding of what you want to accomplish and are looking for "high-level" (or "design") help.

 

When starting a LabVIEW Project such as your Guitar Tuner, it is a Very Good Idea to open a LabVIEW Project and name it something like "Guitar Tuner".  [Note I'm using the phrase "LabVIEW Project" two ways in the previous sentence -- the second time it refers to a "LabVIEW Thing" call a Project].

 

Before worrying about how to do this, I'm going to show you two Projects that you will build yourself (with very little effort).  You then need to study them and "get the idea" of how they work so you can think about how adapt them to your needs.

 

Do the following:

  1. Open LabVIEW.  You will be interacting with the "Getting Started with LabVIEW" window.
  2. On the left hand panel, choose Create Project.
  3. On the right-hand panel, choose "Finite Measurement (NI-DAQmx)" and click Next.
  4. In the "Configure the new project" screen, change the Project Name to "Guitar Tuner 1".  In Modify VI Icons, click "Edit "Overlay" and use the Text Tool (T) to put GT 1 in the little rectangle (and click the OK button).  Click Finish.

This will build for you a Project, with VIs, Controls, and (best of all) documentation that shows you one way to organize a Project that has multiple tasks done under control of commands given by the User by pressing buttons on the Front Panel.  It is based on a very common design called the Simple State Machine.  Study it and think about how this might fit in with what you want to do.  Note especially that there are a lot of Sub-VIs that handle elements of the Project for you, with some of these having further sub-VIs to do particular sub-tasks.  [One possible measure of Good LabVIEW code is how many sub-VIs does it have, and what is the biggest (in screen area) Block Diagram -- many sub-VIs and small Block Diagrams, nothing bigger than a laptop screen, are Good].

 

Once you have your head wrapped around this design, do one more (which you will call Guitar Tuner 2).  Do the same steps as above, but start with "Continuous Measurements and Logging (NI-DAQmx)".  This uses a slightly more complex (but commonly-used) Design Pattern called the Queued Message Handler, which is sort of a State Machine on Steroids.

 

Note that with both of these Templates, the idea is to look at the task you have set out to do, and to sub-divide it into sub-Tasks that are each handled by a separate piece of code.  Note that the second Project involves multiple loops working simultaneously and somewhat independently (data are passed from loop to loop, but the loops run at their own rate and at the same time).  This ability to write code where operations take place in parallel is a direct result of LabVIEW fundamental paradigm, that of Data Flow, the idea that data "flows" down a Wire and when all of the inputs of a function are satisfied, the function "does its thing" and delivers all of its outputs.

 

Bob Schor

Message 2 of 5
(3,373 Views)

No details from me, but the xylophone links here might help you - http://forums.ni.com/t5/BreakPoint/Dr-Damien-s-Development/m-p/893438#M7467


___________________
Try to take over the world!
Message 3 of 5
(3,336 Views)

Thanks for the reply. I studied the projects but they are too complex to understand them fully. But nevertheless I think I get the main idea out of them:

From the first project documentation (Finite Measurements) I took the flowchart and modified it a bit for my needs.

The second documentation mentioned five Loops:

  1. Event handling Loop (EHL): needed to produce messages by clicking button, menus (For my project these are the Front Panel buttons and the menu entrys?!)
  2. Messaging handling loop MHL: needed to process the messages from the EHL and send them to 3. And 4.
  3. Acquiring Data: needed to constantly acquire data (In my case the Mic-In and the FFT)
  4.  (Logging data: I don’t think I need this at the moment)
  5. Displaying data: This one I need for updating the scale and the LEDs

 

Are the flowchart and my thoughts for the loops correct or do I need to add or modify them?

 

And a good next step would be to understand the event handlers better and after this the messaging handling (Loops) and try to implement in my program, right?

 

0 Kudos
Message 4 of 5
(3,296 Views)

Sounds like you have the idea of the QMH loops correct.  Another thing to look at (some of my colleagues whom I respect on the Forum seem to prefer this to the QMH, which I, personally, like) is the JKI State Machine, which can be obtained (I think) from the LabVIEW Tools Network.

 

If you do a Web Search for JKI State Machine, you can find not only this software but a series of Videos, Tutorials, etc. that might help you get started quicker.  [Sorry to give you so many options, but the more you learn, the more you know].

 

Bob Schor

0 Kudos
Message 5 of 5
(3,279 Views)