04-03-2023 07:00 PM
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.
Solved! Go to Solution.
04-04-2023 06:02 AM - edited 04-04-2023 06:05 AM
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
04-04-2023 06:15 AM - edited 04-04-2023 06:23 AM
Thank you for your advice but now the program stops running, it runs only continuously.
04-04-2023 06:20 AM - edited 04-04-2023 06:21 AM
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.
04-04-2023 06:23 AM - edited 04-04-2023 06:24 AM
I fixed it. Thank you!
04-04-2023 06:25 AM - edited 04-04-2023 06:35 AM
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.
04-04-2023 06:42 AM
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.
04-04-2023 02:30 PM
@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.
04-04-2023 05:42 PM
@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.