Example Code

Song Creation VI

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:
This VI reproduces a song written in a text file using system beem speaker. See Song creator readme.txt to see how to make your own song

 
2. Description: 

This VI is made so you can write a song in a text file and then have the VI read the file and play the song back onto your system beep speaker. It works by reading the .txt file in and manipulating what you have written into musical notes following the pattern explained in the "Song creator readme.txt" file

 

The manipulation consists on retrieving the note and duration of the note from the text file and passing the corresponding frequency and duration to the Beep.vi. The conversion between the note and the frequency is done in a subVI that acts like a look up table (Note Look Up Table.vi)

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Extract the files from "Song creator LabVIEW 2012 NI Verified.zip"
  2. Be sure "Song.txt" and Song creator LabVIEW 2012 NI Verified.vi are in the same folder
  3. Execute the code 
  4. Enjoy the music

5. Additional Information or References

 VI Block Diagram

 

Block Diagram.JPG

 

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

 

 

 

Owen.S
Applications Engineer
National Instruments

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

Comments
bnovar
Member
Member
on

This is such a simple and cool little subvi - good job!

Brenda Novar