Skip Navigation.
Section 0

Windows Interface: Chroma Server – Windows Component for Chroma/Computer Communication

By Mark David [21030170+]

v0.03, January 14, 2001

Overview

ChromaServer is a component for facilitating communication between a Microsoft Windows client program and the Rhodes Chroma synthesizer. Its implementation is dependant upon and specific to an interface circuit designed to connect via the computer serial port. For more on this circuit and the entire project, see A Windows Interface for the Rhodes Chroma.

ChromaServer's interface logically resembles the programming interface of the Chroma (see the Chroma Computer Interface manual for more detail; this document presumes some familiarity with this interface). For the programmer using this component, it removes the need to pay attention to lower level functions including:

The third objective is somewhat problematic due to a number of limitations of both the Chroma programming interface and the circuit interface as currently designed. The circuit is designed to allow multiple Chromas to be transmitted to, but only one (at address 0) to be received from. Thus, only this, the first Chroma (ChromaController.Chromas(1)) can tell the computer anything about its state. Any other Chromas become essentially write-only devices. ChromaServer maintains nearly complete information about the programs, panel settings and instruments for the readable Chroma, but the other Chroma machines' states will only match their corresponding objects' states if these are explicitly set by an application and written to the Chroma machines. Additionally, and somewhat surprisingly, the Panel/Performance On/Off commands are not transmitted by the Chroma when the corresponding Set Split 16-19 functions are executed. Thus, the Chroma object properties will be out of synch with the actual Chroma machine settings for these switches if they are set manually on the machine.

The fourth objective, recording and playback, is only minimally supported at present. As higher levels of the application are implemented which make use of these capabilities, it is likely that the ChromaServer interface supporting these functions will improve. I anticipate creating very robust facilities for creating, editing, and merging ("overdubbing") performances.

The cassette storage interface commands and the Peek/Poke commands are not supported by ChromaServer.

ChromaServer is delivered in three files:

ChromaServer is freeware, and can be used freely by any one.

Revision History

Version 0.04

Version 0.03

Object Model

The object model begins at the top with the ChromaController class. This object logically represents the interface circuit itself, more or less, and manages the connection of the Chroma(s) to the computer and the communication back and forth. Under this class is the Chromas collection, containing objects of the Chroma class, each of which represents an individual synthesizer and its state. Chroma class objects are not publicly creatable – the Connect method of the ChromaController object detects how many Chromas are attached and creates the Chromas collection accordingly.

The Chroma class has a "collection" (actually an array) called Programs, which contains objects of the Program class and represents the programs 0-50 on the Chroma. The Program class is creatable, but the Index property (which represents the program number) is always –1 unless it is part of the Chromas().Programs() collection (i.e., it is physically stored on the Chroma). Using the Set property as in the following example:

	Set myProgram = New Program
‘ Set some program parameters
	Set myChromaController.Chromas(1).Programs(23) = myProgram

produces results which may not be what you would expect. The Set Method actually first copies myProgram, and then writes the copy to the Chroma. Thus, after executing the above code myChromaController.Chromas(1).Programs(23).Index will be 23, while myProgram.Index will remain –1. To get myProgram to refer to the same Program instance that's in the Chroma (and thus have subsequent Parameter changes made to the Chroma), you must also execute the following:

Set myProgram = myChromaController.Chromas(1).Programs(23)

The Program Class also contains a useful method, CopyMe, which returns a new instance of the Program class, identical to the called Program except with an Index of –1.

The Program class has 2 "collections" (actually arrays) called Parameters and PanelSettings, which contain objects of the classes Parameter and PanelSetting respectively. Parameters(0) through Parameters(5) contain the state of the Chroma-wide parameters, Parameters(6)-Parameters(50) the A parameter values, and Parameters(56-100) the B parameter values. Whereas Parameters are writeable from the computer, PanelSettings are not, as the Chroma interface provides no command for doing so. There are nine of these, and they are detailed in the following sections.

The Chroma class also contains another "collection" (actually an array) called Instruments. Instruments(0-7) contain objects of the Instrument class which represent the 8 controllable instruments of the Chroma. Each instrument has a property, Program, which returns a Program class object that is a copy of the Program assigned to this instrument by the Define method. Calls to the SetParameter method of the Instrument will change the parameters of the copy of the Program, but not the original program parameters, just as documented in the Chroma command interface.

