Buffer allocation time

13 views
Skip to first unread message

Mikael Reponen

unread,
May 1, 2019, 4:03:20 AM5/1/19
to Overtone
Hi,

I am writing a software to easily generate timing/value patterns for synths in in Overtone. One thing I noticed that creating a buffer, no matter of the size, takes about 80 ms on my machine. My software uses buffers extensively and the 80 ms per buffer can lead to big execution times for functions. At the moment I have mitigated the effect with a buffer pool, but I was wondering if there is some way to creating the buffers faster or is the creation time coming from Supercollider itself? 


Best regards,
Mikael Reponen

Hlöðver Sigurðsson

unread,
May 9, 2019, 10:43:40 AM5/9/19
to Overtone
Hi Mikael, there's an annoying sync problems with Overtone and Supercollider, this usually only happens for very large buffers. If you are loading samples on the other hand, there's now an async version of sample loading in 0.10.4 which should be much faster since it loads everything in async/parallel. With the tradeoff that we don't know when the samples are loaded.

Otherwise I'm always super busy but willing to help, reply to me the function that's slow and I'll see if I can't make an async version for it as well.

Mikael Reponen

unread,
May 11, 2019, 4:46:49 AM5/11/19
to Overtone

Hi, thanks for the information! I don't yet use buffers to hold samples, only timing and value patterns that use to gate envelopes etc.  I will add samples to the mix at some point though. This means that I have lots of small buffers, for example when I control a synth I make one buffer with a length of 4 and 4 buffers with a length of 1. The creation of a buffer takes about 80 ms, timed with (time (buffer 1)). Thus, these 5 buffers already add up to 400 ms in execution time. I have mitigated this by in parallel creating  a large  buffer pool of these small buffers of different length during startup. While this adds a bit to the startup time, it otherwise works well until the pre-made buffers start to run out.

I am now using Overtone 0.10.4, so far without any issues.

-Mikael
Reply all
Reply to author
Forward
0 new messages