by Bruce Wahler
Ashby Solutions™
v1.8
The Musical Instrument Digital Interface (MIDI) specification opened up a new world of flexibility in electronic instruments, especially in keyboards. MIDI allows a collection of musical devices to communicate with each other, and eliminates the need to drag along a large collection of bulky keyboards to gigs -– a player only has two hands; why bring more than two keyboards?
Well, that’s how MIDI is supposed to work. As in most things, there are differences between the concept and practice of MIDI, and things don’t always work out as expected. Different musical products have varying degrees of MIDI support, and some manufacturers have interpreted the specifications differently that others. Even if two MIDI devices claim to support a feature (ex: keyboard velocity), there may be problems linking the two devices together.
MIDI Solutions’ little "black boxes" have always provided easy answers to tricky MIDI problems, but the Event Processor™, and its big brother, the Event Processor Plus™ take this ability to a new level. With this new ability comes new complexity, and some users may find the programming capabilities of these boxes a little overwhelming at first. This guide attempts to remove some of the mystery of the Event Processor and Event Processor Plus, allowing users to program these boxes to their full capabilities.
NOTE: In the remaining passages of the guide, we’ll refer to both the Event Processor and Event Processor Plus as simply the "Event Processor." In cases where the Event Processor Plus provides additional capabilities, we’ll refer to it as the "Plus."
Each of these features can be used in both simple and complex ways, as we will see in later sections.
This programming guide contains a series of examples that show how the Event Processor can be used to solve real-world problems on MIDI equipment. Generally, the examples are practical ones based on real MIDI products, and some readers may find that their problems are directly solved by one or more of the examples.
Chapter 1 describes using the features of the Event Processor to solve simple, but often annoying, problems in MIDI gear. All owners of the Event Processor will want to read through this section, regardless of their level of MIDI knowledge.
Chapter 2 moves on to more complicated MIDI setups, and how the Event Processor can use several settings together to solve more complicated problems. Advanced users and MIDI “experts” will want to read through this section, too, as it opens up a new level of capabilities in the Event Processor. Users who are less skilled at the finer points of MIDI may want to browse this section to understand what the devices can do, and return at a later time to attempt complex programming, or arrange for programming help through MIDI Solutions or your dealer.
Chapter 3 will discuss problems and limitations caused by the MIDI data itself, or by the way the Event Processor handles the data. These are important points to keep in mind, especially when programming complex tasks in the Event Processor. The Event Processor may seem to be a “MIDI magician,” but it has to obey a set of rules, too.
In order to program the Event Processor, the user must have a general technical understanding of how MIDI works. A complete explanation of the MIDI protocol is beyond the scope of this guide. Users who are new to the world of MIDI are encouraged to read one or more of the available books on MIDI before attempting to program the Event Processor. Some of these books include:
The MIDI Solutions Event Processor Programming Tools use terminology designed around the needs of the MIDI protocol, and the Event Processor itself. Some of the most important ones to become familiar with are:
Most MIDI commands are made up of two or more bytes; typically, either two or three bytes. The first byte is the ‘Command Byte,’ which tells what type of information is being sent (Note-On, Controller Change, etc.). The remaining bytes are the ‘data’ bytes – except in the case of System Exclusive (SysEx) data, which we’ll discuss briefly in the next section. In the Event Processor we’ll call the two typical data bytes ‘Value X’ and ‘Value Y’. Generally, Value X refers a range of values in the first of the two data bytes, or in the only data byte in the command.
The actual information in Value X changes between MIDI commands. In a Note-On command, for example, Value X tells us which note is being played; in a Control Change command, it tells us which controller is being adjusted. Thus, we need to call them something to keep track of the information that they contain.
[Please note: The concept of Values is a necessary part of the flexibility of the device, and something that users will either grasp immediately, or will just have to accept as part of the programming process. Like your mother told you, you shouldn’t be afraid to try new things!]
The Event Processor can work on all of the various types of MIDI data. The basic data types include:
There are also some special data types that we need to address. Because these data types are more complicated, we’ll spend a little extra time discussing them:
This data format was developed by the originators of the MIDI specification to allow manufacturers to send model-specific data that wasn’t planned for in the basic MIDI architecture. For the most part, these messages are used for less common MIDI tasks like transferring data to and from devices, or selecting special features that cannot be controlled through normal MIDI commands. SysEx commands have no associated MIDI channel; any device on the line is supposed to monitor for SysEx messages, and act on them as necessary. If the device doesn’t act on the message, it’s supposed to sit quietly until the message ends.
SysEx messages have a unique format, and are usually expressed in Hexadecimal (base 16), rather than Decimal (base 10): The first byte is always F0 (240), followed by several bytes to show the device’s manufacturer or brand, and usually, the model of the device itself. The last byte is called the ‘EOF’ byte, and is always F7 (247). The following is an example of a SysEx message:
| F0 | 00 00 3F 22 | 01 77 | 00 10 33 41 5A 00 05 54 32 01 22 5F | F7 |
| Start | Manufacturer ID | Device ID | Message | EOF |
|---|
In between the starting byte/ID and the EOF, all of the other bytes are undefined by MIDI, and can be whatever the manufacturer chooses, but each byte cannot have a value greater than 7Fh (127). SysEx messages can be very long, often thousands of bytes in length. SysEx isn’t really intended for device-to-device communications, as much as for device-to-programmer or device-to-manufacturer needs. SysEx is also intended for infrequent communications, because it talks to every device, on every channel.
As the use of MIDI expanded, some manufacturers started to work around the limitations of MIDI by sending all their information, even simple messages like knob and switch changes, through SysEx. This defeats the purpose of MIDI, which is to provide a simple, universal communications standard for all musical devices to use. It also slows down general MIDI communications by forcing everyone to pay attention to the messages. Two new data standards, RPN and NRPN, were developed to enhance MIDI control abilities without resorting to SysEx. Both standards start by using Control Change (CC) messages to tell the MIDI ‘world” that they want to communicate outside the limits of standard MIDI.
RPN is the more structured of the two standards. If I were to decide that toasting bagels was a feature that MIDI instruments needed to address, and the MIDI Manufacturers Association agreed that my this was in the best interest of the general MIDI community (not likely!), they would ‘register’ one of the roughly 16,000 RPN locations as being used for – and only for – toasting bagels. Certain limits would also be imposed on the data being sent by this new RPN, so that everyone would understand the messages. Some RPN examples are Master Tuning and Pitch Bend Range. For obvious reasons, there have been few RPN controls established: most MIDI needs can be met by other controllers of MIDI, and most of the remaining items tend to be very specific to one or two devices.
In theory, at least, no one is supposed to use any of the unregistered RPN locations – ever.
RPN uses the data byte of two MIDI controller locations, CC#100 and CC#101, to call out a specific RPN. At that point, changes to the RPN use the Data Slider (CC#6). In shorthand, a typical RPN command might look like this:
CC#100 = 40h (64)
CC#101 = 22h (34)
CC#6 = 127
This set of three CC messages would set the value of the RPN defined at 2022 in Hexadecimal -- 7-bit math is in use here, because the highest bit of a data byte cannot be a '1' -- as having a value of 127. Once an RPN is called out, additional messages can be sent by changing CC#6 only, since control of the Data Slider is now in the hands of the RPN. However, if someone else calls up a different RPN, the three-byte message must be sent again to reclaim the Data Slider.
To be safe and simple, it’s best to send the three-byte version of the RPN each time it’s used; however, this method triples the amount of data being sent with each RPN change. When programming the Event Processor to work with RPN controls, the user will have to consider tradeoffs between simplicity and data size. If the setup only uses one or RPN controls, it may be sufficient to only send the full three-command sequence at the beginning of use, or after the Event Processor detects a different RPN message header.
NRPN is the ‘back door’ approach for those of us bagel toasters can’t convince the mainstream MIDI community to adopt our ways and decide to implement the function, anyway. Each manufacturer can use NRPN to define commands that are unique to a particular product, and my bagel toasting NRPN is actually free to conflict with your NRPN to put toothpaste on a toothbrush. Since there are roughly 16,000 NRPN locations, it’s possible to stay out of the way of others most of the time, but NRPN conflicts can and do happen. To prevent this problem, devices often send an initialization message, or a series of them, at power-up to establish their NRPN “turf.”
Like RPN, NRPN uses the data byte of two MIDI controller locations, CC#98 and CC#99, to call out a specific NRPN. At that point, changes to the NRPN use the Data Slider. A typical RPN command might look like this:
CC#98 = 20h (32)
CC#99 = 00h (0)
CC#6 = 100
This set of three CC messages would set the value of the RPN defined at 1000 in Hexadecimal as having a value of 100. Once an NRPN is called out, additional messages can be sent by changing CC#6 only, but again, this is only true if no other NRPN message has been sent in between. Like RPN, there is a tradeoff between safety/simplicity and generating extra data that must be made.
Please also note that both RPN and NRPN controls use the Data Slider, so an RPN or NRPN controller must check for both kinds of messages before assuming that the Data Slider is still ‘owned’ by that RPN or NRPN.
MIDI Solutions, the Event Processor, and the Event Processor Plus are trademarks of MIDI Solutions, Inc. of Vancouver, BC, Canada. Ashby Solutions and the Ashby Solutions logo are trademarks of Ashby Solutions of Ashby, MA, USA. All rights reserved.