Finally, there is a new, top-level class called Performance. This class is designed to facilitate the manipulation of recorded streams of events generated by the Chroma. The Performance class contains a collection of PerformanceEvents, each of which represents a single, time-stamped command from the Chroma.

Classes

This section documents each class exposed by the component, in alphabetical order.

Note that not all of the classes are creatable; in particular, Chroma, Instrument, Parameter and PanelSetting. This is highlighted below. All creatable classes are, however, multi-use; i.e., as many instances of the class can be created as needed.

Chroma

Overview:

This class represents a single Chroma machine. Each of the members of the Chromas collection of the ChromaController class is an object of the Chroma class. Commands may be transmitted by the computer to every Chroma, although not all Chromas will be able to transmit commands back. Note: in fact, in the circuit design, only one Chroma at address 0 is able to transmit commands. This server is currently hardwired to assume that only the Chroma with the lowest address is able to transmit to the computer.

Creatable:

No

Properties:

Methods:

Events:

None

ChromaController

Overview:

This is the primary object class for the component, and in most applications will be the first one created. Immediately after creation, the Connect method will usually be used to establish the communications channel between the computer and the connected Chroma(s). This is the only class in the component which raises events.

Creatable:

Yes

Properties:

Methods:

Events:

Instrument

Overview:

This class represents the 8 independently available instruments which may be played simultaneously on the Chroma by an interfaced computer. Of particular note in the Instrument class is the Program property, which (while the instrument is defined) contains a copy of the Program object which determines the sound of the instrument. Calls to the SetParameter method modify the values of this copy of the Program, not the values in the original Program.

Creatable:

No

Properties:

Methods:

Events:

None

PanelSetting

Overview:

Objects of this class represent one of the 9 Panel Settings which can be read from/written to a Chroma Program. These are as follows, where the number is the Index property of PanelSetting:

  1. Edit Mode
  2. Edit Parameter
  3. Link Balance
  4. Link Type
  5. Link Program
  6. Keyboard Split
  7. Main Transpose Type
  8. Link Transpose Type
  9. Sequence Program Number

Creatable:

No

Properties:

Methods:

None

Events:

None

Parameter

Overview:

Objects of this class represent one of the parameters in a Chroma Program. The Index Property contains the number of the Paramater, where 0-5 represent the Program-wide parameters, 6-50 the A parameters and 56-100 the B parameters.

Creatable:

No

Properties:

Methods:

Events:

None

Performance

Overview:

This class represents a real-time performance, which may be transmitted back to the Chroma(s) with the Playback command. Primarily, it is a collection of PerformanceEvents.

Creatable:

Yes

Properties:

Methods:

Events:

None

PerformanceEvent

Overview:

Each instance of this class represents a single event in a Performance. A PerformanceEvent consists primarily of a string which contains the byte command to be transmitted to the Chroma, and a timestamp which represents the number of seconds from the beginning of the performance at which the event occurs.

Creatable:

Yes

Properties:

Methods:

None

Events:

None

Program

Overview:

Each instance of this class represents a complete Chroma program. The PanelSettings and Parameters collections contain the settings for the Program.

The Program class is publicly creatable, to facilitate the creation and editing of Programs without storing them directly in the Chroma machine. Programs which are stored in the Chroma will have an Index property of 0-50, representing its Program number there; otherwise Index will be –1. A non-stored program can become a stored Program by using the Programs Set property as follows:

Set myChromaController.Chromas(1).Programs(23) = newProgram

After which, the Program referred to by newProgram will have an Index of 23, and will also be referred to by myChromaController.Chromas(1).Programs(23). The Program Class also contains a useful method, CopyMe, which returns a new instance of the Program class, identical to the called Program except with an Index of –1.

Creatable:

Yes

Properties:

Methods:

Events:

None

Properties

Address

This property returns the circuit address (0-3) of the Chroma. It is primarily of interest internally to the ChromaServer component.

ByteNum

This property returns the byte number (0 based) that contains the value for this Parameter or Panel Setting in the 59-byte format used by the Chroma in the ReadProgram and WriteProgram commands. It is primarily of interest internally to the ChromaServer component.

