A tale of two sequencers

Benefits for LWN subscribers The primary benefit from subscribing to LWN is helping to keep us publishing, but, beyond that, subscribers get immediate access to all site content and access to a number of extra site features. Please sign up today!

There are a number of interesting components in a typical Linux audio tool chain, only some of which actually create sound. This article will look into harmonySEQ and SoftWerk , an interesting pair of MIDI sequencers. These programs record and play only MIDI data — they have no integrated audio capabilities — and they favor interactive realtime composition by combining looping musical patterns. Both programs also build their user interfaces with GTK, but we'll see how each program's interface is designed in accord with its fundamental approach to MIDI sequencing.

The standalone MIDI sequencer has been superseded by the audio/MIDI digital audio workstation but there's life yet in the old design. Many composers work only with MIDI-based systems — MIDI favors discrete note-like events, what my composition teacher called the "pitches & rhythm" model — and despite its age MIDI is still a powerful force throughout the music industry. Thus, interest in the specification remains high and development continues.

Throughout this article I use terminology specific to MIDI. If you don't know anything about MIDI I suggest that you read the excellent Wikipedia summary for some relevant background. In brief, MIDI is a specification for a common messaging protocol and hardware implementation for devices manufactured by different companies. The messaging protocol includes various commands that instruct a receiving device — hardware or software — to perform actions such as sounding a note with a particular loudness ("velocity" in MIDI parlance) on a specific instrument ("program change").

The MIDI message format is flexible; for example, the note-on message format includes values for pitch and loudness, while the program change sends only a value for instrument selection. Most messages also include a channel value that assigns the message to one of sixteen MIDI channels. Thus, if the MIDI-compliant device (e.g. a synthesizer) receives a note-on message on its configured channel it should play a note with the specified pitch and loudness levels. The receiver stops playing when it receives a message to cease: either a note-off message or a note-on with a loudness of zero.

The note-on message described above is one of the common MIDI messages. The specification also provides message formats for data streams from pitch benders, keyboard aftertouch, and modulation wheels, devices known as "continuous controllers." System-exclusive (a.k.a. "sysex") messages have a special format with nothing defined beyond an initial identifier and a message end point. The identifier tells the receiver what kind of device it expects — a Yamaha SY99, for example. If the receiver is the intended target then it will process the data between the start and end markers. Typically a sysex message contains device-specific data not carried by standard MIDI messages. Often it is the only means of reaching certain parameters of a device, but sysex messages must be used with some caution. MIDI is a serial protocol, and sysex messages are variable in length. They should be placed carefully in the data stream to avoid delays in the timing of other messages.

MIDI was designed originally to connect synthesizers from various manufacturers, but it quickly found its way to the personal computers of the late 1980s. In turn, the functions of the hardware synthesizers migrated to the computer, until at last we arrive at the present day's primacy of the software synthesizer. Nevertheless, MIDI retains its viability for internal as well as external connectivity, and it shows no signs of losing its place as an industry-wide standard.

It is important to understand that MIDI is not an audio format. As described above, the MIDI stream itself is a simple switching protocol, common MIDI messages merely instruct a sound-producing instrument to produce an audible output. Thanks to the nature of the message format MIDI can also be employed to control light displays, audio mixer elements, karaoke visuals, and other hardware and software targets that have little or nothing to do with making sound.

Connections

Neither sequencer includes a built-in sound source, so you'll need a software synthesizer and/or an external hardware synthesizer, and you'll need a way to connect the output from the sequencer to the synthesizer's input. Minimal requirements for external connections include an interface with MIDI ports, a MIDI-equipped synthesizer, and the cables to connect the two. Internal connections are considerably easier to make. Install one of excellent native Linux synthesizers — QSynth is my default selection — then start JACK, preferably with QJackCtl. Start your synth, open your sequencer, then connect everything — audio and MIDI — in QJackCtl's connections panels. Now you can start having some fun with these sequencers.

A few more words about MIDI connections and JACK: QJackCtl's connections panel displays tabs for MIDI and for ALSA, a possibly confusing arrangement. Both are MIDI connection tabs, but the first is for clients written for connection via JackMIDI, a sample-accurate MIDI transfer mechanism. The MIDI panel is also where connections will appear if you've selected the raw or seq MIDI driver in the QJackCtl Setup dialog. However, those drivers have been deprecated in favor of the a2jmidi bridge software. The ALSA tab provides plain vanilla ALSA connectivity. I use JackMIDI whenever possible, but the ALSA tab is still helpful where there is no special need for absolute timing accuracy or when I'm working in a non-JACK environment.

