This section describes all the stages that compose the programming of a simple patch. A patch, or program, is represented by this icon : . It is the place where almost all programming is done in OM. Patches must be added one the workspace, but you will also find existing tutorial patches on the Ircam workspaces if you decide to install and use them.
To add a patch in the workspace :
choose File / New Patch
press SHIFT
+ Cmd
+ 1
.
You can also open the patch that is provided in the OMWorkspace.
Double click on the "patch" patch.
The patch opens as a new window, called "patch editor", where all programming is done.
OM can perform any type of operation, be it musical or not. To understand the basic principles of programming, let's start with the most simple operation ever, an addition. To do so, we need to add the relevant
operator
in the patch editor. Operators in OM are called functions1. They are accessible via the Functions
menu of the patch editor.
Pick the om+ function in the Functions / Arithmetic
sub menu, which gives access to the arithmetic operators.
Click somewhere in the patch editor : om+ appears . The box has two inlets at the top, and one outlet at the bottom.
In Lisp, "arguments" are the things upon which a function operates. It can be any type of data. "Calling" a function means to evaluate it, or start the computation.
To increase the size of the box, hover the mouse over it and dragg its lower-right corner. |
|
|
Default values are assigned to the arguments2 of a function. To display default values, hover the mouse over inlets. New values must be assigned to the function. |
To display values permanently press Data boxes appear connected to the function's inlets. |
|
|
Data boxes can be resized like the om+ box, and dragged in the editor. To adjust their size automatically, press |
To modify the default values :
|
|
|
You can also click on the corresponding inlet to display the editable text box and enter a new value. It will remain hidden. |
The result of the computation is displayed in the Listener. |
To evaluate om+ :
|
|
To save the patch :
|
A portion of code within a larger program, which performs a specific task. Operates upon 0 or more parameters and returns a value.
An argument represents a parameter upon which a function operates. For instance a function (OM+ x y), has two arguments : x and y.