ByteMSBit

This property returns the number of the most significant bit (7-0) that contains the value for this Parameter or Panel Setting in the byte specified by ByteNum for the 59-byte format used by the Chroma in the ReadProgram and WriteProgram commands. It is primarily of interest internally to the ChromaServer component.

ByteNumBits

This property returns the number of bits used by Parameter or Panel Setting in the 59-byte format used by the Chroma in the ReadProgram and WriteProgram commands. It is primarily of interest internally to the ChromaServer component.

Channels

This property returns the number of (up to 16) Chroma channels currently being used by the Instrument.

ChromaController

This property returns a reference to the ChromaController object whose Chromas collection contains this Chroma.

Chroma

This property returns a reference to the Chroma object whose Instruments or Programs collection contains this Instrument or Program

Chromas()

This property returns one of the ChromaController's Chroma objects. The Connect The index order of the Chromas is the same as their addresses on the interface circuit (see A Windows Interface for the Rhodes Chroma), but is 1-based instead of 0-based; i.e.; the first Chroma has a circuit address of 0 but is accessed in code as:

MyChromaController.Chromas(1)

ChromasCount()

This property returns the number of Chroma objects in the Chromas() property of the ChromaController, and hence the highest valid index for that property.

CommPort

This property returns the number of the serial port on the computer (Comm1, Comm2, etc.) that the interface circuit is connected to. The port number is an argument to the Connect method, which sets this read-only property. CommPort is 0 if the ChromaController has not been connected.

Defined

This property is True if the instrument has been defined, False otherwise. See the Define and Undefine methods to control the state of this property.

DisplayNumber

This property returns the number that is displayed on the Chroma LED display when the program is the selected program there. For the most part, this is the same as the Index property, except for these important cases:

DisplayNumber may not be written to directly. The CopyMe method returns a Program with the same DisplayNumber as the copied-from Program. Assigning an instance of a Program to a member of the Programs collection as in this example:

Set myChromaController.Chromas(1).Programs(23) = newProgram

Will set the DisplayNumber property to the assigned-to Program Index (in this case, 23).

EventString

This property sets and returns the string of bytes to be sent to the Chroma upon Playback of the Performance to which this PerformanceEvent belongs. It may be set to any string - it is not validated to be a valid Chroma command.

EventTimestamp

This property sets and returns the timing of this PerformanceEvent, in terms of number of seconds after the start of the Performance to which it belongs. It may be set to any Single value – it is not validated in any way. The handling of out-of-sequence EventTimestamp values is detailed in the Playback method.

Footswitch1

This property sets and returns the state of Footswitch 1 (physically, the right Footswitch) for the Instrument. True is down, False up.

Footswitch2

This property sets and returns the state of Footswitch 2 (physically, the left Footswitch) for the Instrument. True is down, False up.

ID

This property returns a unique string index to the PerformanceEvent in the PerformanceEvents collection of the Performance. As Performances are edited, the sequential member index of a particular PerformanceEvent may change. The ID property, however, will remain constant and unique. Thus, after the following sequence:

MyPerformance.AddPerformanceEvent("abc",0.1)
MyPerformance.AddPerformanceEvent("def",0.5)
MyPerformance.AddPerformanceEvent("xyz",0.6)

MyPerformance.PerformanceEvents(2).EventString will yield "def", as will MyPerformance.PerformanceEvents("2").EventString. However, after

MyPerformance.RemovePerformanceEvent("1")

MyPerformance.PerformanceEvents(2).EventString will return "xyz", but MyPerformance.PerformanceEvents("2").EventString will still return "def".

Index

This property returns the member index in the collection to which the object belongs, as follows:

Note: for Program objects, the Index property is only set when the object is in fact a member of a Chroma.Programs collection. Programs may be created and exist separately from this collection, however, in which case their Index value is –1.

Instruments()

This property returns one of the Chroma's Instrument objects. An index of 0-7 must be supplied.

Lever1

This property sets or returns the Lever1 value for the Instrument. When used to set the Lever1 value, the Lever1 command for the Instrument is transmitted immediately to the Chroma.

