Example Code

Find Musical Pitch from Frequency 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

Overview

This example takes a frequency as its input and identifies the corresponding musical pitch class, octave, and pitch.

 

Description

In its current form, the code finds the 12-tone equal temperament pitch, though it can be easily modified to accommodate any other well-tempered tuning, such as quarter-tone tuning or any other tuning based on an equal subdivision of the octave.

 

Requirements

  • LabVIEW 2012 (or compatible).

 

Steps to Implement or Execute Code

  1. Enter the fundamental frequency of the tone that you wish to classify
  2. Run the program.
  3. The program will return the pitch, along with additional details such as Pitch Number, Class and Octave.

Additional Information or References 

Main VI Block Diagram

capture.JPG

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

David R
Systems Engineer
National Instruments

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