« Return to Thread: Writing Efficient Code

Re: Writing Efficient Code

by andrea valle-3 :: Rate this Message:

Reply to Author | View in Thread

It's trivial, but...

I always prefer to create synths on the fly and deallocate them with doneAction:2 (the other concept of synth, not as an instrument but as an event).
But if you have high densities of synths while scheduling, you gain a bunch by allocating once all the synths, and retriggering/setting them.

Best

-a-


On 24 Apr 2009, at 22:55, Josh Parmenter wrote:

One of my big optimizations is to see what kinds of things (controls or even audio) that can be re-used by many synths. If it can, become familiar with busses and routing. If you are using 10 reverbs with the same settings, see if you can create one reverb and send your 10 synths to it (for instance).

Best,

Josh

On Apr 24, 2009, at 1:35 PM, kernel wrote:

Hello,

From my experience most if not all the basic UGens in SC are very efficient so I suppose it comes down to how you use them - things like running a group of synths through a single effect/filter process instead of spawning the effect with each SynthDef.

What code are you trying to optimize?  The obvious tip is to use .kr UGens instead of .ar UGens where possible but maybe you trade some sound quality or maybe it isn't practical or makes little difference in some situations.

Other tips include not running your server at 192KHz with 16 sample block sizes :)  Of course the best joke of all is to suggest buying a new computer but you may just end up with more cores which just complicates things and isn't very funny.

Good luck,
kernel

On 24 Apr 2009, at 09:26, surgesg wrote:


Personally, I'm looking for help with the Synth side of things, but language
tips are always helpful too.

Thanks -


Dan Stowell wrote:

Hi -

It depends on what exactly you're working on but this might help:

It contains languagey tips, not synth tips

Dan

2009/4/24, surgesg <surgesg@...>:

Hi,

I've been trying to optimize some code I'm working on, and I think it'd
be
great to have a help file / tutorial on writing efficient synthesis
code.
I'm wondering if people would share strategies and techniques for
efficiency. I'd be glad to compile a help file out of the suggestions.

Thanks,

- gs
--
View this message in context:
Sent from the Supercollider - User mailing list archive at Nabble.com.


_______________________________________________
sc-users mailing list

info (subscription, etc.):



-- 

_______________________________________________
sc-users mailing list

info (subscription, etc.):



-- 
Sent from the Supercollider - User mailing list archive at Nabble.com.


_______________________________________________
sc-users mailing list



_______________________________________________
sc-users mailing list


******************************************
/* Joshua D. Parmenter

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list


--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--------------------------------------------------
" This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)

 « Return to Thread: Writing Efficient Code