An instance is an exemplar of a class of objects. Instantiation is the process of creating an instance out of a factory box.
A factory box has a number of slots, represented by inputs and outputs. Once values are assigned to the slots or parameters of a factory box, it can be evaluated to produce an instance1, an exemplar of a class.
Note that the value of a factory box can also be defined via its editor.
![]() | The first input / output of a factory box is usually called "self". It stands for the object itself. A "self" input can be connected to :
Reciprocally, the evaluation of a "self" output, or its connection to another box returns the computed object itself. |
Sometimes, a simple value, or a different type of object, can be connected to a "self" input. | ![]() A data box is connected to the "self" of a chord box. The "self" of a chord box can create an instance out of a simple pitch value. |
In this case, when compatibility allows it, OM automatic converts objects and creates an instance of the relevant class.
The merger function builds a chord-sequence, or chord-seq4 , out of two other chord-sequences given as arguments5.
![]() |
|
The two initial chord-seqs are locked to preserve their value. Conversely, the box that is to be evaluated isn't locked, to take the result of the upstream computation into account.
To evaluate a whole box, select it and press Its value is computed, and the result of the "self" output, that is, the reference of the resulting instance1 is displayed in the Listener. | ![]() |
To reset a box to its default state, press SHIFT
+ i
.
The other inputs and outputs represent the various parameters, or class slots, used for defining an instance.
Inputs and outputs respectively address the same parameters – and follow the same ordering.
To get information about the qualities of a slot, keep pressing Cmd
while overing the mouse over an input or output.
![]() Building a chord with two of its parameters : a list of pitches (6000 6800) for C4 and G#4, and a list of note velocities – dynamics – (100 50). | Input values must be specified to define an object. Several parameters can be set or connected at a time. If no value is specified, the default value of the input is applied. |
An object can be created directly from the "self" input value, and from the other input parameters. By convention, "self" has priority over the other inputs, whose values are ignored. | ![]() Different values have been assigned to the "self" and "pitch" inputs. The value of the "self" input is applied for the instantiation. |
The different outlets of an object can be used for reading the values of its attributes. Outputs can be connected as parameters to other factory or function box inputs.
To evaluate the value of an output, Cmd
click on it. The whole box is evaluated and a specific instance of the class is created.
The second input represents the pitch value of a note box.
| ![]() |
The current value of a factory box can be exported or imported as a file to or from any location in the computer. Exporting an instance is a means to preserve the musical result of a computation.
Both procedures take place in the patch editor, via a contextual menu. Instances are identified by the .omi extension – "i" for "instance".
To export the instance, or to import an instance in the box, Ctrl
/ right click on a factory box.
Choose a directory for location, or a .omi file to import.
By default, OM offers to locate the exported file in the last folder where items were saved.
Nevertheless, it may be more convenient to create an instance box1 out of an instance. Instance boxes can be saved as global variables6 in a dedicated package of the Library, the Globals package.
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.
In object oriented programming, a slot represents and attribute of a class. For instance, the class "note" in OM has 4 slots : pitch, duration, velocity, and MIDI channel.
A category of objects sharing common properties – characteristics and behaviour. A class specifies the internal structure and behaviour of an object. In OM, it is represented in a patch by a factory box that can produce an instance of a class.
See also : Object, Instance
OM name of a chord sequence. By extension, a note sequence, since a single note can be considered a chord.
An argument represents a parameter upon which a function operates. For instance, the (om+ x y) function has two arguments : x and y.
An instance of OM object that has been saved in order to be used in other programs. Global variables are visible from the Library
window and stored as .omi files in the Globals
folder of the workspace.