jitlib_efficiency:
Filter:
Tutorials/JITLib | JITLib > Tutorials | Tutorials > JITLib

jitlib_efficiency

Efficient coding with NodeProxy

NodeProxy (and, in disguise ProxySpace) represent "pronouns", placeholders for all kinds of sound producing objects that are able to write to a specific bus on the server.

To prepare such an object for playing, different objects require different things, some very little, some more. As working with the placeholders does not show directly which actions are very efficient and which ones are not, it is shown here more in detail.

This is also important if you want to automate certain processes (e.g. for control by an external interface or a task) - some things (a) are not meant to be used in certain ways and better solutions should be used instead then, others are much more efficient (b, c).

a) rebuild and send: manual rate

the following code requires a rebuild and send of a SynthDef and is thus most cpu-expensive. though fine for slower use (esp.hand-use) for automatisation it is better to build a synthdef and assign it.

b) starting synths and tasks

the following code sends commands to the server to start synths, which is load mainly on the server and depends on the characteristics of the synthdef:

these resend the synth with new properties

c) sending messages to running synths

for these the least calculation has to be done

switching audio

(this can now be done with map!)

todo: rewrite this part.

control rate sources can be easily and efficiently switched using map or xmap. here is an example of how already running audio rate inputs can be switched. it is about as efficient as (b) - first example (setting a defname). it works only for 1 or 2 channels right now.