LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing a waveform with push button

I am trying to create a five contact sound piano, i want each contact to play a tone. I am using a daq assist as a way for the contact to communicate with the waveform but i do not know how to attach them together. does anyone know how to connect a digital line input to the play waveform daq assist. i am using a my stem board and a mydaq as the device to communicate to my computer and touch sensor board

0 Kudos
Message 1 of 3
(2,420 Views)

Hello Mike3214,

 

Can you explain if possible with a diagram (hardware and software level) what are you trying to do?

Looking at the code and the description, I have no clear idea of which will be the final goal with the project.

I'm will be looking forward to your reply.


0 Kudos
Message 2 of 3
(1,838 Views)

Hi Mike,

 

I suspect this will get you moving in the direction you want:

noise maker_BD.png

 

I'd guess you'll want to put this inside a loop, in which case you can set a Wait time equal to your "Duration" and then make duration a constant value, removing it from the front panel.

Sampling frequency is probably also constant - a property of your MyDAQ perhaps? (I mean, you can change it, but you might as well pick a value and stick with it, I guess?)

You need to populate the array constant with all the frequencies of the keys (so 5 elements). I just put 3 values here to demonstrate the idea.

 

To get more than one key at a time, you'll have to do something quite a bit more complicated, so that you can add the waves for each tone and then output their combination. In that case, I'd suggest a For loop instead of this Case Structure, and pass the array of frequencies and the boolean array in and conditionally output your waves based on the boolean and add the values, with some volume normalising.


GCentral
0 Kudos
Message 3 of 3
(1,816 Views)