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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sampling On-the-fly<br />

You can record live sounds in to the Capybara RAM with one <strong>Sound</strong> and play them back with another.<br />

For example, play the <strong>Sound</strong> called live scrambulation. When the GenericSource asks <strong>for</strong> the source,<br />

press Enter to use the default source (a recording stored on the disk). This <strong>Sound</strong> writes the recording<br />

into Capybara RAM and then reads out of Capybara RAM using four Samples with random loop starts.<br />

Try different settings <strong>for</strong> !Length — the length of the Sample loops.<br />

Now play live scrambulation again, but this time, set the GenericSource to use the live input and try<br />

singing, speaking, whistling, and making other mouth noises into the microphone. Whenever you exceed<br />

the !Threshold amplitude, six seconds of the microphone input is captured in RAM. You can see how<br />

long you have to record by watching the !TimeLeft fader. <strong>The</strong>n if you remain quiet enough not to trigger<br />

another recording, the Samples will continue to loop on whatever was captured the first time. Each<br />

time you exceed the threshold, it will record over the previous six second recording. Play with this <strong>for</strong> a<br />

while, trying different length settings and different kinds of vocal noises.<br />

<strong>The</strong>n double-click live scrambulation to see how it is put together: After the Annotation and Preset (the<br />

sine qua non of any well-documented <strong>Kyma</strong> example!) there is a Mixer called record live input & chop.<br />

True to its name, one branch of this Mixer records the input into RAM, and the other branch of the Mixer<br />

reads out of that same RAM with random loop points.<br />

Double-click on record when threshold exceeded to see its parameters. Its RecordingName is set to recording,<br />

its CaptureDuration is 6 s, and it is triggered by a <strong>Sound</strong> called TimeLeftAndTrigger (which<br />

we will examine more closely in a moment).<br />

Compare that to the parameters of one of the four Samples called ReadMem that feed into the StereoMix4<br />

called 4 chopped samples. This is a Sample that reads out of the same memory that the MemoryWriter<br />

writes into. Its Sample is set to recording (the same name as the RecordingName parameter in the<br />

MemoryWriter). Whenever you want to read out of the RAM that is being written into by a different<br />

<strong>Sound</strong>, you must check the FromMemoryWriter box in the <strong>Sound</strong> that is reading the memory; that way,<br />

<strong>Kyma</strong> knows not to bother looking <strong>for</strong> that sample or wavetable on disk but to look <strong>for</strong> it in another part<br />

of the same <strong>Sound</strong>. Notice also that the LoopStart of the sample comes from Noise and that the<br />

LoopEnd comes from that same Noise generator plus one tenth the value of !Length. Notice that we<br />

had to take the absolute value of the Noise because the output of Noise is in the range of (-1,1) and<br />

LoopStart expects values in the range of (0,1).<br />

Now take a look at the <strong>Sound</strong> called TimeLeft & Trigger, the trigger <strong>for</strong> the MemoryWriter. This is a<br />

<strong>Sound</strong>ToEvent module — a <strong>Sound</strong> that generates Event Values. <strong>The</strong> Event Values generated by a<br />

<strong>Sound</strong>ToEvent look, to all the other <strong>Sound</strong>s, the same as if they had come in from the MIDI input. In this<br />

particular instance, the value to be generated is given by the expression:<br />

| inputTrigger outputTriggerDuration |<br />

"<strong>The</strong> trigger to start our trigger and how long it should be on."<br />

inputTrigger := env follower L threshold: (!Threshold * 0.1).<br />

outputTriggerDuration := 6 s.<br />

1 - (inputTrigger * (1 - !TimeLeft asLogicValue)<br />

ramp: outputTriggerDuration)<br />

This is a somewhat twisted way of saying that the MemoryWriter should be triggered when the amplitude<br />

envelope of the GenericSource exceeds some threshold, and that it should record <strong>for</strong> six seconds<br />

without allowing another triggering during that time.<br />

By the way, this is an advanced example of how one can combine Event Values and expressions, so if it<br />

doesn’t make total sense to you immediately, don’t feel discouraged at this early stage. Just come back to<br />

look at it again later after you have had more experience with Event Values and Smalltalk programming.<br />

If you do understand it at this early stage then call us up and tell us so, because we are impressed!<br />

civilian you would probably continue with (13 mod 12 = 1) be<strong>for</strong>e answering.<br />

163

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

Saved successfully!

Ooh no, something went wrong!