The previous program is transposed to a musical application by associating the om+ function and a first class of musical object : the chord class.
A transposition is a simple musical process that can be analyzed and formalized as a program.
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.
This class belongs to the Score package :
select the Class / Score / Chord
menu item.
click somewhere in the patch editor to add the box.
To view information about the box's parameters, hover the mouse over the inlets while pressing 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. |
To get a mini view of the box, select the box and press To move the staff upwards or downwards :
|
Connect the pitches outlet to the first inlet of om+. To delete the box of the second inlet, select it and press
|
Midicents are the produce of midi values by 100. Choose a medium range : 6000 - 8400 corresponds to the C4 to C6 register. |
To evaluate the first x chord :
v
.Cmd
click on the first outlet – self – to evaluate the whole chord object. It appears in the mini view. To evaluate the pitches, Cmd
click on the second outlet.
The reference of the chord and the pitches are displayed in the Listener.
v
. Possible upstream program will also be evaluated.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.
An elementary item, number, symbol, string. An atom can be part of a list.
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.