Lever2

This property sets or returns the Lever2 value for the Instrument. When used to set the Lever2 value, the Lever2 command for the Instrument is transmitted immediately to the Chroma.

MaxChromas

This property contains the maximum number of Chromas which can be attached to the interface circuit. It defaults to 4.

MaxValue

This property returns the maximum allowable Value for the Parameter or PanelSetting.

MinValue

This property returns the minimum allowable Value for the Parameter or PanelSetting

Name

This property returns the textual name of the Parameter or PanelSetting.

PanelSettings()

This property returns one of the Chroma's PanelSetting objects. An index of 1-9 must be supplied.

PanelSwitch

This property sets or returns the state of the Panel switch on the Chroma. If True, panel settings changes are transmitted from the Chroma to the computer. If False, they are not.

Parameters()

This property returns one of the Chroma's Parameter objects. An index of 1-50 or 56-100 must be supplied.

Pedal1

This property sets or returns the Pedal1 value for the Instrument. When used to set the Pedal1 value, the Pedal1 command for the Instrument is transmitted immediately to the Chroma.

Pedal2

This property sets or returns the Pedal2 value for the Instrument. When used to set the Pedal2 value, the Pedal2 command for the Instrument is transmitted immediately to the Chroma.

PerformanceEvents()

This property returns one PerformanceEvent object of the Performance. The supplied index may either be a numeric index, in which case the PerformanceEvent is selected by its order in the performance, or a String in which case the PerformanceEvent with the corresponding ID (if any) is returned.

PerformanceEvents may be added to or removed from the performance using the AddPerformanceEvent and RemovePerformanceEvent methods

PerformanceEventsCount

This property returns the number of PerformanceEvent objects in the PerformanceEvents() property.

PerformanceSwitch

This property sets or returns the state of the Performance switch on the Chroma. If True, performance commands are transmitted from the Chroma to the computer. If False, they are not.

Program

This property returns an instance of the Program class. For Parameter and PanelSetting, the returned Program is the one to which the calling Parameter or PanelSetting belongs.

For Instrument, the returned Program is a copy of the Program which was used to Define the Instrument. As a copy of a program, it has an Index of –1. Subsequent calls to the SetParameter method will change values of this copy; neither the stored Program on the Chroma nor the Programs in the Chroma property Programs() will be affected.

Programs()

This property returns/sets Program objects of the Chroma. The supplied index must be 0-50.

Setting the Programs() property as in the following example:

	Set myProgram = New Program
‘ Set some program parameters
	Set myChromaController.Chromas(1).Programs(23) = myProgram

produces results which may not be what you would expect. The Set Method actually first copies myProgram, and then writes the copy to the Chroma. Thus, after executing the above code myChromaController.Chromas(1).Programs(23).Index will be 23, while myProgram.Index will remain –1. To get myProgram to refer to the same Program instance that's in the Chroma (and thus have subsequent Parameter changes made to the Chroma), you must also execute the following:

	Set myProgram = myChromaController.Chromas(1).Programs(23)

ReceiveMode

This property can be set to either of the valid values for the ChromaReceiveModes enumeration. These are:

RecordBlockSize

This property contains the number of bytes to buffer while the ChromaController is in record mode. While the ReceiveMode property is set to ChrRmdRecord, the ChromaController timestamps and saves all bytes received from the Chroma. When the aggregate number of bytes received meets or exceeds the number specified by RecordBlockSize, the RecordedBlock event is triggered and the receive buffer cleared.

SendsToComputer

This property returns whether the Chroma is able to send commands to the computer. It is determined and set automatically by the Restore method.

SendTo

This property returns True if the Chroma is currently addressed by the ChromaController, False otherwise. The value of this property is set by the SendToChroma and UnsendToChroma methods.

SoftwareRevisionLevel

This property returns the Software Revision Level for the Chroma, as returned by the Identification command. It is set by the Restore method.

TimeoutMilliseconds

This property controls how many milliseconds the ChromaController waits for a response from a Chroma to a query command (Identification, Information, ReadParameter, ReadProgram, or Status) before giving up. The default 1s 1000 (1 second).

Value

