|
|
Subscribe / Log in / New account

Development

OpenMusic for Linux

November 26, 2013

This article was contributed by Dave Phillips

On October 28 of this year composer/developer Anders Vinjar posted an interesting message to a mailing list for users of Lisp-based music and sound software, saying: "I've been working on a Linux port of IRCAM's OpenMusic lately and think it's approaching a useful state now." It was a quiet announcement for exciting news. I've installed and tested two previous Linux incarnations of OpenMusic. With all due respect to the previous attempts, this port is the first truly usable version for Linux. To be clear, the current release is a beta version with some stability and performance issues, but in my tests so far it appears that most of OpenMusic's major features are in working order.

Why is this news exciting? To answer that question I have to clarify a few points regarding software for music and sound production. When we consider the variety of available music software we find a cornucopia of programs for recording, editing, and processing your audio/MIDI productions. In contrast, we find fewer applications devoted to the art and craft of music composition. Yes, the modern DAW (digital audio workstation) blurs the distinction, but it's fair to note that a DAW is a generalized application. Notation software can be considered composition software, but its utility is limited to only those with the relevant knowledge of standard notation practice. OpenMusic includes features from DAWs, MIDI sequencers, and music notation software, binding them together into something unique.

What is OpenMusic?

OpenMusic is a Lisp-based visual programming environment designed originally for music composition. Its evolution has added features with significance for graphic arts, musicology, and even mathematics. OpenMusic was created at IRCAM, the famous Parisian institute founded by Pierre Boulez for advanced research into music and acoustics. IRCAM brings together composers and programmers to produce software designed specifically for the techniques of contemporary composition, e.g. algorithmic methods, composition by sonification and mapping, 12-tone and serial methods, spectral analysis and application, etc. This collaboration has produced a rich environment of software for audio synthesis, music composition, and digital signal processing. Composers have produced notable works with this software, and in particular with OpenMusic.

OpenMusic is a descendant of PatchWork, also created at IRCAM. PatchWork presented the model of the patching canvas, a workspace upon which the user places and connects graphic units representing functions and other operations to create data sets in forms useful for music composition. The user connects the units with virtual cables, a process called "patching." By patching together various generative and processing units the user creates a data-flow graph that typically ends by producing one of the program's output target formats such as a WAV or MIDI file. The completed graph is called a patch. OpenMusic has expanded PatchWork's capabilities and is considered its replacement, but the process of patching remains a basic activity of an OpenMusic session.

OpenMusic is open-source software available under the terms of the GPLv3.

Working with OpenMusic

OpenMusic 6.x is available from this page. At the time this article was written, its version stood at 6.7, but the Linux release is in a beta state. The software is currently available only as an RPM package (source for the port has not yet been released), but you can use the alien conversion utility to change it to your preferred package format. The default installation locates the openmusic binary in /usr/bin and places its supporting files in the /usr/share directory.

[OpenMusic workspace] After installing the package you can start OpenMusic by clicking on its desktop icon or by entering "openmusic" in an xterm window. An opening dialog will appear, asking whether you want to invoke a new session workspace or return to an old one. For your first experience, ask for a new workspace. When the program starts you'll see the workspace shown to the right, at which time you can right-click in that space to start a new patch or load a previously created item.

Before going further you should set your preferences in the workspace window. Open the "OpenMusic 6.7" menu and click on the Preferences item. The Preferences dialog customizes various aspects of OpenMusic to your liking, including important path settings, colors, fonts, audio/MIDI features, notation settings, and libraries to load on start-up. I'll have more to say about the Preferences dialog, but at this point you can open a new patch for editing and start rolling with OpenMusic.

I've already described OpenMusic's basic working design and the central importance of the patch. An OpenMusic patch can also include subpatches called "abstractions" that conceal functional units within a patch. Of course these functions could be exposed in the patch, but abstractions reduce screen clutter and help clarify the organization and purpose of the host patch. OpenMusic further extends the original PatchWork model with the maquette (a container for multiple patches) and the sheet, containers for higher-level organization of material.

The image below displays a simple OpenMusic patch; I've added descriptive comments, but to be clear the patch merely adds two numbers then multiplies them by ten.

[OpenMusic patch]

