SynthOut:
Filter:
SynthOut/Guides (extension) | SynthOut

SynthOut
ExtensionExtension

get values from Synth to sclang into a ()

Description

SynthOut provides a simple mechanism to get values into a Dictonary, Environment, Event aka ()

It adds the instance method to SynthDef:getOuts and UGen:set

Its usage is described by example

UGen:set creates a SendReply for a given name and adds it the key \out in the metadata in the SynthDesc of the SynthDef.

The aim of this is that it can be used to update GUI widgets.

These GUI widgets are updated if they are linked to the synth through an Environment or Event aka ().

If the target in the Environment response to .value_ this setter is used with the value.

If the target in the Environment is a View setting the value is deferred.

If the target in the Environment is a Function the function is executed with the value as argument.

Otherwise the value is stored in the Environment.

The freq is also written to the environment, but because there is no object responding to value_ it is just saved in the environment.

This can be changed all the time.

If the synth is restarted it needs to be reconnected to the Environment.

It is possible to use set and getOuts without SynthDesc but in that case one needs to keep track of the used keys

The method set can take care of this.

The following is a bad idea because it mixes different concerns!

To keep track of values that control a synth use CV or MethodController.