This property returns (or, for Parameters, sets) the value of the Parameter or PanelSetting. PanelSettings may not be set by the computer, as the Chroma provides no command in its computer interface for doing so. When this property is used to set a Parameter, a WriteParameter is immediately transmitted to the Chroma.

Volume

This property sets or returns the Volume value for the Instrument. When used to set the Volume value, the Volume command for the Instrument is transmitted immediately to the Chroma.

Methods

AddPerformanceEvent

This method adds a new PerformanceEvent to the Performance, at the end of the current collection of PerformanceEvents. The EventString property of the new PerformanceEvent is set to inString and the EventTimestamp property to inTimestamp, both without further validation. A reference to the new PerformanceEvent is returned.

Attack

This method transmits an Attack command (strike a note). The specified note on the specified instrument is attacked with the specified velocity. If called from ChromaController, the command is sent to all Chromas currently being addressed (see SendToChroma). If called from Instrument, only the Chroma of the calling Instrument is sent the command.

Connect

This method is usually called immediately after creation of the ChromaController object to initialize communications. CommPort is the number of the serial port on the computer that the interface circuit is connected to. If CommPort does not represent a valid serial port on the machine, chrErrInvalidPortNumber is returned. Otherwise, the method opens the serial port and determines whether a powered-up interface circuit is present (both CD and DSR pins should be high); if not a chrErrNoInterfaceDetected error is returned. The circuit is reset, and the method begins trying to detect Chromas. An AddressChromas command (See Overall Design for details) is sent to each Chroma address individually from address 0 to MaxChromas – 1. If present, the addressed Chroma will ignore the command, but will acknowledge its receipt. If no acknowledgement is received from the addressed Chroma within TimeoutMilliseconds, the method decides there is no Chroma at that address; otherwise a new Chroma object is initialized and added to the Chromas collection. If no Chromas are detected, the chrErrNoChromasDetected error is returned.

For each detected Chroma, the Restore method is then executed to initialize the objects' values.

Upon completion, Chromas(1) is addressed (see SendToChroma), and no others.

CopyMe

The method returns a Program object that is an exact duplicate of the calling Program, with the following exceptions:

Subsequent modifications to this Program will not affect any of the Program objects in the Programs() of the Chroma object, unless and until the program is assigned to one of these programs using Set, e.g.,

Dim newProgram as Program
Set newProgram = MyChromaController.Chromas(1).Programs(2).CopyMe
MyChromaController.Chromas(1).Programs(23) = newProgram

Will effectively copy program 2 in the Chroma to program 23.

Define

This method validates the inputs and Defines an Instrument, associating it with a Program and allowing it to be played (Attack, Release). The Program property is set to a copy of the Program with the number specified by inProgramIndex, the initial settings of the instruement for the performance parameters (Volume, Lever1, etc.) are set, the Defined property is set to True, and a Define command is sent immediately to the Chroma.

Disconnect

This method closes the serial port to which the interface circuit is connected.

ErrMessage

Returns a descriptive error message for the error identified by errNum, a member of the ChromaErrs enumeration. Some of these messages allow situation-specific information to be supplied in the specificText parameter; if specificText is supplied for such a message, it will be inserted appropriately in the string. See the ChromaErrs enumeration for the returned error message strings and their specificText provisions.

PackedStringToProgram

This utility Function is useful for converting a Program object to its 59-byte packed string representation, as stored in Galaxy format files, and returned by the Read Program command of the Chroma.

PanelSwitchOff

This method turns off the panel switch of the controlling Chroma, preventing panel setting changes from being transmitted to the computer. It is identical to setting the PanelSwitch property of the Chroma to False.

PanelSwitchOn

This method turns on the panel switch of the controlling Chroma, enabling panel setting changes to be transmitted to the computer. It is identical to setting the PanelSwitch property of the Chroma to True.

ParseRecording

This method converts raw recorded bytes and timestamps from the Chroma into a more manageable Performance object. InBytes is an array of bytes which has usually (though not necessarily) been put together from recorded byte arrays supplied by the RecordedBlock event. InTimestamps is an array of values representing seconds since the beginning of the recording. If either of the arrays is larger than the other, the extra values in the larger one are ignored.

