Updating a SoundFileView

As I am recording to a buffer I would like to show in a ui the recording progress.

Currently I am calling the below to update a SoundFileView every 10th of a second via SkipJack.

buf.loadToFloatArray(action:{arg a;
	{
    	   sfv.setData(a, channels: buf.numChannels);
	}.defer
});

It works but I’m wondering if this is the right way to do this.

^^ this way.

As in the earlier thread, I would 10000 times recommend against the loadToFloatArray approach. You’ll be transferring multiple megabytes on each iteration, of which only a small percent will have changed, meaning that most of the data transfer is a waste of processor power.

It’s also wasteful to retrieve every sample when it’s likely that a few hundred or thousand samples will be compacted down to a single horizontal pixel.

It’s better to update the view incrementally.

hjh

Thanks. I will give this a try.