Page 1 of 1

minor DSP question

Posted: Tue Oct 14, 2014 4:52 pm
by Rocko
Hi,

I'm trying to convert some SYSEX data which originates from an old synthesizer and saved on PC as txt file.
This is like a backup system for vintage synths, instead of magnetic cassettes which were popular at the eighties...

The data on PC appears like this (txt):

F0xxxxxxxxxF7zz
F0xxxxxxxxxF7zz
F0xxxxxxxxxF7zz
F0xxxxxxxxxF7zz
F0xxxxxxxxxF7zz

Each line starts with F0, then data, then F7 and a unique 'zz' followed by '/n' (next line) as text document.
F0 and F7 are not unique but must appear at start and end of line.

Is there a way I can convert this file from 'string' to 'string array' in fast mode?
I thought of building a 'logic module' which will find the 'zz' at each line, push it into a stack (or array) and go for the next line, but I might be missing something a bit more basic.
Is there a more elegant way to break such a file from 'string' to 'string array'? Using green math? Using RUBY? using code? Maybe a 'string to string array' module based on new lines ('/n') ??

Thanks,
Rocko

Re: minor DSP question

Posted: Tue Oct 14, 2014 5:24 pm
by Exo
Hey Rocko,

Load the text file with the load text primitive and connect to its output a "Text" Component, now connected this text component to the array input on the String array, now it should contain each line as an index in the array.

Re: minor DSP question

Posted: Tue Oct 14, 2014 6:17 pm
by Rocko
Thanks.

I simply sent the output of the text file into an input of "string array append" and then sorted it.

Thank you !

Rocko

Re: minor DSP question

Posted: Tue Oct 14, 2014 6:27 pm
by Rocko
Hi,

Is there a way to determine the array size, i.e. the number of lines in the txt file?

Edit:
Founjd a way, just connect the output of 'text' to input of 'string array append' (nothing appended).
Then connect the output to 'string array append' to 'int' to see the size.