The method checks each byte of inBytes sequentially. When a complete valid Chroma command is detected, a PerformanceEvent is added to the PerformanceEvents collection of the Performance object, with a timestamp corresponding to the inTimestamp of the first byte of the command. No checking is performed for sequential order of inTimestamps, nor is any sorting of the resultant PerformanceEvents performed.

This method is supplied for use after a "recording session" on the Chroma. The RecordedBlock event which returns the raw bytes received from the Chroma and timestamps for them is designed to minimize processing at recording time, so that the computer is as responsive as possible to the Chroma performance. That data format is unwieldy, however, for later processing; hence the function of this method is to convert it to a more useful Performance object.

PerformanceSwitchOff

This method turns off the performance switch of the controlling Chroma, preventing performance commands from being transmitted to the computer. It is identical to setting the PerformanceSwitch property of the Chroma to False.

PerformanceSwitchOn

This method turns on the performance switch of the controlling Chroma, enabling performance commands to be transmitted to the computer. It is identical to setting the PerformanceSwitch property of the Chroma to False.

Playback

This method begins transmission of a Performance to the Chroma(s). It works by enabling a timer, which wakes up every millisecond. If the EventTimestamp of the next PerformanceEvent is less than the elapsed time since the timer was enabled, it is transmitted, as are any subsequent PerformanceEvents which meet this condition. PerfromanceEvents are assumed to be in the correct order in their collection; if an earlier-timestamped PerformanceEvent follows a later-timestamped one, the later one will be sent when its time comes, followed immediately by the earlier one.

This method returns immediately upon initiating the playback – it does not wait until the playback is over.

If multiple Chromas are being addressed, they will all be sent the commands in the Performance. The Performance itself can, of course, contain AddressChroma commands.

ProgramToPackedString

This utility Function is useful for converting a 59-byte packed string representation, as stored in Galaxy format files, and returned by the Read Program command of the Chroma, to a Program object

ReadParamater

The value of the ReadParameter command is transmitted to the Chroma (for the calling Parameter and its Program), and the response is used to update the Value property of the calling Parameter. This method is synchronous – it does not return until the response from the Chroma has been received and processed, or the Chroma has timed out.

Release

This method transmits a Release command (release a note). The specified note on the specified instrument is released with the specified velocity. If called from ChromaController, the command is sent to all Chromas currently being addressed (see SendToChroma). If called from Instrument, only the Chroma of the calling Instrument is sent the command.

RemovePerformanceEvent

The PerformanceEvent with the ID corresponding to inId is removed from the sequence of PerformanceEvents of the Performance.

Restore

This method initializes the Chroma and the ChromaServer objects which represent its state.

First, the Restore command is sent to the Chroma which puts it back in the state reflected by its panel settings, and undefines all instruments except 0 and (possibly, if the current program has a Link, 1). The panel switch and performance switch are turned off by this command, and the corresponding Chroma properties are set to False. An Identification command is sent to the Chroma: if it responds, then the following occurs:

If the Chroma doesn't respond, then SendsToComputer is set to False and SoftwareRevisionLevel to –1.

SendToChroma

This method "addresses" one of the Chromas in the Chromas collection; that is, all subsequent calls to the Attack, Release and TapPanel methods of the ChromaController object will be sent to this Chroma until the UnsendToChroma method is called with the same Index. The supplied Index is the member index of the Chromas collection; chrErrInvalidChromaIndex is returned if it is greater than the number of Chroma objects in this collection.

Multiple Chromas may be simultaneously addressed by sequential calls to this method with different supplied Index values.

All commands originating from the Playback method will also be sent to the indicated Chroma, but the command stream being played back may itself contain AddressChroma commands which alter the current set of addressed Chromas.

SetParameter

This method sets the value of a parameter for the Program that the Instrument is "playing". The change, however, is made only to the copy of the program which the Instrument is using – the program stored in the Chroma and the Program object of the Programs() property of the Chroma object remain unaffected. This is useful for modifying a parameter within a Performance without permanently changing the underlying Program.

ParameterIndex is the number (1-50 or 56-100) of the Parameter to be set. Value is checked against the MinValue and MaxValue properties for that Parameter to determine validity.

Squelch

This method immediately transmits the Squelch command to the Chroma, which silences the channel that is playing the supplied note on the Instrument.

