Linux MIDI: A Brief Survey, Part 3

by Dave Phillips

In this installment of my survey of Linux MIDI software, I profile various MIDI utilities, some of which have become indispensable components in my own Linux MIDI studio.

System Exclusive Messages and MIDI Patch Editors/Librarians

As I already have mentioned, the Old School MIDI studio was more hardware-centric than is today's software-based studio. Sequencers, synthesizers, samplers, MIDI-controllable mixers, MIDI channel routers and MIDI event processors all were available as useful boxes, lending greater flexibility to your studio setup. A common characteristic of most of these devices was the ability to dump the machine's internal settings and states into a type of MIDI message format called system exclusive. Sysex, as it's commonly called, is a way for MIDI equipment manufacturers to accommodate features specific to their designs; that is, sysex code is manufacturer-specific, so the sysex messages that work for a Yamaha synth are meaningless to a Roland synth. Going further, we find that sysex messages are device-specific as well, so the sysex calls to a Yamaha TX81Z are meaningless to my Yamaha TX802.

Sysex is especially important with regards to synthesizers and other "patch"-oriented devices. For example, my Yamaha DMP11 is an 8-channel MIDI controllable mixer with many features, some of which are accessible only by way of sysex commands. More importantly, the only way to back up my custom patches and settings for this mixer is by using sysex.

By using the sysex codes for a device, MIDI programmers are able to write a type of MIDI software known as a synth editor/librarian. Software of this type that attempts to address a variety of machines is known as a universal editor/librarian, and the devices addressed may include machines other than synthesizers. Writing a decent universal editor/librarian is a non-trivial task: the programmer must know the sysex codes for many machines, and he then must devise workable interfaces for each one. Because every synthesizer is a unique device, many interfaces to programs must be included in order to accommodate a wide range of features. These features include typical stages, such as envelope generators and oscillator definitions, as well as less common features, such as microtuning tables and keyboard scaling maps.

Unlike common MIDI messages, a sysex command has a relatively loose construction, based on the following fixed aspects:


  f0	begin sysex
  ..	manufacturer and device IDs
  ..	any number of bytes
  f7	terminate sysex

System exclusive messages typically are represented in hexadecimal notation.

Manufacturer IDs are registered with the MIDI Manufacturers Association. The following example shows a message that prompts my Yamaha TX802 to do what is known as a bulk dump--all internal states and settings are dumped out the machine's MIDI out port :


  f0 43 20 00 f7

where:


  f0  Start sysex command
  43  Yamaha manufacturer ID
  20  Voice memory bulk dump request
  00  Device number
  f7  End sysex command

This message is answered with another sysex message, filled with some number of bytes that represent the patch memory of the machine (all patches). Unlike most other MIDI messages, sysex messages can be any size. This feature is handy for patch editing, but it also can cause a timing problem when you want to insert a lengthy sysex message into a real-time MIDI data stream.

The following sysex example sends a parameter change to the active patch, what Yamaha calls a voice:


  f0 43 10 01 06 00 f7

