Classes (extension) | UGens

Getenv : UGen : AbstractFunction : Object

Read (numeric) shell environment variables into a synth


Tries to grab a shell environment variable (with name key) and convert it to a floating-point value, which is output.

If the environment variable is not set, defaultval is output.

If the environment variable cannot be converted to a floating-point value, the output is zero.

NOTE: the shell context is that of the server, not the client.

Class Methods

Inherited class methods

Undocumented class methods, defaultval: 0)

Instance Methods

Inherited instance methods


Server.local.quit; // If server running, need to stop it for this example

// We'll modify the server boot procedure to set our env var...
~realserverprogram = Server.program;
Server.program = "export PANCREAS=220;" + Server.program

x = {
// Env var specifies frequency.
// If you change the env var name to one that isn't set, 440 is used.\PANCREAS, 440), 0, 0.1);

// This should restore the variable to what it was
Server.program = ~realserverprogram;