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.

will output 256 tracks on each frame. § We want to sample only one of those tracks and we want to do it<br />

once per frame. So we sample one value and hold onto it <strong>for</strong> the next 255 samples until the corresponding<br />

value on the next frame. <strong>The</strong> only remaining piece of the puzzle is which of the tracks to read and how to<br />

offset the SampleAndHold to pick that track on each frame. <strong>The</strong> <strong>for</strong>mula <strong>for</strong> this is<br />

(256 - 3) samp<br />

where you would substitute a different number <strong>for</strong> 256 if you were using a different LowestAnalyzed-<br />

Freq.<br />

Finally, double-click track voice to see the parameters of this Oscillator. Notice that the Frequency parameter<br />

is set to<br />

freq track R * SignalProcessor sampleRate * 0.5 hz<br />

This is one of the few examples that uses an R to get the right channel of a pasted <strong>Sound</strong> rather than the<br />

left channel. That’s because the frequency envelopes are on the right output channel of the LiveSpectralAnalysis,<br />

and the amplitude envelopes are on the left channel.<br />

<strong>The</strong> rest of the <strong>Sound</strong>s in this row and the next use the harmonic analysis method <strong>for</strong> tracking the frequency<br />

of the input (but could just as well have used the FrequencyTracker module). Try playing some<br />

(or all) of them and take a look at the ones that interest you in order to see how they were put together.<br />

Decision Thresholds and Logical Comparisons<br />

So far, we have been using parameters extracted from the audio signal as something like continuous controllers.<br />

It’s also possible to use them in a way analogous to discrete switches or gates. <strong>The</strong> key to turning<br />

the continuous envelopes into gates or switches is to use a Threshold or one of the comparison operators.<br />

For an example of using the Threshold on an amplitude, look at trigger a sample on S. This <strong>Sound</strong> is the<br />

same as the Highs to lows example, except that it feeds the ratio of high to low energy into a Threshold.<br />

When the ratio of highs to lows gets above a selected value, the Threshold output is one. At all other<br />

times, the output of a Threshold is zero. By pasting the Threshold into the trigger field of a Sample, you<br />

can trigger the sample whenever the ratio of highs to lows exceeds the selected threshold. In this case the<br />

threshold is set such that it triggers on the “S” sounds at the beginning of “so” and the ending of<br />

“essence”, but does not trigger at any other time.<br />

You can also make decisions based on the frequency of the input. For example, take a look at pch selects<br />

eq. This is a StereoMix2 with two GraphicEQ inputs. <strong>The</strong> scale on the first input is<br />

((22050 * freq L) gt: !Freq nn hz removeUnits) smoothed<br />

and the scale on the second input is<br />

((22050 * freq L) le: !Freq nn hz removeUnits) smoothed<br />

First the FrequencyTracker is scaled to the full range of frequencies using<br />

(22050 * freq L)<br />

You probably noticed that it is missing the units of hz. Since this is not a frequency field, we don’t need to<br />

include the units.<br />

<strong>The</strong> second half of the expression<br />

!Freq nn hz removeUnits<br />

allows you to set a pitch in terms of note number using !Freq, converts the note number value to hertz,<br />

and then removes the units from the number, since we want to compare this number to another number<br />

that does not have units. (<strong>The</strong> MIDIMapper is scaling the range of !Freq to between 12 and 127 in this<br />

example).<br />

§ <strong>The</strong> number of tracks per frame associated with each LowestAnalyzedFreq value are:<br />

1F: 512 2F: 256 3F: 128 4F: 64 5F: 32<br />

180

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

Saved successfully!

Ooh no, something went wrong!