The patch demonstrates the deployment of the generative functions, their connection with virtual cables, and the production of an output value. The comments are presented in different fonts and colors, a nice amenity when clarifying complex patches. Note that the Listener (the application's Lisp console) prints the results first for the addition and then for the multiplication.

So much for using OpenMusic as a desktop calculator. By far the more common employment of OpenMusic is in the domain of music composition; the figure below shows OpenMusic in a more musically productive mode with output in multiple formats:

[OpenMusic at work]
A single core process generates data destined to become a soundfile, a MIDI file, and score files in standard notation, LilyPond code, and Csound's sco format. Though it appears to be rather complicated, this patch is actually straightforward. I borrowed and combined parts from various tutorials to create a sequence of actions from the generation of random number series to the realization of those numbers in the various output formats. In OpenMusic cut-and-paste is your friend, and you should feel free to reuse existing code to practice building patches.

I made liberal use of the "d" key to summon OpenMusic's online documentation for its classes and functions. The information there is sparse, but I was able to learn which data types were generated and accepted by an object's outlets and inlets, necessary knowledge when making and troubleshooting connections between objects in your processing network.

By the way, despite OpenMusic's reliance on Lisp, no knowledge of the language is required beyond the proper formation of data sets, i.e. the correct placement of parentheses. Even that amount of Lisp can be minimized by using objects intended to generate data sets in the correct format. Of course, like any good Lisp-based application, OpenMusic includes a Listener, a direct interface to the Lisp language. From the top down, OpenMusic's Listener window contains the Lisp prompt, a running status area, and an error reporter. If you know Lisp you can add the power of the Listener to your workflow. For example, the OM-SoX library package includes some useful extra code that can be loaded in the Listener — an easy procedure for a Lisp novice — but the process may not be transparent to the Lisp-less. Nevertheless, prior knowledge of the language is not an absolute requirement for productive use of OpenMusic.

Borrowing From The Library

The OpenMusic libraries provide considerable extra power to the basic installation, expanding the environment's capabilities with more exotic processing functions, interfaces to external software synthesis environments, routines for signal analysis and resynthesis, image to sound conversion, and so forth. An OpenMusic external library is similar to a SuperCollider Quark, a loadable extension in the form of a bundle of classes, functions, tutorial examples, source code, documentation, and other resources. Many libraries include tutorial patches listed under the Help menu.

To load an OpenMusic library, open the Library item from the Windows menu, then open the File/Load Library dialog and make your selection. Alternately you can double-click on the library's icon in the dialog GUI. When you first run OpenMusic, it will list only the available internal libraries — a useful set — which are unloaded by default. After you've practiced loading a few libraries you should visit the IRCAM site to see what other libraries are currently available. After installing a new library it will be listed, ready for use. If a library won't load, the system will send a (hopefully helpful) error message to the Listener. If no errors are reported, then that's it, you're free to check out the newly added features.

Some libraries are oriented to a particular approach to using OpenMusic — the OMTristan library, for example, is based on the practices of composer Tristan Murail, while others are more general in scope and application. OpenMusic's packaged libraries are IRCAM-approved and should work with the latest release. Third-party libraries may require changes that may or may not be trivial to make. If you encounter such a library be sure to contact the author about updating his or her software.

From the many excellent libraries for OpenMusic here are some that I've been using frequently:

  • OM2Csound is a freely available library from IRCAM that provides an interface between OpenMusic and Csound, sweet news for Csound users such as myself. The connection is basic, but it works, and if you want a richer set of Csound-related functions, you can purchase the OMChroma library, also from IRCAM. Thanks to developer Jean Bresson, I was able to test an early release of OMChroma 4.1 while writing this article. The library uses a few dozen Csound .orc files — Csound's instrument definitions — that require some simple fixes to accommodate Csound6, after which the OMChroma tutorial patches will run without complaint. As of November 26, OMChroma 4.2 has been released, with support for Csound6.

  • The OMAlea and OMChaos libraries (distributed with OpenMusic) are collections of functions based on chance (aleatoric) and chaotic processes. They're great for generating random numbers in various distributions to be put to use as pitches, rhythmic units, and whatever other musical purpose you can find for them. They are also perfect for exploring the worlds of constrained random number generation.

  • Chris Bagwell's SoX is a well-known multi-platform utility for audio file format conversion, resampling, effects processing, playback/record, and more. I was pleasantly surprised to find Marlon Schumacher's OM-SoX library, an OpenMusic interface to SoX's many useful features. Alas, the library refused to load until I entered this code in the Listener:
    	(setf *all-players* nil)
    

    [OpenMusic with sox] After I ran that command, the library loaded without complaint. I added it to my personal preferences.lisp file to successfully load OM-SoX at start-up, though I still need to specify the location of the sox binary in the Preferences/Externals dialog. When the location is applied soxplayer becomes the default player, overriding the default jackplayer. In my experience so far, soxplayer is the better player, but I may be missing crucial JACK settings somewhere.

    To the right you can see a SoX-based patch made with a SOUND object, the sox-spectrogram object, and a PICTURE box. As I indicated earlier, some of SoX's more interesting functions — such as sox-compand, sox-denoise, sox-reverb and others — must be loaded in the Listener, but the spectrogram is immediately available for use.

  • David Echevarria and Yannick Chapuis designed the OMXmulti library to replace OpenMusic's MULTI-SEQ and POLY-SEQ classes. The XMULTI class retains all features of the original classes and adds many extra features for composers, e.g. chromatic/harmonic transformations (transposition and inversion), temporal and intervallic compression/expansion, an expanded notation symbol palette, and so forth. Thanks to the utility of those features, I find I use this library frequently as I develop a typical workflow with OpenMusic.

With the exception of OMChroma all these libraries are freely available. OMChroma can be purchased from the IRCAM shop, along with a variety of other proprietary OpenMusic libraries created at and maintained by IRCAM. After my satisfying experience with OMChroma I'm definitely interested in checking out some of those other libraries.

By the way, these and other OpenMusic libraries are fun to investigate, but when working on a real project try to restrain yourself from loading any more libraries than you actually need. As developer Jean Bresson advises, having many libraries loaded at the same time may make the system unstable and difficult to debug if things go wrong.

Documentation

IRCAM's official documentation for OpenMusic includes a user-level manual with tutorial patches, a set of introductory videos, and a reference manual for programmers. More material can be discovered out on the net. From my searches I discovered the tutorial videos from fiboribo (aka Federico Bonacossa) and the more advanced material on the Algorithmic Composer Web site. These are first-rate resources that will help bring you up to speed in OpenMusic, consider them both highly recommended.

OpenMusic's Help menus differ slightly with their context. The workspace Help connects the user to the tutorial patches, the users manual (displayed in your system's default browser), and the function reference documentation. The Help in a patch window adds items to display the editor command keys, to show selected class and function definitions, and to abort an evaluation.

