06-06-2013 08:33 AM
Hi (first sorry for poor english, not my native language)
I have a project at school which is creating a melody using Labview and a function generator. I've worked on it for hours now and i still can't get through it.
I joined the vi file with my post so you can get a look at what i've done so far.
First, i do'nt know which loop i have to use (u'll understand soon enough if u just take a look at the vi file), the problem is that i want to create 4 arrays using 2 text files.
The first one is used as a reference : exemple the frequency to play an A is 440Hz, so my first text file looks like that :
A 440
B 493
...
the second one is my melody, which includes the notes and the tempo (in ms)
, so it's like :
B 1000
C 1500
....
I used the first two loops to seperate each string lines of my files so I have at the end 4 different arrays. One containing the note's references, one containing the frequency, one containing my melody's notes and one containing the duration of each notes.
The problem is that when I use a while loop, it seems that my arrays are not containing every elements it should, it only has the last one. Just try to run the vi file.
Could anyone give me some help ? Don't hesitate to ask more questions if u didn't fully understand my problem !
Thx
06-06-2013 08:37 AM - edited 06-06-2013 08:39 AM
Hello
I took the liberty to improve your code arrangement, without changing any single function.
This will help further developers to easily analyze your code.
Hope this helps.
[Edit: Image attached to save some clicks]
06-10-2013
03:16 AM
- last edited on
05-01-2025
10:12 AM
by
Content Cleaner
Hi claudeuntel,
Your array contains just the last note because at each for loop iteration a new table is created.
You have to send the table you created at one iteration to the next one.
To do this you can use shift register.
I didn't have tested the VI below but it should looks like that.
Valentin
Valentin
Certified LabVIEW Architect
Certified TestStand Architect
Certified LabWindowsCVI Developer
National Instruments France