TapPanel

This method taps the Chroma panel tapper. When called from ChromaController, all currently addressed Chromas are sent the command. When called from a Chroma object, only the corresponding Chroma machine is sent the command.

TearDown

This method eliminates all internal references to ChromaController object references. It should be used when instances of the ChromaController object are no longer needed by the client program.

Undefine

This method un-defines the instrument, immediately sending an Undefine command to the Chroma.

UnsendToChroma

This method turns off the addressing of a Chroma for subsequent commands (see SendToChroma). Index is the member index of the Chromas collection for the Chroma to un-address.

Note that you may not un-address all the Chromas – if you try to, the last Chroma will remain addressed, and the method will return chrErrCannotSendToZeroChromas. This is due to the interface circuit design; transmitted commands would never get acknowledged, and the circuit would wait forever for its transmit buffer to be read and cleared.

WriteParameter

This method writes the current Value property to the Chroma, for the calling Parameter for its Program. The Program must represent one of the stored programs on the Chroma; i.e., its Index property must be 0-50. If this is not the case (as will occur when the Program has been created or copied independently by the application , or if it is the Program property of an Instrument), the chrErrProgramIsCopy error will be returned. To change the parameters of an Instrument's Program, use the SetParameter method instead.

WriteProgram

This method writes an entire Program to the Chroma, its Parameters() and PanelSettings(). The program of the same number as the Program Index is the one written to. The Program must represent one of the stored programs on the Chroma; i.e., its Index property must be 0-50. If this is not the case (as will occur when the Program has been created or copied independently by the application , or if it is the Program property of an Instrument), the chrErrProgramIsCopy error will be returned.

Events

Attack

