OpenMusic

Visual Programming | Computer-Assisted Composition

Navigation : Previous | Next

Lisp Code in OM

Use of User-Defined Lisp Functions in OM

Example

All functions and classes defined and evaluated in the Lisp editor can be used in OM patches immediately.

  1. Evaluate the function or class in the Lisp editor.

  2. Cmd click in the patch and type the name of the function or class.

See also

Package Name

The default package of a function or class edited in the Lisp Editor is the Cl-user package. In this case, its name must be preceeded by “cl-user::”.

To be able to type a name directly in the patch editor, add “(in-package :om)” before the corresponding code in the lisp editor.

Zoom

Reloading Patches

User-defined functions or classes can appear as “dead boxes” if the patch they belong to is saved and reloaded at another OM session. You will then have to reload the function or class.

It is advised to create user libraries : your own Lisp classes and functions will be preserved and available for use at any time.

Dead Boxes

User Libraries in OM

Loading Lisp Code in OM

There exist several ways to load existing Lisp code in OM :

—|—

Listener and Lisp Editor

—|—

—|—

—|—

Create Your Own Library

Finding OM Functions Sources

To access the source code of a component within a patch, select it and press e. It will be displayed when available.

Access Conditions

The source code is accessible if the function or class is

—|—

The source code is not accessible if

—|—

Redefining Sources : Find Source Utility

The sources of existing OM functions can be found, edited and reevaluated with the ** Find Source ** utility. Nevertheless, it is advised to copy, rename and modify these functions. This allows to avoid disorders or conflicts, and to track and reload changes at the next session.

References :

Contents :

Navigation : Previous | Next