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.

<strong>The</strong> <strong>Kyma</strong> <strong>Sound</strong> compiler allocates a portion of sample memory <strong>for</strong> every parameter field in which you<br />

specify a sample file. <strong>The</strong> compiler can then do one of several different things:<br />

♦ If the <strong>Sound</strong> has FromMemoryWriter checked, the compiler tries to make this <strong>Sound</strong> use the same<br />

sample memory that a MemoryWriter in the same <strong>Sound</strong> structure and with the same name <strong>for</strong> its<br />

RecordingName parameter has written, see Writing Sample Memory In Real Time, below.<br />

♦ If the parameter field is set to Private, the compiler will not allow the sample memory to be shared.<br />

Private memory is typically used as delay lines <strong>for</strong> filters or reverberators, or in other situations<br />

where the sample memory is only needed internally <strong>for</strong> the duration of the <strong>Sound</strong>.<br />

♦ Otherwise, <strong>Kyma</strong> assumes the parameter field names a sample file on the hard disk and tries to locate<br />

it. (See How <strong>Kyma</strong> locates files on page 431 <strong>for</strong> more in<strong>for</strong>mation.) If Optimize Sample RAM Use<br />

(see Per<strong>for</strong>mance… on page 430) is on, <strong>Kyma</strong> will load the sample file onto only the expansion cards<br />

that require it; otherwise, <strong>Kyma</strong> will load the sample file onto all expansion cards. Note that all<br />

<strong>Sound</strong>s that use a sample file on a particular expansion card will share the same sample.<br />

Writing Sample Memory In Real Time<br />

If you are using <strong>Kyma</strong> as a real-time per<strong>for</strong>mance tool, there can be situations in which you might want to<br />

capture a sound and play it back later during the per<strong>for</strong>mance. You can use a MemoryWriter <strong>Sound</strong> to<br />

write the output of any other <strong>Sound</strong> (including ADInput) into sample memory in real time. Once written,<br />

that section of sample memory can be read by any <strong>Sound</strong> that can access sample memory as long as that<br />

<strong>Sound</strong> has FromMemoryWriter checked.<br />

In the following example (a Concatenation of a MemoryWriter followed by a Sample), the inputs write to<br />

and read from sample memory:<br />

MemoryWriter captures one second of the ADInput in a segment of sample memory named recTable.<br />

After that the Sample reads recTable <strong>for</strong> a duration of one second, thus playing back the recording that<br />

was just made. When you load this <strong>Sound</strong>, <strong>Kyma</strong> reserves one second of time in the sample memory, and<br />

it protects this memory until the last time it is read by the Sample at time 2 s. <strong>The</strong>n it releases the memory<br />

<strong>for</strong> use by other <strong>Sound</strong>s.<br />

A sample written by MemoryWriter <strong>Sound</strong>s is ephemeral by nature; it is protected in sample memory<br />

only <strong>for</strong> the duration of the <strong>Sound</strong>(s) <strong>for</strong> which it is a parameter. When the last <strong>Sound</strong> to reference that<br />

sample finishes playing, the sample memory used by the recording is made available <strong>for</strong> recycling. To<br />

guarantee that a sample persists <strong>for</strong> longer than the <strong>Sound</strong> in which it is recorded, use a DiskRecorder or<br />

a DiskCache <strong>Sound</strong> to write the sample to disk rather than to sample memory.<br />

499

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

Saved successfully!

Ooh no, something went wrong!