where:


  f0 Start sysex
  43 Yamaha ID
  10 Device & channel number
  01 Parameter group/subgroup
  06 Parameter number (here, Algorithm Select)
  00 Data (here, algorithm #1)
  f7 End sysex

Thus, this message switches the FM algorithm of the active voice to algorithm 1. Thanks to its size, you are likely to have fewer timing problems when inserting brief parameter changes messages such as this one into a MIDI data stream.

A universal editor/librarian is valuable software if you have any external MIDI equipment, but as I mentioned, writing such software is a non-trivial task. Thankfully, an excellent project is available for Linux MIDI musicians working with hardware synths and other devices: JSynthLib.

JSynthLib

JSynthLib is a Java-based universal editor/librarian for Windows, Mac OS X and Linux. The last public release is version 0.18, dated March 2004, but be advised that JSynthLib is an active project; it simply moves slowly. The developers state that JSynthLib should be considered beta software, but I found it to be useful and stable already under Sun's JDK 1.4.

JSynthLib currently supports 30 devices, mostly synthesizers, with more in CVS. Manufacturers represented include Alesis, Korg, Kawai, Roland and Yamaha; check the JSynthLib Web site for the most up-to-date list.

Fortunately for me, I own two synthesizers on the current list, a Yamaha TX802 and a Kawai K4r. The screenshots below show JSynthLib at work with my synths, demonstrating the primary virtue of the universal editor/librarian--organizing the synthesizer's editing capabilities and representing them in a full-screen display. A universal editor/librarian does not give your equipment new capabilities, but it does make it far easier to understand how your synth works, giving you greater control over its capabilities.

Linux MIDI: A Brief Survey, Part 3

Figure 1. JSynthLib and the Yamaha TX802

Linux MIDI: A Brief Survey, Part 3

Figure 2. JSynthLib and the Kawai K4r

This profile is not intended to be a tutorial, so if you want to learn more about JSynthLib and how to use it, download and install it yourself. You need a recent version of Java to use with JSynthLib, but fortunately all this is easy to do. Again, see the JSynthLib Web site for details.

Other Editor/Librarians

JSynthLib is not alone. The SynthEd Project intends to provide another cross-platform universal editor/librarian for MIDI musicians, but it uses XML and Python instead of Java. The project still is in the planning stages, although screenshots of working prototypes can be viewed on the SynthEd Web site.

Raw sysex utilities simply transmit and receive bulk dump requests, but they provide no editing facilities. These utilities are useful when you have no other way to back up your patch and bank data. Tim Thompson's ancient glib (no, not that one) is a raw sysex utility that may be useful on the command line. However, the more modern Linux MIDI musician probably will prefer to use Christopher Nitschkowski's SysExxer, a nice GUI for sysex bulk dump management (Figure 3), or Patrick Holzhuizen's Java-based MIDI Backup utility (Figure 4).

Linux MIDI: A Brief Survey, Part 3

Figure 3. SysExxer

Linux MIDI: A Brief Survey, Part 3

Figure 4. MIDI Backup

A few machine-specific editor/librarians are available, including Chris Wareham's AlphaJuno software for the Roland Juno 1, Juno 2 and MKS550 synthesizers; Olivier Delhaye's MC303 bulk dump utility for the Roland MC303 drum machine; André Majorel's dx7bag command-line tool for receiving bank dumps from the Yamaha DX7/DX7II synthesizer family; and Marc Halbrügge's KurzFiler librarian for the Kurzweill K2000.

I can't leave this topic without mentioning ALSA's useful amidi, a command-line tool that can be used to initiate and receive sysex messages. Amidi's basic use is as simple as the following example :


amidi -S f0 43 10 01 06 00 f7

This command sends the algorithm change described above. For more details about amidi, run man amidi at the command prompt.

Midirgui

Josep Andreu (aka holborn) has written some excellent MIDI software for Linux, all of which exploits the FLTK GUI toolkit. Among his creations you can find a MIDI channelizer, midirgui, and a software MIDI control surface, mcontrol.

Midirgui takes an incoming MIDI data stream and distributes it to any of six output cells, each of which is an ALSA sequencer client. You can filter the channels allowed to pass through each cell, a huge help when you want to access only a single patch or sound on a device that always is in Omni Receive mode, meaning it receives MIDI on all channels. Thus, by setting one of the cells to pass MIDI messages on channel 10 only, I'm able to use the drums on my SBLive Emu10k1 synthesizer while playing other synths. Figure 5 demonstrates the necessary connections: an external sequencer sends out a multichannel MIDI stream and is connected to midirgui, client 128 in the JACK MIDI patch bay input ports). Midirgui's first cell, client 129, filters the data flow and sends only messages on channel 10 to the Emu10k1.

Linux MIDI: A Brief Survey, Part 3

Figure 5. Midirgui

Mcontrol is another powerful Linux MIDI utility. You can assign up to 12 simultaneous MIDI control messages for each controller on your MIDI keyboard, letting you change a variety of parameters with a single controller. You also can employ mcontrol by itself as a MIDI control surface, using its wheels to send any of six message types to its connected destinations. Figure 6 shows off mcontrol configured for dynamic control of the algorithm select message seen above, so when I move mcontrol's mod wheel I can watch its effect on the TX802's display.

Linux MIDI: A Brief Survey, Part 3

Figure 6. Mcontrol

You can record your controller movements into a sequencer, and you can save your controller assignments as programs and banks of programs.

QMidi*

Dr. Matthias Nagorni apparently is a tireless musician and Linux MIDI software developer who has given us one of the finest Linux synthesizers, his ALSA Modular Synth. He also has written a number of wonderful MIDI utilities, collectively known as Kalsatools.

QMidiArp is a MIDI arpeggiator. The programmable arpeggiator was one of the coolest features of analog modular synths. In principle, the arpeggiator was an early sequencer, recording a series of instructions for repeated and transposed pitches to be played automatically over single notes; arpeggiators were especially popular on monophonic synths. QMidiArp does the same thing in software, extending the original model to include as many arpeggiators as you like and adding the ability to include chords as parts of an arpeggiation. The program also is a multichannel/multiport-sensible ALSA sequencer client.

Figure 7 shows QMidiArp processing a demonstration file provided by the good doctor, but no mere screenshot can give you any idea what QMidiArp actually does. You have to download it and and hear it for yourself.

Linux MIDI: A Brief Survey, Part 3

Figure 7. QMidiArp

QMidiControl (Figure 8) is a simpler utility. In its default configuration QMidiControl displays a bank 16, numbered sequentially 1 through 16. The number of faders in the bank can be increased with the --num_controller option, and the initial numbering can be offset with the --offset flag. QMidiControl is indeed a simple program, representing only the numbered MIDI controllers--that is, no sysex or pitch bend--but you may find it quite helpful if your synthesizer responds to MIDI controllers but lacks the physical knobs and sliders. QMidiControl is useful especially when configured for use with Dr. Nagorni's QAMix, a MIDI-controllable soundcard mixer.

Linux MIDI: A Brief Survey, Part 3

Figure 8. QMidiControl

QMidiRoute is a MIDI mapper. It receives a certain type of MIDI message and converts it to another type. Mapping can be quite useful: for example, you could map the note velocity to a controller that affects a reverb parameter, creating a reverberation that "follows" the note event velocity.

The screenshot in Figure 9 shows QMidiRoute configured to convert a stream of pitch-bend messages to MIDI notes (Map 1) and, simultaneously, to a stream of MIDI controller messages for controller #7, the MIDI volume controller (Map 2). The volume control response is reversed, so when the pitch-bend wheel is turned down it produces a chromatic stream of notes that get louder as they go lower. Turning the wheel upwards, the volume decays as the pitches rise.

Linux MIDI: A Brief Survey, Part 3

Figure 9. QMidiRoute

I leave it to the reader to imagine other uses for QMidiRoute. A MIDI mapper can be a useful tool, and I hope to see more development of this program.

MIDI Patch Bays

The ALSA MIDI sequencer API refers to something rather different from the MIDI sequencers I profiled in last month's column. Programs that subscribe to the ALSA sequencer API can function as freely connectable clients of each other, allowing multiple simultaneous connections to and from a single resource (MIDI multiplexing). Management of these connections is possible with the ALSA aconnect command-line tool utility, but the graphic MIDI patch bay is easier to use. It makes connections instantly and clearly displaying the state of all your MIDI connections.

Some of the screenshots in this series already have shown off the MIDI connections panel in Rui Nunez Capela's QJackCtl, an all-purpose GUI for connecting clients of the JACK audio server and the ALSA MIDI sequencer. Other graphic interfaces for connecting ALSA sequencer clients include Bob Hamm's ALSA Patch Bay (Figure 10), Matthias Nagorni's KAconnect (Figure 11) and Maarten De Boer's aconnectgui (Figure 12).

Linux MIDI: A Brief Survey, Part 3

Figure 10. ALSA Patch Bay

Linux MIDI: A Brief Survey, Part 3

Figure 11. KAconnect

Linux MIDI: A Brief Survey, Part 3

Figure 12. AconnectGUI

GMidiMon

At some point, almost every serious MIDI musician needs to monitor a MIDI data stream, perhaps to diagnose a malfunctioning piece of equipment or to examine the contents of a MIDI sequence during playback. Samuel Dufour-Kowalski's GMidiMon is just the tool for that job, providing a simple GTK interface for displaying MIDI messages in a human-readable form (Figure 13). Alas, at this time GMidiMon doesn't support sysex messages, but the program works well when displaying any other MIDI message types.

Linux MIDI: A Brief Survey, Part 3

Figure 13. GMidiMon

The Wrap

That's it for this month's MIDI survey installment. Tune in next month, when I'll be presenting some interesting MIDI programming languages and experimental MIDI composition environments. Until then, I'm sure you can find something from this article to occupy your time. Or, visit linux-sound.org to check out some of the Linux audio and MIDI software listed there.

Dave Phillips is a musician, teacher and writer living in Findlay, Ohio. He has been an active member of the Linux audio community since his first contact with Linux in 1995. He is the author of The Book of Linux Music & Sound, as well as numerous articles in Linux Journal.

Load Disqus comments