UI Interest Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Graph as a control - Arbitrary Tone Generator

In the past I considered using a graph as a clickable control to edit/create pass/fail windows. It all seemed like too much effort.

Then one day I was searching the internet for just the right sound for a notification. It was very frustrating not being able to find the sound I wanted...

Then it occurred to me that I could use LabVIEW to generate exactly the sound I wanted!

So after many hours of playing around (hobby time at home) I ended up writing my Arbitrary Tone Generator using a couple of graphs as controls.

One for the frequency and one for the volume (and one to display the result, but it's better to click 'start' and just listen to it).

I wanted to be able to edit the values on a chart OR on a table, then the two had to be linked. So when when you hover over one, the other shows where you're editing.

I thought it might be a good UI example (may be a bit complex for beginners).

Have a play, generate your own tones, try some of the sample ones I created (drop-down list, top right).

It's actually quite fun.

Tone-Gen.png

Features:

Settable granularity when using the chart (so rather than getting a floating point number with 6 decimal places it sticks to the defined granularity)

Right-click to delete a point

Export to wave file

Save as definition file (.ini)

Load definition files (samples included)

Direct play to audio device (defaults to device 0)

To do:

Selectable audio device

When x values overlap on chart, replace old value

Automatically sort the table if manually edited value is out of x sequence

More/better block diagram comments

Please feel free to make suggestions (or even better attach code improvements)

I would love to see some of your tone definitions.

The ones I've included as samples I called:

  • Pew Pew
  • Woooop
  • Ambulance Passing
  • Close Encounter
  • Jetsons


I've attempted to save a LabVIEW 8.5 version but have no way to test it.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Download All
Comments
B.Settles
Member
Member
on

Very nice. Now exactly which of the samples you provided was the "notification" sound you were looking for?

"All truths are easy to understand once they are discovered; the point is to discover them." -- Galileo Galilei

tst
Knight of NI Knight of NI
Knight of NI
on

Well, that's certainly nicer than what I made the last time I played with something similar - http://forums.ni.com/t5/LabVIEW/VI-of-the-Day-9-4-2009/m-p/979091#M438671


___________________
Try to take over the world!
Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

I like it, major kudos

Thoric (CLA, CLED, CTD and LabVIEW Champion)


RiCo!
Member
Member
on

Nice interface, very easy to use and understand!

TroyK
Active Participant
Active Participant
on

settlesj wrote:

Very nice. Now exactly which of the samples you provided was the "notification" sound you were looking for?

                   

Oh, yer, I forgot to include it. It was a modified version of the 'Woooop' one, a bit like an evacuation alert tone only faster.

My favourite one is 'Close Encounter'.

tst wrote:

Well, that's certainly nicer than what I made the last time I played with something similar                    

Thanks, I think we had a different objective (plus I got a bit carried away trying to make it look nice). Ooh, I like the keyboard you made though .

Big thank you to all the contributors in this UI interest group who made the fancy 'missing' system controls I used extensively.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Contributors