09.12.2012 Views

The Kyma Language for Sound Design, Version 4.5

The Kyma Language for Sound Design, Version 4.5

The Kyma Language for Sound Design, Version 4.5

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Variables<br />

By introducing variables, we can generalize one particular <strong>Sound</strong> to describe a whole class of <strong>Sound</strong>s.<br />

Such an abstracted <strong>Sound</strong> is called a lifted <strong>Sound</strong>, so-called because it is at a “higher” level of abstraction<br />

than is any specific <strong>Sound</strong>.<br />

A single lifted <strong>Sound</strong> represents an infinite number of real <strong>Sound</strong>s. Lifting a <strong>Sound</strong> by introducing variables<br />

is similar to introducing variables into an arithmetic expression. While 4 + 5 is just one expression,<br />

x + y represents a whole class of expressions — all possible sums of two numbers.<br />

<strong>The</strong>re are two places you might want to use variables: when encapsulating a complex <strong>Sound</strong> (see <strong>The</strong><br />

Class Editor on page 536), or in a Script or in one of the various FileInterpreters (see Scripting on page<br />

522).<br />

<strong>Kyma</strong> Variables<br />

Variables<br />

Variable <strong>Sound</strong>s<br />

In <strong>Kyma</strong> there are three kinds of variables: variables, Variable <strong>Sound</strong>s, and <strong>Sound</strong>CollectionVariables. A<br />

variable is used to represent values you can type into parameter fields, a Variable <strong>Sound</strong> acts as a place<br />

holder <strong>for</strong> <strong>Sound</strong>s, and a <strong>Sound</strong>CollectionVariable represents a collection of <strong>Sound</strong>s.<br />

<strong>The</strong> typeable parameters of a <strong>Sound</strong> can be represented by variables or expressions involving variables.<br />

To assign a variable to a parameter, type a name <strong>for</strong> the variable preceded by a question mark:<br />

<strong>The</strong> variable will be displayed in green in the parameter field.<br />

A Variable functions as a place holder <strong>for</strong> an actual <strong>Sound</strong> that may be assigned to it later on. You can use<br />

a Variable anywhere you would use any other <strong>Sound</strong>.<br />

<strong>Sound</strong>CollectionVariables<br />

Sometimes you may want to set an entire collection of <strong>Sound</strong>s (rather than the individual <strong>Sound</strong>s of a<br />

collection) to a variable — <strong>for</strong> example, in the Inputs field of a Concatenation or a Sum. To do this, drag<br />

<strong>Sound</strong>CollectionVariable from the system prototypes into the Inputs parameter field. <strong>The</strong> <strong>Sound</strong>CollectionVariable<br />

acts as a place holder <strong>for</strong> a collection of <strong>Sound</strong>s. It can be placed only in fields that accept<br />

more than one <strong>Sound</strong>.<br />

You can use <strong>Sound</strong>CollectionVariables in defining a new kind of <strong>Sound</strong> that can take multiple inputs (see<br />

<strong>The</strong> Class Editor on page 536 <strong>for</strong> more in<strong>for</strong>mation). You can also use a Script to set the value of a<br />

<strong>Sound</strong>CollectionVariable. Its value should be a collection of <strong>Sound</strong>s (<strong>for</strong> example, an Array). See<br />

Scripting on page 522 and <strong>The</strong> Smalltalk-80 <strong>Language</strong> on page 513 <strong>for</strong> more in<strong>for</strong>mation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!