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.

MIDIFileInterpreter<br />

Events<br />

With a MIDIFileInterpreter, you can read in<strong>for</strong>mation from a MIDI file and process or reinterpret it using<br />

Smalltalk be<strong>for</strong>e mapping it to the parameters of <strong>Kyma</strong> <strong>Sound</strong>s.<br />

Assigning Start Times<br />

Each input of a Script <strong>for</strong>ms the basis of an instrument. An instrument is not strictly a <strong>Sound</strong>; it is a template<br />

that can be used to create any number of instances of its basis <strong>Sound</strong>.<br />

Each event in the Script corresponds to an instantiation (i.e., the scheduling of a specific instance) of one<br />

of the instruments. <strong>The</strong> simplest event is the name of an instrument followed by a start time. For example,<br />

if you had an instrument named anInstr, and you wanted an instance of it to start at time 0, you would<br />

type<br />

anInstr start: 0 s.<br />

Suppose anInstr is based on a <strong>Sound</strong> whose duration is 5 seconds. <strong>The</strong>n the following Script<br />

anInstr start: 0 s.<br />

anInstr start: 6 s.<br />

specifies that you will hear anInstr followed by 1 second of silence followed by anInstr. You can also<br />

make the instances of anInstr overlap, <strong>for</strong> example,<br />

anInstr start: 0 s.<br />

anInstr start: 1 s.<br />

anInstr start: 2 s.<br />

anInstr start: 3 s.<br />

Beats and Metronome Indications<br />

To specify times in beats instead of seconds, indicate the number of beats per minute at the beginning of<br />

the Script. For example,<br />

MM := 90.<br />

specifies that one beat is equivalent to 1/90 of a minute in subsequent events. You can redefine MM any<br />

number of times within a script. If you don’t specify a value <strong>for</strong> MM in a top level Script, it will default to a<br />

value of 60, or one beat per second.<br />

If you are using multiple Scripts or FileInterpreter <strong>Sound</strong>s within a shared top <strong>Sound</strong>, you should explicitly<br />

specify the desired value <strong>for</strong> MM in each script.<br />

Setting Parameters<br />

Parameter:Value Pairs<br />

You can do more than simply assign start times to instruments; if the inputs have variables in them, each<br />

event in the script can also supply parameter values to the variables in the instrument. Any variable parameter<br />

can be set from the script.<br />

To set parameters from the script, type the name of the input, the start time, and then a list of parameter-<br />

Name:value pairs. Each pair consists of the name of a variable in the input and a value <strong>for</strong> that variable.<br />

(To see a list of the variables in the selected <strong>Sound</strong>, choose Get info from the Info menu.)<br />

For example, suppose a <strong>Sound</strong> named anInstr has some variable parameters in it named<br />

?centerFreq, ?dur, and ?bandwidth. Here is an example Script <strong>for</strong> setting the parameters of an-<br />

Instr.<br />

anInstr<br />

start: 0 s<br />

dur: 2 s<br />

centerFreq: 1000 hz<br />

526

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

Saved successfully!

Ooh no, something went wrong!