HarmonySEQ

Rafal Cieslak's harmonySEQ is a pattern-based MIDI sequencer with some unique features. Certain aspects of its design remind me of Dr. T's KCS, a keyboard-controlled sequencer that permits the creation of sequencers within sequencers. In harmonySEQ each sequencer has its own event pattern and each pattern has its own meter and duration. Transposition, mute/solo, pattern edits, and other aspects of a sequence can be changed during performance, and a flexible events-action system lets the user trigger sequencers through keypresses, MIDI notes, and other user-assigned operations. Of course, all your work can be saved and reloaded for editing and replay.

The current public release of harmonySEQ is version 0.16 with installable packages available for Ubuntu, OpenSUSE, and Fedora. Suitably motivated users can build the program from the release source package or from its Launchpad repository. After installation you can start harmonySEQ from a shell prompt or by clicking on its start-up icon.

HarmonySEQ opens first to an empty display. Click on the "Add Note Sequence" icon (identified by its tooltip, there is no corresponding menu item) to create the new sequence display seen to the right. The harmonySEQ UI is divided into five sections — the top menu bar, an icon bar, the sequencers list, the sequencer properties panel, and the event-action list. Tooltips will appear by default, and I suggest leaving them on until you're familiar with the program. Documentation is non-existent at this point in harmonySEQ's development, but the tooltips, the clarity of the GUI, and a little experimentation should provide enough information to get started.

Basic operation of the program is straightforward. MIDI events are entered into the pattern grid in the "Sequencer Properties" panel by recording from an external MIDI controller, a virtual keyboard, or by left-clicking on a box in the grid (right-clicking removes an entry). Sequences may be polyphonic, provided that your synthesizer(s) can handle the note density. A looping sequence can be toggled on or off, or you can play it through in a single pass. All sequence parameters can be edited in realtime, including timing and rhythmic elements.

HarmonySEQ also provides a GUI for creating control sequencers; these consist of graphic control curves for MIDI continuous controllers that are applied to synthesis parameters such as filters and low-frequency oscillators. This feature is a powerful aid when making music that employs filter sweeps and other dynamic effects that require precise placement. Most sequencers include some kind of GUI for making controller curves, but harmonySEQ's is the simplest and most effective implementation I've encountered.

You can play your sequences by clicking on the "Sequence On/Off" toggles in the main display, but to really tap into harmonySEQ's power you'll want to investigate the "Event/Action" dialog. This panel lets you assign keypresses or MIDI messages to various actions that control sequence playback. For example, in the example to the right I've assigned keys to toggle playback of each sequence. I can trigger sequences in any order or combination I want, and I can press multiple keys to trigger groups of sequences.

