Instrument Declarations

Tao provides a set of classes for creating pieces of the material described in section *. Each class deals with a creating a piece of material of a particular geometrical shape, so for example the user can create strings, circular sheets, rectangular sheets and elliptical sheets. The way in which Tao's cellular material is actually implementated provides for future support of irregularly shaped components but in the present version the user is limited to these geometrical primitives.

In practice though this is not a serious limitation since there are many other techniques available for designing interesting instruments. These include damping and locking parts of an instrument and constructing compound instruments by coupling several pieces of material together using Connector devices. All of these techniques provide ample room for experimentation.

In order to create a primitive instrument several pieces of information are required. These include the instrument type, the name by which it will be referred to in the script, its x and y frequencies, and its decay time.

The general form of an instrument declaration is illustrated by the following string declaration:

    String string(<pitch>, <decay_time>);

where String is the name of the instrument class; string is the name of the particular instrument being created; <pitch> defines (indirectly) how long the string will be (the tension in Tao's material cannot be altered so the length of a string is related to its pitch or frequency alone and vice versa); and <decay_time> determines the amplitude decay time of the instrument.

In the next example the placeholders <pitch> and <decay_time> are replaced with typical values which might occur in a script:

    String string(C#5+1/2, 4.5 secs);

In this example the length of the string is set such that its pitch is C sharp plus a quarter-tone (1/2 a semitone) in octave 5, and its decay time is four and a half seconds. The <pitch> argument can be specified in a number of different formats, some of which are directly analogous to those provided in Csound. The other formats are introduced throughout this section by way of example. The format used in the example above is referred to as note name format format.

The <decay_time> argument consists of a numerical constant followed by the units of time, i.e. sec, secs, min, mins or msecs, representing seconds, minutes and milliseconds respectively.

A second practical example is given below, this time creating a rectangular sheet called rect:

    Rectangle rect(200 Hz, 500 Hz, 60 secs);

In this example two pitch arguments are specified, and both are given in frequency format. The first determines the size of the instrument in the x direction and the second, the size in the y direction. It may seem slightly unintuitive at first to be specifying the size of a rectangular sheet in units of Hertz rather than physical dimensions such as metres or millimetres, but this practice is adopted for a number of good reasons:

  1. It makes creating precisely pitched instruments a simpler matter;
  2. Tao's material is not based upon any real-world material so it would be meaningless to talk about a sheet of cellular material 5m by 3.5m;
  3. The instrument is described in units which are of more perceptual relevance to a musician than physical units of size (open to debate).

Another advantage of specifying dimensions by pitch or frequency is that it becomes a simple matter to construct an instrument which has an array of similar components but with different pitches for each. For example the following code fragment creates a set of rectangular components with uniform y dimension but pitches tuned to fractions of an octave for the x dimension. This kind of instrument might be the starting point for some sort of pitched percussion instrument for example:

    Rectangle rect1(8.0 oct, 500 Hz, 60 secs);
    Rectangle rect2(8.2 oct, 500 Hz, 60 secs);
    Rectangle rect3(8.4 oct, 500 Hz, 60 secs);
    Rectangle rect4(8.6 oct, 500 Hz, 60 secs);
    Rectangle rect5(8.8 oct, 500 Hz, 60 secs);
    Rectangle rect6(9.0 oct, 500 Hz, 60 secs);

This example shows yet another form of the pitch argument, i.e. octave/fraction format or oct format for short. In this format the integer part specifies the octave and the fractional part after the decimal point specifies a fraction of an octave.

The previous example opens the way for describing another important technique often used when creating instruments with arrays of similar components. Tao provides an array facility for grouping together such components and giving them a common name. For example the following script code has much the same effect as the previous example but logically groups the six rectangular components together into an array with a single name rect_array:

Rectangle rect_array[6]=
    {
    (8.0 oct, 500 Hz, 60 secs),
    (8.2 oct, 500 Hz, 60 secs),
    (8.4 oct, 500 Hz, 60 secs),
    (8.6 oct, 500 Hz, 60 secs),
    (8.8 oct, 500 Hz, 60 secs),
    (9.0 oct, 500 Hz, 60 secs)
    };

The individual components can be accessed using syntax which will be very familiar to C and C++ programmers:

    rect_array[0], rect_array[1] .. rect_array[5]

The declarations for circular, elliptical and triangular sheets of material follow a similar format to the examples presented in this section, with elliptical and triangular sheets requiring two pitch values and circular sheets requiring only one (determining the diameter).

Examples are given below:

    Circle circle(5.03 pch, 20 secs)
    Ellipse ellipse(6.00 pch, 50 Hz, 1 min + 20 secs)
    Triangle triangle(100 Hz, 6.5 oct, 600 msecs)

These declarations introduce the final pitch notation, octave/semitone format or pch format for short. In this format the fractional part after the decimal point is interpreted as semitones. For example 5.03 pch means the third semitone above C in octave 5. Note that fractions of semitones are also possible. For example 5.035 pch means 3.5 semitones above C in octave 5.

Note also that the different pitch formats can be used side by side in an instrument declaration requiring more than one pitch.


©1999,2000 Mark Pearson m.pearson@ukonline.co.uk April 30, 2000