Recherche Google
OpenMusic QuickStart
previous pagenext page

Transposing a Chord

The previous program is transposed to a musical application by associating the om+ function and a first class of musical object : the chord class.

Formalizing a Musical Process and Implementing it as a Visual Program

Formalization

A transposition is a simple musical process that can be analyzed and formalized as a program.

  • Transposition is the translation of a pitch over a given interval .
  • A chord  is a set, or a list of one or more simultaneous pitches. Pitches and intervals are expressed in midicents, that is numeric values.
  • C4 = 6000, a semitone = 100 cents. Note that in OM, a chord can have a single note, and a list can have a single item.
  • Transposing a chord thus means that one value is added to a list of value.

In terms of Lisp, this means we have to take two arguments : on one hand, a list  of numbers – the x chord –, and on the other hand, a single number or atom1, – the  y interval –, and assign them to a function that performs additions : om+.

Let's first make sure that om+ can add a single number to a list of numbers.

If we select om+ and press d, we get information about the type of parameter, or arguments accepted by the inputs of the function. Indeed, inputs accept single numbers or lists.

We can also get shorter tooltips by pressing Cmd and hovering the mouse over inlets and outlets.

Indeed, om+ can add a "self" to a number. This means it can add a list of numbers to another number, for instance. We can now add a chord box in the patch editor and manipulate it.

Designing the Program in the Patch editor

1. Accessing the Chord Class

This class belongs to the Score package :

  1. select the Class / Score / Chord menu item.

  2. click somewhere in the patch editor to add the box.

2. Parameters of the Chord Factory Box

To view information about the box's parameters, hover the mouse over the inlets while pressing Cmd.

The second input corresponds to the pitches parameters, expressed in midicents. "Midic" stands for midicents.

Note that the default pitch value of the chord class is a single note, a C4, or 6000 midics.

3. Displaying the Musical Object

To get a mini view of the box, select the box and press m .

To move the staff upwards or downwards :

  1. select the box,

  2. press alt + the and keys.

4. Connecting the Chord Box to Om+

Connect the pitches outlet to the first inlet of om+.

To delete the box of the second inlet, select it and press

  • Backspace
  • Cmd + x.
5. Editing the Pitches
  1. Define the pitches : enter values in the second inlet of the chord box.

  2. Define the transposition interval : enter values and in the second inlet of OM+.

Midicents are the produce of midi values by 100. Choose a medium range : 6000 - 8400 corresponds to the C4 to C6 register.

6. Creating the Chord Instance
  • To evaluate the first x  chord :

    • select it and press v.
    • Cmd click on the first outlet – self – to evaluate the whole chord object. It appears in the mini view.
    • An instance2 of the "chord" class has been defined.
  • To evaluate the pitches, Cmd click on the second outlet.

    The reference of the chord and the pitches are displayed in the Listener.

Evaluating a Box, Evaluating an Outlet
  • To evaluate a box, select it and pressv . Possible upstream program will also be evaluated.
  • To get the value of an output, Cmd click on it. The result will be displayed in the Listener. The whole instance will be entirely evaluated too.

For instance, the 1st outlet of a chord corresponds to the whole object, the 2nd to the pitches, the 3rd to the onsets, the 4h to the durations, the 5th to the dynamics, and the 6th to the midi channels. The evaluation of an outlet calls the evaluation of the whole instance, which affects its representation.

  1. Atom

    An elementary item, number, symbol, string. An atom can be part of a list.

  2. Instance

    An actual object created at runtime, out of a given class. In OM, more specifically, an object created when evaluating a factory box. An instance can be saved as a global variable.

    SHIFT click on an outlet – especially the first outlet representing the self, the whole object – of a factory box to materialize an instance.

previous pagenext page
About...(c) Ircam - Centre PompidouMade with Scenari