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.

Generating MIDI<br />

If you want to turn MIDI key number into a signal, you have to divide it by 127 in the Value field of the<br />

Constant (because the Constant takes values between -1 and 1), and then multiply by 127 nn in the parameter<br />

field where you actually use the result. For example, look at the way MIDI pitch is turned into a<br />

signal and then mapped to a pentatonic scale using a Waveshaper in the <strong>Sound</strong> called double pentatonic.<br />

Try playing the <strong>Sound</strong> called output random MIDI events and adjust the faders in the virtual control<br />

surface. Double-click on it to edit and look at the parameters of events. <strong>The</strong> Gate parameter is:<br />

1 bpm: (!Rate * 1000)<br />

which generates a trigger at a rate of (!Rate * 1000) beats per minute. <strong>The</strong> Frequency parameter<br />

!Pitch + ((((1 bpm: (!Rate * 1000)) nextRandom * !Jitter * 7)) of: #(0 1 2 3 5 8 13)) nn<br />

is a bit more complicated, so let’s break it down into sub-parts. We can paraphrase it as<br />

!Pitch + nn<br />

and then break down as<br />

of: #(0 1 2 3 5 8 13)<br />

In other words, we compute an index, and then use it to look up the value stored at that position in the<br />

array: #(0 1 2 3 5 8 13).<br />

<strong>The</strong> result is that we will add 0, 1, 2, … or 13 half steps to whatever pitch is being played on the keyboard.<br />

Now, how do we come up with ? We can look at as<br />

nextRandom * !Jitter * 7<br />

In other words, at some number of beats per minute, generate random numbers between -1 and 1 and<br />

multiply them by !Jitter * 7. We multiply by 7 because there are seven entries in the array. Multiplying<br />

by !Jitter allows us to control how much variation there is in the random index generator.<br />

Finally, is<br />

1 bpm: (!Rate * 1000)<br />

<strong>The</strong> first number is the trigger or gate <strong>for</strong> turning on and off the metronome. Since it is a constant 1, the<br />

metronome will stay on all the time. <strong>The</strong> rate of the metronome is going to be between 0 and 1000 beats<br />

per minute, depending upon how you have set !Rate in the virtual control surface.<br />

Extracting Parameters from Audio Signals<br />

Once you have started down the path of pasting <strong>Sound</strong>s into the parameter fields of the MIDIOutput-<br />

Event, another idea immediately suggests itself: what about taking some of the “analysis” <strong>Sound</strong>s, the<br />

ones that track various parameters of audio input, and converting those to MIDI output events?<br />

Tracking Amplitude Envelope<br />

For example, play the <strong>Sound</strong> called track the pulse, and listen to the effect of different settings <strong>for</strong><br />

!Thresh in the virtual control surface. (This works best with a staccato or percussive patch setting on<br />

your external synthesizer).<br />

158

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

Saved successfully!

Ooh no, something went wrong!