Hi i have few spreads of raw data, which is an raw OSC message bytes.
All messages vary in length etc. Writer allows me to save only one message per file, unless i do + (Spectral Raw) in advance. But then i can’t seems find way to split data on slices, any tips on that?
What i want is to save bunch of osc data as file, so then i can deliver it back on osc decoders avoiding unnecessary nodes.
what you have to do here is define your own message framing. my favorite article on the topic: Message Framing
but in essence what you do is “length prefixing”: ie. for each of the slices you get the length as int32 (ie. 4 bytes) and add those at the beginning of the slice. then + (Spectral) all together and save. when loading you now know that the first four bytes denote the number of bytes of the first slice…and so on. look at the Take/Skip (Raw) nodes…
the input is a single raw slice (all your concatenated slices with each being prefixed with their length). in a loop where you set a max count (just to make sure this doesn’t run forever in case something is wrong with your input) you first read the first 4 bytes, then GetSpread the subsequence and turn it into a stream (for returning it back to vvvv as a raw slice). then you up the index by 4 plus the length of that slice and continue with the next loop. you break the loop when the number of bytes is reached.