You can also access the user-level documentation for any object by selecting it and pressing the "d" key. Control-i will call up further information on a selected object.

OpenMusic has been used by many composers, including Tristan Murail, Kaija Saariaho, Gerard Grisey, and Brian Ferneyhough. IRCAM has published three books focused on the use of OpenMusic in real-world scenarios. The OM Composer's Book is a two-volume set of interviews with composers who describe their use of OpenMusic as a central component in their works. Contemporary Composition Techniques And OpenMusic is another book-length study of works and methods based on OpenMusic, with special attention to the thought and practices of Tristan Murail.

In addition to these resources, you can find many pieces of music composed with the assistance of OpenMusic. Tristan Murail, Gerard Grisey, and Kaija Saariaho are well-represented on YouTube and are often described as "spectralist" composers, i.e. they make use of audio spectra to determine aspects of their compositions, often using OpenMusic's tools for analyzing sound and representing the analysis in a composer-friendly format, typically as SDIF files (SDIF being the "Sound Description Interchange Format"). The data sets derived from the analyses can then be further processed by other OpenMusic objects.

Usability Issues & Tips

The version of OpenMusic described here is a beta version with various unresolved issues. Anders has indicated that some solutions will have to wait for the completion of a new audio/MIDI handler. Meanwhile, here are some tips for dealing with annoyances that may not be due to any problem with OpenMusic itself.

Drag-and-drop has been substantially improved since I tested this version's first beta, but if you have problems with it, or just prefer the keyboard, you'll be glad to learn that the arrow keys and Shift-arrow combinations will move your selections quickly and smoothly.

For Ubuntu users: Canonical's overlay scrollbar can be a frustrating annoyance, often crashing OpenMusic with a single move. The problem almost certainly lies within OpenMusic somewhere, but, even so, my advice is to disable the scrollbar completely with Synaptic, apt-get, or whatever removal tool suits your preference. Remove the widget and all associated libraries. Your windows will now have their normal sliders and scrollbars that do not randomly crash OpenMusic.

