jitlib_basic_concepts_01:
Filter:
Tutorials/JITLib | JITLib > Tutorials | Tutorials > JITLib

jitlib_basic_concepts_01

some placeholders in SuperCollider

This helpfile explains some basic concepts of interactive programming with SuperCollider and proxy space.

What is a proxy?

A proxy is a place holder that is often used to operate on something that does not yet exist. For example, an OutputProxy is used to represent multiple outputs of a ugen, even if only one ugen is created eventually. Any object can have proxy behaviour (it may delegate function calls to different objects for example) but specially functions and references can be used as operands while they keep their referential quality.

See also: OutputProxy, Function, Ref

Further reading: NodeProxy, ProxySpace, Ndef

using a Ref as a proxy

using a Function as a proxy

see also client side proxies like Tdef, Pdefn, Pdef, Fdef

NodeProxy, ProxySpace, Ndef

For interactive programming it can be useful to be able to use something before it is there - it makes evaluation order more flexible and allows to postpone decisions to a later moment. Some preparations have to be done usually - like above, a reference has to be created. In other situations this sort of preparation is not enough, for example if one wants to apply mathematical operations on signals of running processes on the server.

NOTE: Wherever examples are given with Ndef, they apply to ProxySpace and NodeProxy: Ndef(\x, 5); is the same as: ~x = 5; in ProxySpace, and a = NodeProxy.new; a.source = 5;

In order to provide a simple way of creating node proxies, a proxy space can be used. So the above reads like this:

Another, very common way to access node proxies is Ndef (this is the same as the above, just written with Ndef):

The class Ndef uses ProxySpace internally to store its place holders.

Further reading: NodeProxy, ProxySpace, Ndef

next: jitlib_basic_concepts_02