LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with piano project.

Solved!
Go to solution

Hey guys.
I tried to create just a simple piano. I have uploaded my vi.
The only issue is that the "silence" .wav that I have put as the default at the case structure produces a static audio which is unpleasant and also there is a bit of a delay between pressing notes.
How to make the first case to be an "empty" one? Because if I put nothing to 0, there is an error that the waveform requires a value>0. Should I just put each and every "wave sound player" in each case?
What about the delay? I would like to keep the format with the case structure intact as I have done if possible. Thank you.

0 Kudos
Message 1 of 9
(1,398 Views)
Solution
Accepted by topic author Seiryuu90

Instead of placing Play waveform in all the cases you can just bypass only for default case with another case structure.

Play Waveform will play only when you press any number other than 0

 

Piano.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 9
(1,345 Views)

Thank you for your advice but now the program stops running, it runs only continuously.

0 Kudos
Message 3 of 9
(1,339 Views)

I have shared you the code snippet which you can use by draging the attachment in your code if you have latest version of LV (2023).

 

If not let me know the version you are using i can down convert and share it for you.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 9
(1,332 Views)

I fixed it. Thank you!

0 Kudos
Message 5 of 9
(1,327 Views)

Have you used my code or modified your version of code based on my suggestion? If you have modified please share me the one you have modified.

I have just bypassed Play Waveform only when there is default case .

 

Check for the ON/OFF Control.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 9
(1,323 Views)
Solution
Accepted by topic author Seiryuu90

You can still simplify the code by providing array of WaveformFile Path and use Index array to extract the filepathindex.

Just Leave the case with"-1" as empty case.

PianoSubVI.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 9
(1,308 Views)

@PalanivelThiruvenkadam wrote:

Have you used my code or modified your version of code based on my suggestion? If you have modified please share me the one you have modified.

I have just bypassed Play Waveform only when there is default case .

 

Check for the ON/OFF Control.



I modified it.

0 Kudos
Message 8 of 9
(1,278 Views)

@Seiryuu90 wrote:

@PalanivelThiruvenkadam wrote:

Have you used my code or modified your version of code based on my suggestion? If you have modified please share me the one you have modified.

I have just bypassed Play Waveform only when there is default case .

 

Check for the ON/OFF Control.



I modified it.


If i am correct you have attached the old code or you have not modified, still i am seeing you are reading value in case "0" so you will have your old problem existence and as i suggested you have not used array concept for filepath.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 9
(1,241 Views)