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.

quantizeTo: 0.5<br />

maxSpacing: 1.<br />

You specify the total duration in beats of the result, the smallest distance between beats (with the quantizeTo:<br />

argument) and the longest time between beats (the maxSpacing: argument).<br />

Alternatively, you can choose the starting beats with one random number generator and the events using<br />

another, <strong>for</strong> example:<br />

(EventCollection events: anArray)<br />

randomizeTimesUsing: (Random newFor<strong>Kyma</strong>WithSeed: 561)<br />

pickingEventsUsing: (OneOverF newFor<strong>Kyma</strong>WithSeed: 17661)<br />

totalBeats: 16<br />

quantizeTo: 0.333<br />

maxSpacing: 1.<br />

Manipulating Event Collections<br />

All event collections can be manipulated in various ways:<br />

anEventCollection dim: aScale.<br />

anEventCollection trsp: aTransposition.<br />

anEventCollection inv: aPitch.<br />

anEventCollection retrograde.<br />

dim: applies a scale to the duration of each event in the collection, trsp: transposes each event in the<br />

collection the given number of half-steps, inv: inverts each event in the collection about the given pitch,<br />

and retrograde reverses the time order of the event in the collection.<br />

Finally, to actually output the events <strong>for</strong> the MIDIVoice to play, use:<br />

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

Scripts and FileInterpreters<br />

Script<br />

Scripts and the FileInterpreters are <strong>Kyma</strong> <strong>Sound</strong> classes that enable you to construct <strong>Sound</strong>s algorithmically.<br />

Both Scripts and the FileInterpreters take inputs that can include both <strong>Sound</strong>s and lifted <strong>Sound</strong>s. In<br />

a Script, you can combine and manipulate the inputs using Smalltalk. TextFileInterpreters and MIDIFile-<br />

Interpreters let you use Smalltalk code to interpret data from text files and MIDI files.<br />

A Script <strong>Sound</strong> lets you refer to its inputs by name, assigning them start times and parameter values. In<br />

this respect, you could think of the inputs as “instruments” and the start time and parameter value assignments<br />

as the “score” (similar in some respects to the instruments and score of a Music–N language).<br />

Unlike Music–N, however, a Script lets you use Smalltalk as part of the score. <strong>The</strong> script is not just an<br />

event list; it is a Smalltalk program. So you can think of the Script as being more than a score; it is a tool<br />

<strong>for</strong> constructing complex <strong>Sound</strong>s algorithmically.<br />

In <strong>Kyma</strong>’s version of a “score,” not only can you supply start times and other parameters to an instrument,<br />

you can also change the instrument itself from the script.<br />

TextFileInterpreter<br />

Using a TextFileInterpreter <strong>Sound</strong> you can read and interpret text files. One application of the TextFileInterpreter<br />

is to use a score file from a Music–N language (like Csound) to control <strong>Kyma</strong> <strong>Sound</strong>s as its<br />

instruments. A TextFileInterpreter, however, is not limited to reading Music–N scores. In fact, you can<br />

use it to map any data to the parameters of a <strong>Sound</strong>. This capability makes a TextFileInterpreter useful <strong>for</strong><br />

data sonification and generating signals <strong>for</strong> psychoacoustic experiments.<br />

525

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

Saved successfully!

Ooh no, something went wrong!