I have an external object that is generating chunks of data in near-real-time. In my patcher I’d like to import that data directly into a buffer~ . Is this possible? Yes, I could make my extern first write the data to an audio file for buffer~ then to read, but that is (a) inelegant, (b) inefficient, and (c) a potential source of thorny timing problems. I’m looking for a way to get the data directly into buffer~.
what’s the format? if you have it as a text file, with one data point per line, with the data between -1.0 and 1.0, you’re all set, you can use [text] to read it in and then peek~ to bring it into buffer~. If the data is out of this range, use [scale]. If your object is just spitting out data, you can still use peek~, just decide when you want to start the data and use a [trigger] to [counter] to create indices for peek~.
If it’s chunks of data as you say, look to [iter] or [listfunnel], these can make it really easy to take a list and get it into another place via their indices. AFAIK there’s no way to write *chunks* or lists of data points to buffer~ all at once, it’s sample-by-sample. But you can do it really fast.
It seems like it would be really slow to do it with a text file, but it will probably be OK with [uzi]. See how many lines of data/text you have with the "query" message to [text] and you’re good to go!