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.

Like Random, OneOverF generates random numbers between zero and one, but it tends to generate<br />

numbers that are close to one another <strong>for</strong> awhile, then make a large jump to a new number, then generate<br />

numbers close to that one <strong>for</strong> awhile, etc. It gets its name from the shape of the distribution in the frequency<br />

domain: 1/f or the inverse of the frequency; in other words, there tend to be large, slow changes<br />

and small, fast changes. To hear what this sounds like, play 200 oneOverF. Try changing the value of the<br />

seeds to hear a different set of events.<br />

Controllers<br />

Event Collections<br />

Play 100 uni<strong>for</strong>m + ctrl and then open it to see an example of how to specify continuous controller values<br />

in a MIDI script. Here the controller !Morph is set to 0 at the beginning and is told to slide from its previous<br />

value to a new random value on each note taking 10 steps to get there:<br />

| r t |<br />

r := Random newFor<strong>Kyma</strong>WithSeed: 2.<br />

t := 0.<br />

self controller: !Morph setTo: 0 atTime: 0 s.<br />

100 timesRepeat: [<br />

self<br />

keyDownAt: t s<br />

duration: (r next + 1) s<br />

frequency: 3 c + (r next * 36 nn)<br />

velocity: r next.<br />

t := t + r next.<br />

self controller: !Morph slideTo: r next steps: 10 byTime: t s].<br />

Next, play 200 oneOverF + ctrl and then open it to see how it works. In this script, !Morph is set to zero<br />

initially, and then slides to a value of one over the course of 40 seconds.<br />

Sometimes it is more convenient to specify the MIDI events as collections of notes and rests, without<br />

having to specify start times <strong>for</strong> each event. <strong>The</strong> actual start times can be inferred from the duration of the<br />

Note or Rest and where it occurs in the collection of events. This corresponds more closely to written music<br />

notation, where note and rest symbols arranged horizontally are interpreted as a sequence of events in<br />

time (where each event’s start time occurs right after the previous event’s duration has expired), and<br />

notes or rests arranged vertically are interpreted as all starting at the same time.<br />

In the MIDI script language, an EventSequence is a collection of Notes, Rests, or other EventCollections<br />

that occur one after another in time (corresponding to horizontal placement in music notation). Since you<br />

can also construct sequences of other collections, you can create higher level structures as well. For example,<br />

sequences of Notes and Rests could be collected in a measure; sequences of measures could be<br />

collected into a phrase; sequences of phrases could be collected into sections; sequences of sections could<br />

be collected into movements, etc. until you run out of traditional musical names <strong>for</strong> the structures(!)<br />

An EventMix is a collection of Notes, Rests, or other EventCollections that occur all at the same time<br />

(corresponding to vertical placement in music notation). Like an EventSequence, the EventMix is recursively<br />

defined (i.e. you could have an EventMix of EventMixes), allowing you to define hierarchical<br />

structures, somewhat analogously to the way you can define <strong>Sound</strong>s.<br />

You can also create a generic EventCollection of Notes, Rests, or other EventCollections, specifying that<br />

you haven’t yet decided whether the events should be simultaneous or sequential but will send a message<br />

to the object later to specify actual start times and turn it into a sequence or a mix of other events.<br />

EventSequence<br />

Play the <strong>Sound</strong> called re-turn of phrase, and then open it so you can study the MIDI script (by the way, in<br />

case you missed this earlier, you can use Ctrl+L to make any parameter field larger — an essential little<br />

feature <strong>for</strong> viewing and editing these scripts).<br />

139

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

Saved successfully!

Ooh no, something went wrong!