The "Event/Action" facility is a great tool for improvisation and performance, but it has its problems. You must be sure that no other panel is active, otherwise your keystrokes will be entered into number boxes or other places where their effect may be undesirably surprising. Not every key assignment behaves as advertised, and sometimes the program throws a stuck note into the works. (Thank goodness for QSynth's Panic button.)

As a MIDI-only sequencer, harmonySEQ includes no built-in instruments. As shown to the right, my usual setup employs QJackCtl to connect harmonySEQ to QSynth loaded with a soundfont compatible with the General MIDI Specification. QSynth's output is routed through the CAPS Versatile Plate Reverb LADSPA plugin in the JACK Rack — I prefer the plugin over QSynth's on-board effect — and the rack's output is sent to the system's audio out ports. A more experimental setup routes harmonySEQ into the Festige launcher for Windows VST/VSTi plugins, with or without the effects in the JACK Rack.

To get an idea of what can be done with harmonySEQ I recommend listening to some of the demos on its Web site. In particular, the examples by Louigi Verona show off what can be done with this little gem. HarmonySEQ has some features that blend nicely with Louigi's musical inclinations.

HarmonySEQ has great potential, and Rafal has indicated that he has plans for further versions. Unfortunately development is frozen until he finds the time and/or assistance to carry the project forward. Meanwhile, harmonySEQ is useful now, the source code remains available, and collaboration is welcome at all levels.

SoftWerk

Many years ago the Doepfer Musikelektronik company manufactured a hardware MIDI sequencer called the Schaltwerk. The unit was a powerful tool for composing with looping patterns. The Doepfer information page describes the Schaltwerk as:

"... an input and controlling instrument for rhythmic trigger patterns, arpeggios, analog sequences, chord triggers and other rhythmic structures whereby all functions are available simultaneously. The real time access to all 8 tracks predestinates SCHALTWERK for improvisation and live events."

Predestined it may have been, but if you want one now the Schaltwerk is available only as vintage gear, rather hard to find, with reported prices ranging from US$400 to $1600. Considering the Schaltwerk's scarcity and cost, perhaps you should look instead at Paul Davis's SoftWerk, a software emulation of the Doepfer hardware's capabilities with some very fine features of its own. It's also much easier to find and costs $0, a considerable savings.

I say it's "easier" to find, but it's unlikely that you'll discover SoftWerk in your Linux distribution's official packages. I found a PKGBUILD for it in the Arch users' repository but not in the package lists for my Debian Squeeze and Ubuntu systems. Fortunately SoftWerk is light on dependencies and easy to build and install. A source tarball is available at http://ardour.org/files/softwerk-3.0.tar.bz2 and a recommended patch can be downloaded from the same location. Apparently the patch isn't absolutely necessary — an unpatched SoftWerk builds and runs without trouble on my Debian machine — but if you have problems building the program on an up-to-date system, apply the patch and rebuild.

After installation, enter softwerk at the shell prompt. If all goes well, the program will open to its default state with eight tracks ready and waiting for your input. Make your audio and MIDI connections in the same manner described above for harmonySEQ, and the fun will begin.

Like its hardware model, SoftWerk is styled after a pre-MIDI analog sequencer, with no piano-roll display. Instead, a series of values is entered into a track-like display, then rhythm rules are applied to the series — i.e. the sequence — to create a looping phrase. The loop may be directed to repeat itself in a variety of ways, such as playback straight through from start to finish, playing from beginning to end then reversing the series from end to beginning (also called ping-ponging), and playback in random order. Empty steps can be added to the pattern to emulate musical rests, track and sequence length phrase can be adjusted as needed, and everything that can be controlled is controllable in realtime.

The unfortunately out-of-date SoftWerk home page includes a single page of documentation with some advice about using the mouse and keyboard to facilitate numerical entry. Beyond that useful information you're on your own. Fortunately SoftWerk's GUI is easy to learn. The "Mode Selector" defines the type of output message assigned to the sequenced events. By default, it's set to Relative Pitch, but the selection includes a variety of MIDI messages, including note on/off, pitch-bend, program change, and continuous controller values. Sequence event values may be entered by hand, or you can choose a scale from the "Mode Fill" menu (it includes a random fill). I have a lot of fun with one track defined to produce notes and another defined to create random program changes. Both tracks are assigned to the same MIDI channel, and each runs with its own timing. I can redefine the program change values — or any other value displayed — at will in realtime, singly or for the entire group.

Global tempo is set with the tempo slider. Each track has a ticks-per-beat regulation of events instead of the conventional beats-per-measure. This method is simple to learn, but it permits very complex rhythmic relationships between tracks. As its author writes, "SoftWerk is specifically designed to accommodate such structures."

When you're ready to store your work, your sequence tracks are saved as a "pattern". All tracks are saved at once; there is no facility for saving or exporting a single track from the sequencer. However, you can arrange your patterns in sets with an autoplay feature that starts playback as soon as a new pattern is loaded into the sequencer. The pattern file manager has few features, but it suffices — barely — as a playlist for live performance or as a formal composition tool to create definite sequences of patterns.

SoftWerk can be used in a deterministic manner, but its true capability is as a software instrument for realtime improvisation and composition. Alas, there will be no further development of SoftWerk, but at version 3.03 it is a mature work. All it needs now is your input, so put on your creative hat and check it out.

Outro

HarmonySEQS and SoftWerk are only two of the sequencers listed on the applications pages at linuxaudio.org. If you're not happy with those two, check out OOM or the non-Sequencer. Even in the audio domain, if it's Linux it's about choice.