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.

Another Way<br />

Re-re-turn of phrase shows a variant on this same algorithm. Rather than building up the sequences of<br />

sequences and storing them in different variables, Re-re-turn of phrase uses the Smalltalk control structure<br />

timesRepeat: to repeatedly replace the old phrase with a new phrase:<br />

| thing |<br />

thing :=<br />

EventSequence events: #(<br />

{Note durationInBeats: 2 frequency: 3 c}<br />

{Note durationInBeats: 1 frequency: 3 g}<br />

{Note durationInBeats: 2 frequency: 2 g}).<br />

6 timesRepeat: [<br />

thing :=<br />

EventSequence events:<br />

(Array<br />

with: thing<br />

with: ((thing dim: 0.5) trsp: 7)<br />

with: (thing trsp: -5))].<br />

thing playOnVoice: self bpm: 160.<br />

Embedded Event-like Behavior<br />

Sometimes the “instrument” itself has some event-like behavior buried within it. Play the <strong>Sound</strong> called<br />

PnoToHrp and then open it so you can study the MIDI script.<br />

After all the variable declarations:<br />

| pat1 dblPat group |<br />

the first step is to create an EventSequence and save it in the variable called pat1.<br />

pat1 :=<br />

EventSequence events: #(<br />

{Note durationInBeats: 4 frequency: 4 g}<br />

{Note durationInBeats: (8/5) frequency: 4 b flat}<br />

{Note durationInBeats: (12/5) frequency: 5 c}).<br />

pat1 is a sequence that lasts <strong>for</strong> 8 beats. You could think of it as a whole note in a measure by itself, followed<br />

by a measure containing a half note followed by a dotted half note with both notes under a bracket<br />

labeled 5:4 or “five in the time of four”.<br />

“But,” you are thinking, “it doesn’t sound like that; it sounds more like a group of five, a group of two,<br />

and a group of three.” <strong>The</strong> secret lies buried within the TimeIndex parameter of PNO, a FunctionGenerator<br />

called time index. Take a look at the Gate parameter of time index. It is saying that <strong>for</strong> as long as<br />

the key is held down, the gate should be triggered at the rate of 160 beats per minute — scaled to be a little<br />

bit faster so we can get five beats in the time of four. So whatever pitches this “instrument” plays, it<br />

will play quarter note quintuplets at MM = 160 (something like the notation equivalent of a slash above<br />

the note heads to indicate a 5:4 quarter note tremolo on each note):<br />

!KeyDown bpm: 160 * (5/4)<br />

<strong>The</strong> changing value of the Morph parameter in pno is not controlled by the MIDI script either. Instead, it<br />

is embedded directly in the parameter field as a function that goes from zero to one over the course of 12<br />

seconds (the first 1 just indicates that the ramp should start immediately and continue <strong>for</strong> 12 seconds<br />

rather than restarting each time a key goes down; otherwise, you would replace the 1 with !KeyDown):<br />

1 ramp: 12 s<br />

141

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

Saved successfully!

Ooh no, something went wrong!