Raised whenever an Attack command is received from the Chroma (a note is struck while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. note is the number of the note struck and velocity the velocity with which it was struck.

Define

Raised whenever a Define command is received from the Chroma (generally, when a new program is selected or a new link is established/erased while the Panel Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which was defined. The processing of this command prior to raising the event updates the relevant Instrument properties (Program, Volume, Pedal1, etc.)

Footswitch1

Raised whenever a Footswitch1Down or Footswitch1Up command is received from the Chroma (the right footswitch is depressed or released while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Footswitch1.

Footswitch2

Raised whenever a Footswitch2Down or Footswitch2Up command is received from the Chroma (the left footswitch is depressed or released while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Footswitch2.

Identification

Raised whenever an Information command is received from the Chroma (generally, only when one is requested by sending an Identification command) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. The processing of this command prior to raising the event updates the Chroma property SoftwareRevisionLevel.

Information

Raised whenever an Information command is received from the Chroma (generally, only when one is requested by sending an Information command) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Channels.

Lever1

Raised whenever a Lever1 command is received from the Chroma (the left performance lever is moved while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Lever1.

Lever2

Raised whenever a Lever2 command is received from the Chroma (the right performance lever is moved while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Lever2.

NoOperation

Raised whenever a NoOperation command is received from the Chroma (it is turned on or (I think) Restore-ed) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command.

Pedal1

Raised whenever a Pedal1 command is received from the Chroma (the Volume pedal is moved while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Pedal1.

Pedal2

Raised whenever a Pedal2 command is received from the Chroma (the Effects pedal is moved while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Pedal2.

ReadProgram

Raised whenever a ReadProgram command is received from the Chroma (generally, only when one is requested by transmitting a ReadProgram command) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. ProgramIndex is the number (0-50) of the program to which the command pertains. The processing of this command prior to raising the event updates all the Parameters and PanelSettings of the specified program.

ReadParameter

Raised whenever a ReadParameter command is received from the Chroma (generally, only when one is requested by transmitting a ReadParameter command) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. ProgramIndex is the number (0-50) of the program to which the command pertains. ParameterIndex is the number (1-50 or 56-100) to which the command pertains. The processing of this command prior to raising the event updates the specified Parameter value of the specified Program.

RecordedBlock

Raised whenever the ReceiveMode of the ChromaController is chrRmdRecord, and the total number of bytes received from the Chroma equals or exceeds RecordBlockSize. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. RecordedBytes is an array of bytes, in the order received from the Chroma. RecordedTimestamps is an array with the same number of elements as recordedBytes, each element of which represents the number of elapsed seconds between the setting of the ReceiveMode property of the ChromaController to chrRmdRecord and the receipt at the computer's serial port of the corresponding byte.

The number of bytes in each array can be deteremined by the Ubound function. It will always be equal for the two arrays, and will be equal to or slightly greater than the value of the RecordBlockSize property.

Release

Raised whenever a Release command is received from the Chroma (a note is released while the Performance Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. note is the number of the note released and velocity the velocity with which it was released.

SetParameter

Raised whenever a SetParameter command is received from the Chroma (a parameter is changed while the Panel Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. ProgramIndex is the number (0-50) of the program for which the parameter was changed. ParameterIndex is the number (1-50 or 56-100) of the changed parameter. The processing of this command prior to raising the event updates the specified Parameter value of the specified Program.

Status

Raised whenever a Status command is received from the Chroma (generally, only when one is requested by transmitting a Status command) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number of the instrument (0-7) which generated the command. The processing of this command prior to raising the event updates the relevant properties of the Instrument (Program, Volume, Lever1, etc.).

Undefine

Raised whenever an Undefine command is received from the Chroma (generally, when a new program is selected or a link is established/erased while the Panel Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which was undefined. The processing of this command prior to raising the event updates the relevant Instrument properties (Program, Volume, Pedal1, etc.)

Volume

Raised whenever a Volume command is received from the Chroma (the Link Volume Panel Setting is changed while the Panel Switch is on) and the ReceiveMode of the ChromaController is chrRmdProcess. ChromaIndex is the member index of the Chroma in the Chromas collection which generated the command. InstrumentIndex is the number (0-7) of the instrument which generated the command. The processing of this command prior to raising the event updates the Instrument property Volume. Note: at least on my Chroma, this command doesn't appear to be sent propelry. I get commands for Instrments 0 and 1 when I change the Link Volume parameter, but the values sent to the computer don't change.

Enumerations

The ChromaServer component exposes a number of enumerated constants which will be useful to the application programmer. These are detailed here.

ChromaReceiveModes

These are valid arguments to the ReceiveMode property of the ChromaController object.

ChromaErrs

These are all the error codes returned by ChromaServer methods. These are followed by the text returned from the ErrMessage method with this error code supplied as an argument. In the text strings, "###" is replaced with any text supplied in the specificText argument to the method.

ChromaCommands

These are mnemonics for the supported Chroma command codes.

Patches

These are the mnemonics for the values of Parameter 1 of a Program

FootswitchModes

These are the mnemonics for the valuesof Parameter 2 of a Program

KeyboardAlgorithms

These are the mnemonics for the values of Parameter 3 of a Program

GlideShapes

These are the mnemonics for the values of Parameters 7 and 57 of a Program

SweepModes

These are the mnemonics for the values of Parameters 8 and 58 of a Program

SweepRateMods

These are the mnemonics for the values of Parameters 10 and 60 of a Program

SweepWaveShapes

These are the mnemonics for the values of Parameters 11 and 61 of a Program

SweepAmplitudeMods

These are the mnemonics for the values of Parameters 12 and 62 of a Program

EnvelopeAmplitudeTouches

These are the mnemonics for the values of Parameters 13, 20, 63 and 70 of a Program

AttackDecayMods

These are the mnemonics for the values of Parameters 15, 17, 22, 24, 65, 67, 72, and 74 of a Program

PitchWaveShapeCutoffMods

These are the mnemonics for the values of Parameters 27, 29, 31, 35, 40, 42, 44, 77, 79, 81, 85, 90, 92, and 94 of a Program

WaveShapeWaveShapes

These are the mnemonics for the values of Parameters 33 and 83 of a Program

CutoffLPHPs

These are the mnemonics for the values of Parameters 37 and 87 of a Program

VolumeMod1Mod2s

These are the mnemonics for the values of Parameters 46, 48, 96 and 98 of a Program

VolumeMod3s

These are the mnemonics for the values of Parameters 50 and 100 of a Program

LinkTypes

These are the mnemonics for Link Type

TransposeTypes

These are the mnemonics for both Main and Link Transpose Types