Study the preferences.lisp file generated for your workspace. Customizing this file can be very helpful. Some features are not represented in the GUI's Preference dialog or don't persist after you've selected them, but you can set them manually.

Anders welcomes error reports, so save those log files and send them to him when something goes wrong. From my correspondence with him and other members of the crew, it appears that IRCAM is solidly behind this project. They want a fully-operational version for Linux and they have committed resources to make it work, so send in those reports.

Outro

OpenMusic is deep software and I'm only starting to navigate its depths. It's not for everyone and it doesn't suit every purpose, but it is designed for general application as a composer's helper. If you're already into contemporary methods of composition, then you might find OpenMusic a powerful addition to your workflow. On the other hand, if you're new to the worlds of algorithmic and experimental music, OpenMusic makes an excellent learning environment. However you deploy it, OpenMusic is a welcome addition to any composer's software collection. It has already become an essential part of mine.

Comments (4 posted)

Brief items

Quotes of the week

Clearly putting the value of integer expressions into strings is a very esoteric corner case that very few C++ programs need to do, if it is this hard to do it and there is no obvious standard idiom that would work in all compilers and language vintages.
Tor Lillqvist (hat tip to Cesar Eduardo Barros)

We are losing collected collective wisdom at al alarming rate in the GNOME project as people (like myself) become less active and old wiki pages get deleted wholesale as we move to new infrastructure and the content gets "refreshed".

I don't think this is a good thing, but if it's a conscious decision that's one thing. If it's collateral damage and is happening unawares, then it's more serious (and consider this to be calling attention to it).

Dave Neary

I think LibreOffice is a pretty good model for WYSIWYG, apart from not being Emacs.
Richard Stallman

So yes, I'll agree that many people think R is hard. (Many people also think data science is hard, but that doesn't seem to be slowing the field.) I'll also agree that Python is an elegant and popular language useful for data work. I've got nothing against Python; if I had the time, I'd be interested in learning it myself. But it's still a big leap from "R is hard and I like Python" to "Python is displacing R." And as any good data scientist knows, the burden is on the researcher who makes a claim to prove it, not on his or her readers to conduct research in order to find it false.
Sharon Machlis

Comments (9 posted)

Docker 0.7 released

Docker is a system for the creation and deployment of applications within containers; it was covered here in October. The 0.7 release is now available, with a long list of new features, including the ability to run on standard Linux kernels, a fancy storage driver subsystem, better control over networking and communications between containers, and more. "It took us a while to find our bearings and adapt to the new, crazy pace of Docker’s development. But we are finally figuring it out. Starting with 0.7, we are placing Quality in all its forms – user interface, test coverage, robustness, ease of deployment, documentation, consistency of APIs – at the center our development process."

Comments (none posted)

Gnuaccounting 0.8.4 available

Version 0.8.4 of the open source accounting package Gnuaccounting has been released. This version adds support for LibreOffice 4 and Apache OpenOffice 4, support for renaming scanned files by decoding bar codes within the scanned image, and support for the Single Euro Payments Area (SEPA) standard: "Invoice metadata can be added according to the DocTag standard and customer's IBAN and BIC numbers can now be entered in the context of the SEPA-preparations."

Full Story (comments: none)

Newsletters and articles

Development newsletters from the past week

Comments (none posted)

A Summer Spent on the LLVM Clang Static Analyzer for the Linux Kernel (Linux.com)

Linux.com profiles Eduard Bachmakov, a Google Summer of Code student that worked on static analysis for the Linux kernel. "Much work toward creating a static analyzer for the Linux kernel had already been done as part of the LLVM project. One of the goals of Bachmakov's internship was to demonstrate how the analzyer works through a tool that traces where errors come from and creates a report. (See an example of his checker tool, here.) He also set out to make a selection of checkers that make sense within the kernel. “A lot (of checks) while technically correct, don’t apply. Many checks are just omitted because it’s understood that this would never happen,” Bachmakov said. “These are issues that can’t be read from the code. These are things you have to know, so there were a lot of false positives.”"

Comments (6 posted)

Page editor: Nathan Willis
Next page: Announcements>>


Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds