LUSP Class Description (04 hex)
This message allows external equipment to derive information about each of the Classes in the system. Each Class used by the system is assigned a unique number that can be used to identify it much like menus and dialog boxes are assigned ids in Windows and Macintosh software. These don't represent the Classes themselves but rather the attributes of a Class. In this way a Class can be reused for several parameters or other data objects in the system. A good example of this is the audio "Mix" Class type in the MPX 1 that is used in all algorithms. The "Mix" parameter itself is different for each algorithm but uses the same Class type so only one Class description is necessary.

Typically, an outside developer, after requesting the "System Configuration" message will request this message once for each legal data Class in the system building a database of all Classes used by the system. Using the Class Description, the control tree for the system can be built.

Transmit only
Byte # Value HEX  Description Notes 
1 F0 Sysex ID (Start)   
2 06 Lexicon ID   
3 0bbb bbbb Product ID   
4 0bbb bbbb Device ID  0-127
5 04 Message Class  Class description
6-9 0n Class Type (2 bytes)  max 65536 types
10-11 0n Number of Characters in Name (1 byte)  max 255 characters
12 - n 0n Name of Class (number of characters nibbled)  ASCII (note that some LCDs use 0-7 for custom characters. 0, therefor, should not be interpreted as the end of the string) 
  0n Number of bytes (2 bytes)  Size of the data associated with the Class (max 65535 bytes) 
  0n Control Flags (1 byte)  Hex Binary 
 00 0000 0000 = No flags set 
 01 0000 0001 = Automation 
 02 0000 0010 = Patchable 
 04 0000 0100 = Control Level 
 08 0000 1000 = "Bottom" Control Level 
 10 0001 0000 = Uses Tempo 
 20 0010 0000 = Parameter wraps 
 40 0100 0000 = Soft Row Assignable 
  0n  Option Class (2 bytes)  Uses standard Class ids (numbers). Note that a value of 0xFFFF indicates no options are used. 
  0n Number of units/limits (1 byte)  max 255 units/limits
  0n 1st Minimum Value (2 bytes)   
  0n 1st Maximum Value (2 bytes)   
  0n 1st Display units (2 bytes)  see below
  0n 2nd Minimum Value (2 bytes)   
  0n 2nd Maximum Value (2 bytes)   
  0n 2nd Display units (2 bytes)   
  0n nth Minimum Value (2 bytes)   
  0n nth Maximum Value (2 bytes)   
  0n nth Display units (2 bytes)   
  0n Checksum  This is an optional "Checksum" field. The checksum is the low 7 bits of the sum of all preceeding bytes in the message following the "Message Class". 
  F7 End of Sysex   

Class Number (Bytes 6-x)
This is the "id" of this Class. Each actual Class in the system is assigned a unique Class ID to which is used to reference it's description structure.

Number of Class Name Characters (Bytes 10-11)
This is the number of characters in the name but also tells you where the Class "Name" field ends and where "Number of bytes" begins. Not all Class names are of the same size; audio parameter Classes tend to have 5 character names while most others have 11 characters.

Class Name (Bytes 12-x)
This is actual text string used to describe the Class. Note that this string is NOT null terminated but should be padded with spaces (ASCII 20 hex). In most cases, these are the strings that appear on the system's front panel for a given Class. This would account for the sometime terse and often duplicate names for Classes. Usually Classes with the same names have other attributes that are different.

Number of Bytes
This is the size of the data associated with the Class in bytes. Most Classes used as parameters are 1 or 2 bytes. Classes that are bigger include the "Program" name, the "Setup" name and other "dump" Data Types. Though not reflected in this number, the data bytes for Class's "Option" s are included in data messages for Classes with options. When dealing with messages, the description for the option's Class must be referenced to correctly interpret the data (number of bytes in the option Data Type, min/max value, etc...).

Note that some "option" Classes ("Rate units", "Drate units", etc..) actually have 0 bytes. In these Classes, the "data" is actually contained in the MSB of the root Classes data.
 
When Classes are used for parameters, the MSB of the Display Units field indicates if the parameter is signed or unsigned. See note below.

Control flags
The control flags are used to define several attributes that are either on or off (0 = NO, 1 = YES). The following bits have been defined:
 
Bit Mask Description
0 0x01 Patchable This Class is patchable
1 0x02 Automation This Class is transmitted when automation is turned on
2 0x04 Control level This Class is a control level
3 0x08 Bottom Control Level This is the last control level on a branch before an editable Class
4 0x10 Uses Tempo This Class is affected by tempo changes
5 0x20 Wrapping  The control for this Class can wrap around from it's minimum value to it's max and vise versa) 
6 0x40 Soft Row Assignable The control for this Class can be placed in a "Soft Row" (simplified user interface)
Note - This field should probably be expanded to 2 or 4 bytes.

Options Class
When a Class has an option, the attributes of the option itself are defined by a Class. This field of the description contains the id for the Class that describes the option parameter. Often, the value of the option parameter must be evaluated before the parameter's value can be correctly interpreted ("Delay" units for instance). A value of 0xFFFF indicates that no option Class is used.

Number of Units/Limits
Some Classes in a system can operate in different "unit" types. An example of this in the MPX 1 is delay time which can be set in milliseconds, a ratio of beats per measure relative to the current tempo, feet, meters and tapped in milliseconds. The system only has a fixed amount of actual delay memory and the steps of each of these represents different amounts of time so the limits for each is different. This field defines how many unit types are available for this Class. This value will also tell you how many mins, maxs, and display units are included in this packet.

If "Number of Units/Limits" is more than 1, the "Option" is used to determine which unit type is used and what they are called. Use the "String" version of the "Option" to get a text description of the current "Unit".

Minimum Value
This is the minimum allowable value for this Class type. Note that the values are expressed as signed words that must be cast to signed or unsigned bytes if the Class is a single byte parameter. Also note that the min and max values are only meaningful for 1 and 2 byte parameters. Typically, the min and max fields are defaulted to 0x0000 and 0xFFFF respectively for "dumps".

Maximum Value
This is the maximum allowable value for this Class type.

Display Units Type
This field specifies a specific display "type" for this Class. Like the Classes, the display "types" define a display technique that can be used for more than one Class (parameter, etc..).

Refer to the Software Developers Toolkit section on page 16 for information about obtaining display functions.

The Display Units Type field also indicates if the parameter is signed or unsigned. If the MSB of the Display Units Type field is 1 (8000 hex), the parameter value is signed otherwise, the parameter value is unsigned.
 
Note that on the MPX 1, bit 7 (0080 hex) instead of bit 15 (the MSB) indicates that the parameter is signed or unsigned. 

Example 'C' language structures
The following 'C' language structures might be used to store each Class type:
(UINT16 is an unsigned int (16 bits) and a UINT8 is an unsigned byte (8 bits).)
 
typedef struct UNIT_OBJECT 

    INT16 min_value; 
    INT16 max_value; 
    UINT16 display_units; 
} UNIT_DESCRIPTION; 

typedef struct 

    UINT16  class_id;
    UINT8   name_size; 
    UINT8   name_string[MAX_NAME_SIZE]; 
    UINT16  class_data_size; 
    UINT8   control_flag; /* patchable, automation */ 
    UINT16  option_class_id; 
    UINT8   num_units; 
    UNIT_DESCRIPTION units[MAX_UNITS]; 
} CLASS_DESCRIPTION; 

 
Requesting the Class Description:
A Class description is requested by specifying the Class's id. For example, to request Class 125 hex ) on a system with the Device ID set for 0, the following message would be sent:

 
                 request    Class 
----header----    type       ID 
F0 06 09 00 06    04 00  05 02 01 00   F7 
 
Note that all 4 nibbles of the Class must be sent padded with 0s if needed.