MIDI RS-232/RS-422 Converter - cinetix.de
MIDI RS-232/RS-422 Converter - cinetix.de
MIDI RS-232/RS-422 Converter - cinetix.de
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>MIDI</strong> <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> <strong>Converter</strong><br />
User Manual for products <strong>de</strong>livered from July 2011 Status 10 January 2012<br />
(new: optimized mo<strong>de</strong>s of operation. User programmable strings. ASCII command interpreter<br />
If you need a manual for el<strong>de</strong>r product versions, please or<strong>de</strong>r by email:<strong>cinetix</strong>@t-online.<strong>de</strong>.)<br />
The <strong>MIDI</strong> <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> <strong>Converter</strong> is the updated version of the "<strong>MIDI</strong> / Serial<br />
<strong>Converter</strong>". This instrument is preferably used as a data converter between <strong>MIDI</strong> and<br />
PC standard baud rates. Frequently used applications are: control of <strong>MIDI</strong> equipment in the<br />
field of „building technology / art and architecture", bridge from PLC to <strong>MIDI</strong>, low cost <strong>MIDI</strong><br />
interface for professional media control systems. Futhermore, it is frequently used to control<br />
any kind of equipment with <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> interface by a <strong>MIDI</strong> sequencer or keyboard.<br />
The basic function is baudrate conversion between <strong>MIDI</strong> and <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> without<br />
changing the content of the transferred data bytes.<br />
For better fitness to some commonly used equipment, in addition to the 1:1 baud rate conversion some<br />
special modifications of the data contents are provi<strong>de</strong>d:<br />
--- Generation of any data bytes and messages at <strong>MIDI</strong> OUT by means of ASCII text<br />
input at the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> port and vice versa: any received <strong>MIDI</strong> message is transferred<br />
into ASCII text to be transmitted at the <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong> interface. This kind of data<br />
modification is most useful to control <strong>MIDI</strong> equipment from PLC or PC software which is able<br />
to transmit ASCII text but not the full 8 bit character set.<br />
--- Transmission of arbitrary bytes out of the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface by means of<br />
specially co<strong>de</strong>d <strong>MIDI</strong> messages and vice versa: any bytes received at the <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<br />
<strong>422</strong> port are transformed into specific <strong>MIDI</strong> messages. This way equipment with serial<br />
interface is easily controlled by a <strong>MIDI</strong> sequencer or even from a live keyboard.<br />
--- new in the actual firmware version is the feature to store up to 512 user specific strings<br />
permanently (e.g. sequences of multiple commands) and to trigger the transmission of<br />
these strings by a single <strong>MIDI</strong> message or a byte received at the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface.<br />
--- useable as a <strong>MIDI</strong> merge- and through-box: <strong>MIDI</strong> style messages at <strong>MIDI</strong> IN and at the<br />
serial port are consistently multiplexed and retransmitted at both interfaces.<br />
--- For special data conversions and to run tests, two different command interpreters are<br />
implemented. One of them is programmable for stand alone applications. In addition to<br />
commands for transmission and reception of arbritrary data via <strong>MIDI</strong> and <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong>,<br />
4 analog inputs (0-5V) and 2 MOS switch transistors are built in. This way simple control<br />
tasks, especially those including <strong>MIDI</strong> communication, may be solved with the <strong>Converter</strong>.<br />
It is NOT allowed to use this instrument together with all safety critical applications, where<br />
misfunction could result in personal injury o<strong>de</strong>r noticeable material damage !<br />
Elements at the front panel:<br />
IN is a standard <strong>MIDI</strong> input<br />
OUT is a standard <strong>MIDI</strong> output<br />
A <strong>MIDI</strong>-Through connector is not provi<strong>de</strong>d
The power supply is <strong>de</strong>signed for unregulated d.c. power supplies, min. 200 mA currrent<br />
output. A simple in-plug supply with "europlug" is <strong>de</strong>livered together with the <strong>Converter</strong>.<br />
Generally there are only small <strong>de</strong>mands concerning the power supply. Any regulated or unstabilized DC<br />
supply can be used with output voltages beween optimum 9 volt and max. 16 volt (which usually is the<br />
max. output of an unregulated 12V AC/DC adaptor). The DC input is <strong>de</strong>signed for a concentric low<br />
voltage connector: external 5,0 - 5,5mm, internal 2,1mm. The positive polarity has to be connected<br />
with the inner contact! Internally the <strong>MIDI</strong> <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> <strong>Converter</strong> is protected against wrong<br />
polarity: if wrong, the <strong>Converter</strong> is not powered.<br />
The rotary switch "Ch / Mo<strong>de</strong>" is used to select different baudrates and mo<strong>de</strong>s of<br />
transformation between <strong>MIDI</strong> and serial interfaces:<br />
(Zuordnung <strong>de</strong>r Drehschalter-Stelllungen zu Funktionen nur gültig für ab Juli 2011 gelieferte Geräte !)<br />
Ch./Mo<strong>de</strong> Function<br />
Serial<br />
Baud<br />
<strong>MIDI</strong><br />
<strong>MIDI</strong> Channel<br />
Baud<br />
0 1:1 transparent baudrate conversion 19200, 8N1 31250 ---<br />
1 1:1 transparent baudrate conversion 38400, 8N1 31250 ---<br />
2 1:1 transparent baudrate conversion config., 8N1 31250 ---<br />
3 Baudrate conversion:ASCII text��<strong>MIDI</strong> byte 38400, 8N1 31250 ---<br />
4 Baudrate conversion:ASCII text��<strong>MIDI</strong> bytee config., 8N1 31250 ---<br />
5<br />
6<br />
7<br />
8<br />
9<br />
A<br />
B<br />
C<br />
Baudrate conversion: <strong>MIDI</strong>-Msg � serial Byte<br />
but: ASCII text �<strong>MIDI</strong> byte<br />
Baudrate conversion: <strong>MIDI</strong>-Msg � serial Byte<br />
but: ASCII text �<strong>MIDI</strong> byte<br />
Baudrate conversion: <strong>MIDI</strong> msg �� byte<br />
Serial bytes are transferred into NOTE ON<br />
Baudrate conversion: <strong>MIDI</strong> msg �� byte<br />
Serial bytes are transferred into NOTE ON<br />
Baudrate conversion:: <strong>MIDI</strong>-Msg �� Byte<br />
Serial bytes are transferred to CONTROL CHANGE<br />
Baudrate conversion:: <strong>MIDI</strong>-Msg �� Byte<br />
Serial bytes are transferred to CONTROL CHANGE<br />
Baudrate conversion:: <strong>MIDI</strong>-Msg �� Byte<br />
Serial bytes are transferred to<br />
PROGRAM CHANGE or CHANNEL PRESSURE<br />
Baudrate conversion:: <strong>MIDI</strong>-Msg �� Byte<br />
Serial bytes are transferred to<br />
PROGRAM CHANGE or CHANNEL PRESSURE<br />
19200, 8N1 31250 <strong>de</strong>fault/preset:1<br />
config., 8N1 31250 <strong>de</strong>fault/preset:1<br />
19200, 8N1 31250 <strong>de</strong>fault/preset:1<br />
config., 8N1 31250 <strong>de</strong>fault/preset:1<br />
19200, 8N1 31250 <strong>de</strong>fault/preset:1<br />
config., 8N1 31250 <strong>de</strong>fault/preset:1<br />
19200, 8N1 31250 <strong>de</strong>fault/preset:1<br />
config., 8N1 31250 <strong>de</strong>fault/preset:1<br />
D<br />
Merge- and Through Box: retransmits data at <strong>MIDI</strong> IN<br />
config., 8N1 31250<br />
and serial interface "multiplexed" at both interfaces<br />
---<br />
E programmable standalone command interpreter config., 8N1 31250 <strong>de</strong>fault/preset:1<br />
F simple ASCII text operated command interpreter config., 8N1 31250 ---<br />
"<strong>MIDI</strong> msg �������� byte" <strong>de</strong>scribes a special mo<strong>de</strong> of operation using <strong>MIDI</strong> channel messages or System<br />
Exclusive messages to transmit arbitrary bytes via <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong> Vice versa any bytes received<br />
at <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> are transformed into differently formatted <strong>MIDI</strong> channel messages to be<br />
transmitted from <strong>MIDI</strong> OUT. More <strong>de</strong>tails see below<br />
"ASCII text �������� <strong>MIDI</strong> byte" <strong>de</strong>scribes a special mo<strong>de</strong> of operation which transforms any hexa<strong>de</strong>cimal<br />
co<strong>de</strong>s, which are entered at the <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> interface as ASCII text into the corresponding binary<br />
bytes to be transmitted at <strong>MIDI</strong> OUT and in the opposite direction to “print“ any byte received at <strong>MIDI</strong> IN<br />
as ASCII text via <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>. More <strong>de</strong>tails see below
The <strong>MIDI</strong> channel which is used in generation or extraction of <strong>MIDI</strong> messages can be changed by the<br />
user and saved permanently. The <strong>de</strong>fault preset at <strong>de</strong>livery is 1. Note: the <strong>MIDI</strong> channel numbers<br />
<strong>de</strong>scribed throughout this manual correspond with the „official“ way to assign <strong>MIDI</strong> channels!<br />
As known, the channel value which is co<strong>de</strong>d into <strong>MIDI</strong> status bytes always is one less! E.g: when the<br />
<strong>MIDI</strong> channel is set to 3 by the user, always the value 2 is co<strong>de</strong>d into status bytes, a NOTE ON will have<br />
the status hex92 then. It is essential to keep this in mind when writing or configuring control software!<br />
A dual LED does monitor presence of power, the active mo<strong>de</strong> of operation and the data flow<br />
via the <strong>MIDI</strong> interface:<br />
During all mo<strong>de</strong>s of operation, the dual LED (ma<strong>de</strong> up of a red and a green LED) basically has an<br />
amber colour.<br />
When the the <strong>MIDI</strong> interface is receiving data, the green LED is going off for a short time, i.e. the LED<br />
is flashing red.<br />
When the the <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> interface is receiving, the red LED is going off for a short time, i.e.<br />
the LED is flashing green.<br />
When <strong>MIDI</strong> and serial interfaces are receiving simultaneously, the LED is flashing dark.<br />
During a reset (is always performed when the rotary switch is turned) the LED goes off for<br />
about one second.<br />
Elemente at the rear panel:<br />
Following hardware components are available here:<br />
The connector "<strong>RS</strong>-<strong>232</strong>" is a standard <strong>RS</strong>-<strong>232</strong> interface - wired as "Data Terminal"<br />
(abbreviated "DTE").<br />
At the connector "<strong>RS</strong>-<strong>422</strong> / Option" in addition to a standard-<strong>RS</strong>-<strong>422</strong> interface 4 analog inputs<br />
and 2 transistor outputs are provi<strong>de</strong>d. Latter are accessable only when the rotary switch is in<br />
position E and F, however.<br />
Wiring of the <strong>RS</strong>-<strong>232</strong> interface:<br />
9 pin Sub-D connector (male), wired as "Data Terminal" ("DTE").<br />
Pin connections:<br />
Pin 1 --<br />
Pin 2: RxD (serial receiver<strong>RS</strong>-<strong>232</strong>)<br />
Pin 3: TxD (serial transmitter <strong>RS</strong>-<strong>232</strong>)<br />
Pin 4: --<br />
Pin 5: Signal Ground<br />
Pin 6: --<br />
Pin 7: RTS out<br />
Pin 8: CTS in<br />
Pin 9: optionally available +5V, max. 100 mA. An internal jumper has to be set.<br />
Hints for external connections at the <strong>RS</strong>-<strong>232</strong> rsp. <strong>RS</strong>-<strong>422</strong> interface:<br />
Internally the data receiver and data transmitter of both interfaces are each tied together. During transmission,<br />
parallel use of both interfaces does not cause conflicts. But during a given period of time, only one interface<br />
may receive data exclusively while a matching data packet is received, else incoming data will be mixed<br />
together, resulting in garbage. Else no explicit selection or switching of the active interface is necessary.<br />
3
The connection to an application <strong>de</strong>vice with <strong>RS</strong>-<strong>232</strong> interface, like beamers or DVD players, is normally ma<strong>de</strong><br />
with a 1:1 standard cable like it is used to connect application with a PC. However we recommend to pay<br />
attention to the interface specification of the attached <strong>de</strong>vice. To connect a PC with the <strong>RS</strong>-<strong>232</strong> interface of<br />
the <strong>Converter</strong>, a "Null Mo<strong>de</strong>m" cable has to be used !<br />
For connection of the <strong>RS</strong>-<strong>422</strong> interface, an adaptor cable has to be assembled in correscon<strong>de</strong>nce with the<br />
pinout listed below.Insi<strong>de</strong> the <strong>Converter</strong> a 120 Ohm termination resistor is activated at <strong>de</strong>livery. If this not<br />
welcome in certain system configurations, it may be <strong>de</strong>activated by pulling a jumper.<br />
Users should pay attention to the fact that due to the different baud rates in priciple buffer overflow and as a<br />
consequence loss or distortion of data is possible. To keep this risk as low as possible, the relationship of<br />
baud rates should be selected in a way that the <strong>de</strong>vice which normally transmits most data is operated with the<br />
lowest baud rate. If, for example, in a certain application essentially data of a <strong>MIDI</strong> <strong>de</strong>vice shall be evaluated via<br />
<strong>RS</strong>-<strong>232</strong>, then 38400 would be the most appropriate serial baud rate. For another application, however, when a<br />
PCL controls a <strong>MIDI</strong> mixer, 19200 baud would be more appropriate. For transmission of <strong>MIDI</strong> data with <strong>RS</strong>-<strong>422</strong><br />
over a long distance 31250 (optionally configurable at rotary switch positions E and F) or 38400 Baud is best.<br />
Latency time is typically 0.5 to 3 milliseconds, <strong>de</strong>pending on mo<strong>de</strong> of operation and data types.<br />
For each data direction, a queued buffer memory of 4 kilobytes is provi<strong>de</strong>d, which can efficiently suspend peaks<br />
of data load. But if permanently more data are received than can be transmitted, a buffer overflow is<br />
inavoidable. <strong>MIDI</strong> generally provi<strong>de</strong>s no possibility of handshake. The <strong>RS</strong>-<strong>232</strong> interface is equiped with a<br />
RTS/CTS hardware handshake which can be activated by command (inactive at <strong>de</strong>livery). For <strong>RS</strong>-<strong>422</strong> no<br />
handshake is provi<strong>de</strong>d.<br />
Wiring of the connector "<strong>RS</strong>-<strong>422</strong> / Option":<br />
15 pin Sub-D connector (female)<br />
Pin connections:<br />
Pin 1: AnalogIn #0, Digital I/O#0, counter and enco<strong>de</strong>r input<br />
Pin 2: AnalogIn #1, Digital I/O#1, sense <strong>de</strong>tection of enco<strong>de</strong>r<br />
Pin 3: AnalogIn #2, Digital I/O#2<br />
Pin 4: AnalogIn #3, Digital I/O#3<br />
Pin 5: Rx+ (<strong>RS</strong>-<strong>422</strong>)<br />
Pin 6: Rx- (<strong>RS</strong>-<strong>422</strong>)<br />
Pin 7: Tx- (<strong>RS</strong>-<strong>422</strong>)<br />
Pin 8: Tx+ (<strong>RS</strong>-<strong>422</strong>)<br />
Pin 9: MOS transistor #4 (open drain output), pulse witdth modulation<br />
Pin 10: MOS transistor #5 (open drain output), square wave generation, pulse witdh modulation<br />
Pin 11: Signal Ground<br />
Pin 12: Signal Ground<br />
Pin 13: Signal Ground<br />
Pin 14: +5V (max.100mA totally)<br />
Pin 15: +5V (max.100mA totally)<br />
Installation and first operation:<br />
Connections of power supply and data cable can be done in any or<strong>de</strong>r. The connectors at the<br />
"<strong>RS</strong>-<strong>232</strong>" and "<strong>RS</strong>-<strong>422</strong> / Option" connectors may be plugged and pulled out arbitrarily while<br />
power is present or not.<br />
If an external sensor or actuator is attached a first time, a functional test of this component should be<br />
performed immeditately (rotary switch pos. E or F). If any malfunction is observed, the power has to be<br />
switched off immediately and the problem should be analysed. Especially avoid to connect port lines<br />
configured as output with outputs of externally connected <strong>de</strong>vices ! This may <strong>de</strong>stroy the <strong>Converter</strong> as<br />
well as the external component !<br />
The <strong>Converter</strong> is <strong>de</strong>livered with <strong>de</strong>fault settings as follows:<br />
Serial baud rate = 19200: when the rotary switch is in pos. 2,4,6,8,A,C,E,F.<br />
Serial baud rate = 31250 (<strong>MIDI</strong>): when the rotary switch is in pos. D (products <strong>de</strong>livered from 2012)<br />
= 19200 when the rotary switch is in pos. D (products <strong>de</strong>livered in 2011)<br />
At all rotary switch settings else, the baud rate is fixed by the switch position.<br />
4
How to change the baud rate: this is only possible at switch positions E and F - the setting is adopted<br />
in any "configurable" switch setting. After power is put on or the rotary switch is turned, the <strong>de</strong>vice is in<br />
state of automatic baudrate recognition for about 1 second. Then send repeate<strong>de</strong>ly any ASCII co<strong>de</strong> via<br />
<strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong>. Best reliability is achieved with lower case 'm' or upper case 'U' . The SPACE key<br />
works unreliably ! To change baud rate from <strong>MIDI</strong> equipment: send NOTE ON or CONTROL CHANGE<br />
with all data bytes = hex 55 (<strong>de</strong>cimal 85) or hex 6D (<strong>de</strong>cimal 106)<br />
Only standard baudrates 2400, 4800, 9600, 19200, 38400 Baud are <strong>de</strong>tected, additionally <strong>MIDI</strong> (31250<br />
Bit/s). If another baud rate is sent, the nearest fitting one is taken. Because it is sometimes difficult to<br />
send <strong>MIDI</strong> data to the serial interface, the <strong>MIDI</strong> baud rate can be set directly with the ASCII command<br />
~~ (two times 'til<strong>de</strong>' in immediate sequence). The <strong>de</strong>tected baud rate is stored permanently and<br />
automatically reactivated at next system start if the rotary switch is in pos. 2,4,6,8,A,C,D,E or F. I.e. the<br />
<strong>de</strong>tection pro<strong>de</strong>cure is only necessary when the baud rate shall be changed or is unknown.<br />
<strong>MIDI</strong> channel = 1: relevant at rotary switch positions 5 to C.<br />
During conversion serial byte � <strong>MIDI</strong>, this channel is inserted to <strong>MIDI</strong> messages. In the opposite<br />
direction <strong>MIDI</strong> � byte, exclusively <strong>MIDI</strong> messages with this channel are converted into serial bytes.<br />
How to change: Use a terminal program. Turn rotary switch to pos. F, set baud rate if necessary. After<br />
a hello prompt is shown, type "N" (case in<strong>de</strong>pen<strong>de</strong>nt), followed by the <strong>de</strong>sired <strong>MIDI</strong> channel (ASCII 1 to<br />
16), then . This setting is stored permanenty until it gets changed later.<br />
No handshake (RTS/CTS Handshake OFF): relevant at all rotary switch positions<br />
How to change: Use a terminal program. Turn rotary switch to pos. F, set baud rate if necessary. After<br />
a hello prompt is shown, type the ASCII text "Q1". To <strong>de</strong>activate handshake, type "Q0". This setting is<br />
stored permanenty until it gets changed later.<br />
Data protocols of baudrate conversion<br />
In the "1:1 transparent mo<strong>de</strong>s of operation " (rotary switch positions 0,1,2) all<br />
data received at <strong>MIDI</strong> IN are retransmitted unchanged from the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface<br />
and vice versa , but in a different baud rate.<br />
At rotary switch position 2, the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface operates with the baudrate that was<br />
set at rotary switch position E or F. Especially the <strong>MIDI</strong> baud rate 31250 may be selected.<br />
This way, the <strong>MIDI</strong> /<strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> converter is useable to transmit <strong>MIDI</strong> data over a longer<br />
distance, for example combined with a "Cinetix <strong>MIDI</strong>/<strong>RS</strong>-<strong>422</strong> Expan<strong>de</strong>r".<br />
No error messages are generated because no formal errors are possible. Nevertheless false data input will<br />
produce semantic errors<br />
The "ASCII text �� <strong>MIDI</strong> byte" mo<strong>de</strong> (rotary switch positions 3,4,5,6) is<br />
specially useful to control <strong>MIDI</strong> equipment by means of equipment with ASCII capable<br />
serial interfaces like PLC. Text sequences entered at the <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> interface are<br />
transformed into binary bytes and retransmitted via <strong>MIDI</strong> OUT.<br />
In this mo<strong>de</strong>, every binary byte is represented as text as follows: it’s hexa<strong>de</strong>cimal co<strong>de</strong> is <strong>de</strong>scribed by two<br />
characters (digits or any of the letters A,B,C,D,E,F). All letters may be entered upper or lower case. One-digit<br />
hex numbers (less than <strong>de</strong>cimal 16) can be expressed by a single character or with a leading zero. The SPACE<br />
key marks the end of a byte as well as the CARRIAGE RETURN character (hex D). The LINE FEED character<br />
(hex A) is ignored without effect or response. Every invalid text input is echoed with a question mark ‘?’ at the<br />
<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong> interface.<br />
This way <strong>MIDI</strong> I/O can be performed with software or hardware equipment which only sends ASCII strings and<br />
is not able to handle 8 bit data communication - or for tests even by hand on a terminal program.<br />
Accordingly bytes received at <strong>MIDI</strong> IN are retransmitted at the <strong>RS</strong>-<strong>232</strong> interface formatted as<br />
ASCII text as <strong>de</strong>scribed above (only rotary switch positions 3 and 4).<br />
The setting of the rotary switch only has an influence on the baud rate at <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<br />
<strong>422</strong>. <strong>MIDI</strong> channels are are implicitely contained in the ASCII text data.<br />
5
Example: To send a CONTROL CHANGE status byte hexB1 (=<strong>de</strong>cimal 177) at <strong>MIDI</strong> OUT, the following text is<br />
entered at <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong>: "B1 or "..<br />
Opposite example: a keyboard touch of the note c (= <strong>MIDI</strong> value 48 = hex30 ) with standard velocity (<strong>de</strong>cimal<br />
64 = hex 40) at <strong>MIDI</strong> channel no.1 will produce the following ASCII text at the <strong>RS</strong>-<strong>232</strong> si<strong>de</strong>: “90 30 40 “<br />
In "<strong>MIDI</strong> Msg �� Byte" mo<strong>de</strong> (rotary switch positions 5 to C) <strong>MIDI</strong> messages are<br />
transformed into single bytes at the serial port and vice versa. This mo<strong>de</strong> of operations is<br />
particularly <strong>de</strong>signed to control equipment with a <strong>RS</strong>-<strong>232</strong> or <strong>RS</strong>-<strong>422</strong> interface by means<br />
of <strong>MIDI</strong> messages.<br />
When <strong>MIDI</strong> messages are to be transformed into serial (<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>) bytes, the four<br />
methods, which are <strong>de</strong>scribed below, can be mixed arbitrarily while the rotary switch is in<br />
any of the positions 5 to C. Only <strong>MIDI</strong> messages co<strong>de</strong>d with the preset <strong>MIDI</strong> channel (<strong>de</strong>fault<br />
= 1) or with the Cinetix <strong>MIDI</strong> manufacturer ID are captured from the <strong>MIDI</strong> stream and<br />
retransmitted.<br />
However for the opposite conversion from serial to <strong>MIDI</strong>, every byte received at the serial<br />
port is transformed into a <strong>MIDI</strong> message (<strong>MIDI</strong> channel as configured, <strong>de</strong>fault =1) by a<br />
specific method which corresponds to the position of the rotary switch (only switch<br />
positions 7 toC ! Details see below).<br />
The actual firmware version (<strong>Converter</strong>s <strong>de</strong>livered from July 2011) provi<strong>de</strong>s a feature to<br />
overwrite these standard transformations by transmission of user programmed strings, which<br />
are kept stored permanently. Details see lower at page 9ff.<br />
Method 1:<br />
If <strong>MIDI</strong> IN receives a message of the type NOTE ON, POLY KEY PRESSURE ( or NOTE<br />
OFF) (<strong>MIDI</strong> channel as configured, <strong>de</strong>fault =1) this message is transformed into a byte as follows,<br />
which is immediately retransmitted at the serial port (<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>):<br />
1st data byte (note value): becomes bits 0 to 6 of the serial byte.<br />
2nd data byte (velocity):<br />
--- if the “velocity“ is in the range 1 to 126, bit 7 of the serial byte becomes = 0 ("printable<br />
character", elementary ASCII co<strong>de</strong> set)<br />
--- if the “velocity“ is = 127, bit 7 of the <strong>RS</strong>-<strong>232</strong> byte becomes = 1 (expan<strong>de</strong>d ASCII co<strong>de</strong> set)<br />
--- by <strong>de</strong>fault <strong>MIDI</strong> messages with “velocity“ = 0 and NOTE OFFare ignored (a protection<br />
against messages which are sent automatically at the end of a key touch). Optionally this<br />
blocking may released by the command % (see <strong>de</strong>scription of the % command p.10 and p.14).<br />
Example: A keyboard touch of the note d (=<strong>MIDI</strong> value 50 = hex32) with mo<strong>de</strong>rate velocity will release a byte<br />
with binary value hex 32 , which is printed as ASCII ”2“.<br />
Method 2:<br />
If <strong>MIDI</strong> IN receives a message of the type CONTROL CHANGE or PITCH WHEEL CHANGE<br />
(<strong>MIDI</strong> channel as configured, <strong>de</strong>fault =1) this message is transformed into a byte as follows, which is<br />
immediately retransmitted at the serial port (<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>):<br />
1st data byte (controller no. or pitch LSB): bit 0 of this data byte becomes bit 7 of<br />
the serial byte.<br />
2nd data byte (controller value or pitch MSB): results in bits 0 to 6 of the serial byte.<br />
This means: any CONTROL CHANGE message from controller no. 0 (or any controller else with<br />
even number) produces a "printable character" of the elementary ASCII co<strong>de</strong> set 0 to 127. Any<br />
CONTROL CHANGE message from controller no. 1 (or any controller else with odd number)<br />
produces a byte of the expan<strong>de</strong>d ASCII co<strong>de</strong> set 128 to 255.<br />
6
Example: From the CONTROL CHANGE message hex B0 51 75 respectively <strong>de</strong>cimal 176 81 117 the byte<br />
hexF5 respectively <strong>de</strong>cimal 245 is generated and retransmitted via <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>.<br />
Method 3:<br />
If <strong>MIDI</strong> IN receives a message of the type PROGRAM CHANGE or CHANNEL PRESSURE<br />
(<strong>MIDI</strong> channel as configured, <strong>de</strong>fault =1) this message is transformed into a byte as follows, which is<br />
immediately retransmitted at the serial port (<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>):<br />
The <strong>MIDI</strong> data byte is copied into bits 0 to 6 of the serial byte. Additionally:<br />
Any PROGRAM CHANGE message clears bit 7 of the serial byte (= 0) ,<br />
i.e. produces a “printable character” of the elementary ASCII co<strong>de</strong> set 0 to 127<br />
Any CHANNEL PRESSURE message sets bit 7 of the serial byte (= 1),<br />
i.e. produces a byte in the range 128 to 255<br />
Example: The PROGRAM CHANGE message hex C0 41 (=<strong>de</strong>cimal 192 65) produces the byte “A“ at the<br />
serial port, while the corresponding CHANNEL PRESSURE message hex D0 41 causes serial transmission of<br />
the byte hexC1.<br />
Method 4:<br />
If a System-Exclusive message with the Cinetix manufacturer ID is received at <strong>MIDI</strong><br />
IN, it is transferred to a message at the serial port (<strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<strong>422</strong>) as follows:<br />
The SysEx hea<strong>de</strong>r is not retransmitted.<br />
The SysEx hea<strong>de</strong>r always consists of the same 4 byte sequence, which is equal to the<br />
Cinetix SysEx manufacturer ID:<br />
hexa<strong>de</strong>cimal: F0 00 20 5D<br />
or <strong>de</strong>cimal: 240 0 32 93<br />
The data body which follows the SysEx hea<strong>de</strong>r is retransmitted via <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong><br />
until the EOX byte (hexF7 =<strong>de</strong>cimal 247) is received, which terminates this data transfer and<br />
is not retransmitted.<br />
According to the <strong>MIDI</strong> standard the bytes in the data body are restricted to values<br />
between 0 and 127. Normally every byte of the data body – especially sequences of text – is<br />
retransmitted without modification at the serial interface, apart from the following<br />
exception: The two bytes following a “backslash” ’\’ are the ASCII representation of<br />
the hexa<strong>de</strong>cimal co<strong>de</strong> of the character which is to be transmitted via <strong>RS</strong>-<strong>232</strong> and <strong>RS</strong>-<br />
<strong>422</strong>.<br />
This way even bytes with values between 0 and 32 as well as those with values between 128 to 255 can be<br />
comfortably transported in a System-Exclusive message. NO SPACE is allowed between the backslash and the<br />
two bytes. If byte values less than hex10 are to be transmitted, a leading zero HAS TO be inserted between the<br />
backslash and the hex digit. For instance, the phrase \0D\0A produces a CarriageReturn + LineFeed at the<br />
serial si<strong>de</strong>. If a backslash actually has to be sent via <strong>RS</strong>-<strong>232</strong> it is co<strong>de</strong>d in the SysEx message as follows: \5C. If<br />
the hexa<strong>de</strong>cimal co<strong>de</strong> which follows the backslash contains invalid characters or any errors else, it is converted<br />
and retransmitted via <strong>RS</strong>-<strong>232</strong> in an uncontrolled way! Neither an error message is returned nor the whole<br />
transmission is cancelled because most common <strong>MIDI</strong> equipment is not able to handle error feedback!<br />
Transformation of <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> bytes into <strong>MIDI</strong> messages: (switch pos. 7 to C)<br />
The command types <strong>de</strong>scribed above can be mixed arbitrarily when data are sent from<br />
<strong>MIDI</strong> to <strong>RS</strong>-<strong>232</strong>, but in the opposite direction of information transfer serial � <strong>MIDI</strong> a specific<br />
7
<strong>MIDI</strong> output format has to be selected with the rotary switch. The <strong>MIDI</strong> channel which is<br />
inserted into these messages is selected by configuration (<strong>de</strong>fault = 1).<br />
Rotary switch positions 7 or 8: Every byte which is received at the <strong>RS</strong>-<strong>232</strong>/ <strong>RS</strong>-<strong>422</strong><br />
interface generates one NOTE ON message of the following format:<br />
1st data byte (note value): takes over bits 0 to 6 of the serial byte. According to<br />
the <strong>MIDI</strong> standard, bit7 is always set to zero.<br />
2nd data byte (velocity):<br />
is equal to 64 (hex40), if bit 7 of the serial byte is = 0<br />
("printable character", elementary ASCII co<strong>de</strong> set).<br />
is equal to 127 (hex 7F), if Bit 7 of the serial byte is = 1<br />
(expan<strong>de</strong>d ASCII co<strong>de</strong> set)<br />
Example: If the rotary switch is in position 7 and the active <strong>MIDI</strong> channel is <strong>de</strong>fault =1, the byte “x” (hex78 ,<br />
<strong>de</strong>cimal 120) which is received at the serial port, will be converted into the NOTE ON message hex 90 78 40<br />
(<strong>de</strong>cimal 144 120 64).<br />
If the special german letter “Ä“ (Co<strong>de</strong> hexC4, <strong>de</strong>cimal 196) is received at the serial port, it will be converted into<br />
the NOTE ON message hex 90 44 7F (<strong>de</strong>cimal 144 68 127) (applies only to Windows operating system).<br />
Rotary switch positions 9 or A: Every byte which is received at the <strong>RS</strong>-<strong>232</strong>/ <strong>RS</strong>-<strong>422</strong><br />
interface generates one CONTROL CHANGE message of the following format:<br />
--- 1st data byte (controller no.) = 80 (hex50) if Bit 7 of the serial byte = 0<br />
("printable character", elementary ASCII co<strong>de</strong> set)<br />
--- 1st data byte (controller no.) = 81 (hex51) if Bit 7 of the serial byte = 1<br />
(expan<strong>de</strong>d ASCII co<strong>de</strong> set)<br />
--- Bits 0 to 6 of the serial byte are copied without modification into the 2nd<br />
data byte of the CONTROL CHANGE message (controller value). According<br />
to the <strong>MIDI</strong> standard, bit7 is always set to zero.<br />
Example: If the rotary switch is in position 9 and the active <strong>MIDI</strong> channel is <strong>de</strong>fault =1 the byte „%“ (hex25 ,<br />
<strong>de</strong>cimal 37) which is received at the serial port will be retransmitted at <strong>MIDI</strong> OUT as the byte sequence hex B0<br />
50 25 (<strong>de</strong>cimal 176 80 37)<br />
If the special german letter “ü“ (Co<strong>de</strong> hexFC, <strong>de</strong>cimal 252) is received at the serial port, it will be converted into<br />
the CONTROL CHANGE message hex B0 51 7C (<strong>de</strong>cimal 176 81 124) (applies only to Windows operating<br />
system).<br />
Rotary switch positions B or C: Every byte which is received at the <strong>RS</strong>-<strong>232</strong>/ <strong>RS</strong>-<br />
<strong>422</strong> interface generates one PROGRAM CHANGE or CHANNEL PRESSURE message of<br />
the following format:<br />
--- A PROGRAM CHANGE message if bit 7 of the serial byte is = 0<br />
("printable character", elementary ASCII co<strong>de</strong> set).<br />
It’s data byte is equal to the <strong>RS</strong>-<strong>232</strong> byte.<br />
--- A CHANNEL PRESSURE message if bit 7 of the serial byte is = 1<br />
(expan<strong>de</strong>d ASCII co<strong>de</strong> set).<br />
It’s data byte is equal to the serial byte MINUS 128 !<br />
Example: If the rotary switch is in position B and the active <strong>MIDI</strong> channel is <strong>de</strong>fault =1 the byte „%“ (hex 25 ,<br />
<strong>de</strong>cimal 37) which is received at the serial port will be retransmitted at <strong>MIDI</strong> OUT as a PROGRAM CHANGE<br />
message consisting of the byte sequence hex C0 25 (<strong>de</strong>cimal 192 37)<br />
If the paragraph sign “§“ (Co<strong>de</strong> hex A7, <strong>de</strong>cimal 167) is received at the serial port, it will be converted into the<br />
CHANNEL PRESSURE message hex D0 27 (<strong>de</strong>cimal 208 39) (applies only to Windows operating system).<br />
8
Programmable Strings (new from July 2011)<br />
Up to 512 strings with each length of max.126 bytes may be entered permanently<br />
("programmed") into the memory of the microcontroller while the rotary switch is in<br />
positon F. (Details how "programming" is performed, see below)<br />
Transmission of the programmed strings is active at rotary switch positions 5 to C<br />
("serial � String" only at positions 7 to C). Strings programed for direction "serial � String"<br />
may be transmitted at switch position F by use of command S (<strong>de</strong>tails see below).<br />
Each 128 memory segments are reserved for:<br />
--- NOTE ON messages (alternative POLY KEY PRESSURE too)<br />
--- CONTROL CHANGE messages (alternative PITCH WHEEL CHANGE too)<br />
--- PROGRAM CHANGE messages (alternative CHANNEL PRESSURE too)<br />
When any of these <strong>MIDI</strong> messages is received, the assigned string (if programmed) is<br />
transmitted from the serial interface instead of the standard conversion <strong>de</strong>scribed<br />
above, i.e. the string with the number which is equal to the value of the 1st data byte of the<br />
<strong>MIDI</strong> message (note pitch, controller number, program number,....)<br />
As an alternative it is possible to retransmit specified ones or any strings from <strong>MIDI</strong> OUT, this<br />
provi<strong>de</strong>s a kind of patch capability.<br />
If no string is programmed for a specific <strong>MIDI</strong> message or a previous string has been <strong>de</strong>leted,<br />
the standard conversion as <strong>de</strong>scribed above will be transmitted from the serial interface. At<br />
<strong>de</strong>livery, no strings are preprogrammed.<br />
--- Bytes with ASCII co<strong>de</strong>s 0 - 127 at the serial interface trigger transmission of the<br />
assigned programmed string from <strong>MIDI</strong> OUT, appropriate configuration provi<strong>de</strong>d. If no<br />
string is programmed for a specific ASCII co<strong>de</strong> or a previous string has been <strong>de</strong>leted, the<br />
standard conversion as <strong>de</strong>scribed above will be transmitted from <strong>MIDI</strong> OUT. At <strong>de</strong>livery, no<br />
strings are preprogrammed.<br />
As the strings are allowed to contain up to 126 bytes, it is easily possible to release a long<br />
sequence of commands with a single <strong>MIDI</strong> message or a single serial byte. Mathematical or<br />
logical operations are not possible within strings. Only exactly the programmed string may be<br />
transmitted.<br />
Various filter options refine the <strong>de</strong>cision if the programmed string or the standard<br />
conversion shall be transmitted in a given situation:<br />
With the optionally applicable command !1 bis !16 (<strong>de</strong>tails see below) the string trigger can<br />
be restricted to a given <strong>MIDI</strong> channel. If <strong>de</strong>cimal 80 (hex50) is ad<strong>de</strong>d to the parameter, the<br />
message is sent to <strong>MIDI</strong> OUT instead of the serial interface. Furthermore, this redirection<br />
may be activated in general by the command %.<br />
The command !0 does activate string trigger by messages with any <strong>MIDI</strong> channel.<br />
The ! command has no effect on strings triggered by the serial interface.<br />
The setting of this command is NOT stored permanently. Any system reset (the converter is<br />
powered up or the rotary switch is turned) implicitly executes !0. So, if the ! command is not<br />
given explicitly, strings are programmed to be triggered by any <strong>MIDI</strong> channel. The <strong>MIDI</strong><br />
channel, which was programmed into a string, is stored permanently together with the string.<br />
9
The optionally applicable command % (<strong>de</strong>tails see below) sets a bit mask, which restricts<br />
transmission of programmed strings to certain messages or data types.<br />
Strings are not <strong>de</strong>leted by this command and are available again when the corresponding bit<br />
is set<br />
Immediately following the command co<strong>de</strong> % a byte has to be entered as parameter, where<br />
each bit has a special meaning. This parameter is stored permanently and reactivated during<br />
power up. At <strong>de</strong>livey the parameter is preset to 255 (hexFF), i.e. all individual filters are<br />
set to "pass", only NOTE OFF and velocity=0 are blocked.<br />
Bit0 cleared: no strings are triggered by the serial interface<br />
Bit1 cleared: no strings are triggered by NOTE ON<br />
Bit2 cleared: no strings are triggered by POLY KEY PRESSURE<br />
Bit3 cleared: no strings are triggered by CONTROL CHANGE<br />
Bit5 cleared: no strings are triggered by PROGRAM CHANGE and CHANNEL PRESSURE<br />
Bit5 cleared: no strings are triggered by PITCH WHEEL N<br />
Bit6 cleared: all strings triggered by <strong>MIDI</strong> messages are not sent from the serial interface,<br />
but instead from <strong>MIDI</strong> OUT (overwrites the direction individually set by !). Serially<br />
triggered messages are not influenced by this bit.<br />
Bit7 set: NOTE ON messages with velocity=0 and all NOTE OFF messages are ignored<br />
(even applied on standard conversions <strong>de</strong>scribed above)<br />
Bit7cleared: NOTE ON messages with velocity=0 are enabled to trigger strings.<br />
The ASCII text command interpreter: (rotary switch position F)<br />
This command interpreter is used to enter ("program") the strings introduced above.<br />
Furthermore it provi<strong>de</strong>s the means for interactive operation of the <strong>MIDI</strong> interface: send <strong>MIDI</strong><br />
messages and poll the <strong>MIDI</strong> IN buffer in ASCII text format. The built-in I/O resources can be<br />
handled, the serial port can be configured (baud rate, RTS/CTS handshake) and system<br />
parameters, which are relevant for other rotary switch positions may be entered here.<br />
This command interpreter has an easier syntax than the programmable command interpreter<br />
which is <strong>de</strong>scribed below. It immediately reacts on commands via serial interface but cannot<br />
be used for standalone operation.<br />
Setting the baud rate is <strong>de</strong>scribed above together with "Installation and first operation".<br />
General structure of commands:<br />
CommandCo<strong>de</strong> Parameter [CmdCo<strong>de</strong> Parameter ] <br />
--- Some command co<strong>de</strong>s are used to select certain I/O methods ("<strong>de</strong>vices" = virtual instruments), these<br />
are the commands : (colon) , ; (semikolon), S, M, @ ,U, K, J, X, G , W and {<br />
--- Other command co<strong>de</strong>s <strong>de</strong>fine the action which has to be executed with the previously selected<br />
or implicitly <strong>de</strong>termined <strong>de</strong>vice, these are R, L, H, P, Z , T , [ and ].<br />
--- Last not least there is a third kind of command co<strong>de</strong>s which affect the general system<br />
behaviour, examples of these inclu<strong>de</strong>: N , ! . ? , % , & , $ and Y.<br />
Every command is executed as soon as the necessary number of ASCII characters is<br />
entered and interpreted. Input of any number is automatically finished as soon as the<br />
maximum number of digits - context <strong>de</strong>pen<strong>de</strong>nt - is entered. Numbers shorter than<br />
10
maximum are finished by starting the next command (input of a command letter) or when<br />
is entered or when the number is filled up to its max. length with leading zeroes.<br />
All ASCII characters are interpreted case in<strong>de</strong>pen<strong>de</strong>nt. Commands entered in lower case<br />
letters are internally converted into upper case. For this reason all command co<strong>de</strong>s are<br />
written upper case in this manual.<br />
Command lines are terminated with (hexD,<strong>de</strong>c13). This starts immediate<br />
execution of the previous command and reorganisation of internal structures of the command<br />
interpreter. Though not absolutely necessary, for maximum stability a should be entered<br />
occasionally. (hexA,<strong>de</strong>c10) is ignored. This must be taken into account when configuring<br />
application programs. Spaces (hex20,<strong>de</strong>c32) are ignored, too and can be used for better readability.<br />
If a typing error has happend, the pending command should be erased with a keystroke.<br />
"Backspace" is out of action.<br />
Parameters (i.e. numeric values) are always entered in conformance with the active number base<br />
(<strong>de</strong>cimal or hex). After the number base is set to hex with the "$" command, hex numbers are NOT entered<br />
with a preceding $ sign.<br />
Any response to the host controller (PC) is done in the active number base. Hex numbers are sent with a<br />
leading $ sign.<br />
Feedback response:<br />
The <strong>Converter</strong> does not "echo" commands. If you prefer echoes, activate "local echo" at your terminal.<br />
Every command line which has been interpreted correctyafter and terminated with is acknowledged<br />
with a = hexD, <strong>de</strong>cimal 13 .<br />
If a command cannot be interpreted (usually due to a syntax error) the box echoes a '?' plus . If additional commands were already entered, they are lost.<br />
The <strong>Converter</strong> sends polled data output immediately after the command (R , U , ? , ; , @ ).<br />
Every requested message is terminated with a . This may be useful for control<br />
software to <strong>de</strong>tect the end of a syntactic set of data.<br />
Ready prompt after power on or reset:<br />
'<strong>MIDI</strong> <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> <strong>Converter</strong> v4.xx'<br />
This message is sent automatically after power on or after reset of the DMX GenIO. Repeated<br />
spontaneous output of this message may be a hint for unstable power supply or extreme immission of<br />
electromagnetic radiation.<br />
Short reference of all ASCII commands (<strong>de</strong>tailled <strong>de</strong>scriptions below)<br />
:nN (colon) program string no. n (n=0-127) for NOTE ON trigger p.12<br />
:nK (colon) program string no. n (n=0-127) for CONTROL CHANGE trigger p.12<br />
:nP (colon) program string no. n (n=0-127) for PROGRAM CHANGE trigger p.12<br />
:no (colon)program string no. n (n=0-127) to be triggered by <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> character p.12<br />
(o is formally written lower case to be better distingueshed form zero. Is internally converted into upper case)<br />
;nN (semicolon) read / check string no. n (n=0-127) for NOTE ON p.13<br />
;nK (semicolon) read / check string no. n (n=0-127) for CONTROL CHANGE p.13<br />
;nP (semicolon) read / check string no. n (n=0-127) for PROGRAM CHANGE p.13<br />
;no (semicolon) read / check string no. n (n=0-127) for <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> p.13<br />
%n save bit mask n permanently (message filter for trigger of string transmission) p.14<br />
!n set <strong>MIDI</strong> channel n (n=0-16) as trigger filter into string p.15<br />
Nn set <strong>MIDI</strong> channel n (n=1-16)for transformation byte �� <strong>MIDI</strong> message p.15<br />
$ from now parameters and numerical feedback in HEX p.15<br />
& from now parameters and numerical feedbackin DECIMAL p.15<br />
Sn transmit string no. n (n=0 to 127) from <strong>MIDI</strong> OUT p.16<br />
11
Mn transmit a single byte n from <strong>MIDI</strong> OUT p.16<br />
@ read and flush <strong>MIDI</strong> IN receive buffer in ASCII text format p.16<br />
Un poll analog input no. n (n=0 to3) p.16<br />
KnZ configure digital I/O no.n as high impedance input (n=0 to 3) p.16/17<br />
KnP configure digital I/O no.n as input with pull-up resistor (n=0 to 3) p.16/17<br />
KnL configure digital I/O no.n as output with LOW level (n=0 to 5) p.16/17<br />
KnH configure digital I/O no.n as output with HIGH level (n=0 to 5) p.16/17<br />
KnR poll level of digital I/O or MOS transistor switch (n=0 to 5) p.17<br />
KCR poll all digital I/O collectively as number p.16/17<br />
Yn set time constant n for <strong>de</strong>bouncing of digital I/O (n=1 to 255 in ms) p.17<br />
JR poll pulse counter at I/O no- 0 p.18<br />
XR poll enco<strong>de</strong>r counter at I/O no. 0 p.18<br />
JZ reset both counters at I/O no. 0 p.18<br />
WiHn start PWM at OUT (transistor switch) no. i = 4 or 5 with high phase n p.18<br />
GTn set total period and start frequency generator at OUT (transistor switch) no.5 p.19<br />
GHn set high phase of frequency generator at OUT (transistor switch)no.5 p.19<br />
Qn activate/<strong>de</strong>activate RTS/CTS handshake p.19<br />
{ ] save all stored strings and system parameters to PC by XMODEM protocol p.20<br />
{ [ upload a system backup from PC by XMODEM protocol p.20<br />
? send all relevant system parameters as ASCII text string via serial interface p.20<br />
~ ~ configure baud rate to <strong>MIDI</strong> (31250 bit/s) p.21<br />
| reset all I/O and configuration to <strong>de</strong>fault values p.21<br />
enter ("program") a string and store it:<br />
: N<br />
The command co<strong>de</strong> is a colon followed by the 1st data byte of the triggering <strong>MIDI</strong> message<br />
(note pitch 0-127 / hex7F) terminated by letter N.<br />
: K<br />
The command co<strong>de</strong> is a colon followed by the 1st data byte of the triggering <strong>MIDI</strong> message<br />
(e.g. controller number 0-127 / hex7F) terminated by letter K.<br />
: P<br />
The command co<strong>de</strong> is a colon followed by the 1st data byte of the triggering <strong>MIDI</strong> message<br />
(z.B.Programm Nummer 0-127 / hex7F) terminated by letter P.<br />
: o<br />
The command co<strong>de</strong> is a colon followed by the serial byte, which triggers the string (0-127 /<br />
hex7F) terminated by letter o.<br />
Next the string is entered as text. The string is terminated and stored permanently by<br />
quotation marks " (ASCII co<strong>de</strong> hex22). The quotation marks do not become part of the<br />
string, of course.<br />
Examples: :30NHello World" :65o\B0\07\7F"<br />
"Printable" characters (i.e. all characters which can be entered directly with a standard PC<br />
keyboard, ASCII co<strong>de</strong> range hex20 to hex7E) are typed directly.<br />
To enter any byte value else (control co<strong>de</strong>s, contry specific letters) first a backslash \ (ASCII<br />
Co<strong>de</strong> hex 5C) is typed, followed by the <strong>de</strong>sired ASCII co<strong>de</strong> as a 2 digit hex number in text<br />
12
epresentation. For example, a "new line" would be entered as \0d\0a. No leading or trailing<br />
SPACEs may be ad<strong>de</strong>d, they would be contained in the stored string.<br />
The third "special key" is the backspace key (ASCII co<strong>de</strong> 08), which may be used to <strong>de</strong>lete<br />
and rewrite parts of the string before storage.<br />
If any of these special letters shall be stored in the string instead of beeing used to format the<br />
string, but, it has to be entered by means of the backslash representation:<br />
backslash \ as part of the string: type \5c<br />
quotation marks "as part of the string: type \22<br />
backspace as part of the string: type \08<br />
Mouse operations, cursor keys and special function keys F1 to F12 are not <strong>de</strong>tected or<br />
evaluated.<br />
Every entered letter is "echoed" via <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> . "Printable" letters are returned 1:1, any<br />
else comes in backslash/text representation as <strong>de</strong>scribed above. if a printable letter was<br />
entered by backslash representation, it will be returned as plain letter. This way, input of \40<br />
would be echoed as @ .<br />
As soon as the string is terminated by quotation marks, it is permanently stored in the<br />
<strong>Converter</strong> memory. Any string can be <strong>de</strong>leted or overwritten at any time (up to10.000 times).<br />
"Editing" is no possible, however.<br />
A string is <strong>de</strong>leted by entry of an empty string, i.e. the quotation marks follow directly after<br />
the command co<strong>de</strong> : N". Now the string does not contain text and has the<br />
length zero. This configuration is i<strong>de</strong>ntical with the unprogrammed state at <strong>de</strong>livery.<br />
Check a string / display it for test:<br />
The command co<strong>de</strong> is a semicolon followed by the 1st data byte of the triggering <strong>MIDI</strong><br />
message (note pitch 0-127 / hex7F) terminated by letter N.<br />
; K<br />
The command co<strong>de</strong> is a semicolon followed by the 1st data byte of the triggering <strong>MIDI</strong><br />
message (e.g. controller number 0-127 / hex7F) terminated by letter K.<br />
; P<br />
The command co<strong>de</strong> is a semicolon followed by the 1st data byte of the triggering <strong>MIDI</strong><br />
message (z.B.Programm Nummer 0-127 / hex7F) terminated by letter P.<br />
First the count of stored characters is returned, next the letter ! with the corresponding <strong>MIDI</strong><br />
channel, followed by the string in readable text form as <strong>de</strong>scribed above as echo of string<br />
entry.<br />
; o<br />
The command co<strong>de</strong> is a semicolon followed by the serial byte, which triggers the string (0-<br />
127 / hex7F) terminated by letter o.<br />
First the count of stored characters is returned, followed by the string in readable text form as<br />
<strong>de</strong>scribed above as echo of string entry.<br />
13
Please note: String output using backslash representation simply is a readable "interpretation" of the<br />
previously generared memory content. Every byte is actually stored in raw binary format. When the string is<br />
transmitted in "normal operation" the raw binary format is sent, of course.<br />
% <br />
The bit mask blocks specific messages from triggerering transmission of strings:<br />
Immediately following the command co<strong>de</strong> % a byte has to be entered as parameter, where<br />
each bit has a special meaning. This parameter is stored permanently and reactivated during<br />
power up. At <strong>de</strong>livery the parameter is preset to 255 (hexFF), i.e. all individual filters are<br />
set to "pass", only NOTE OFF and velocity=0 are blocked.<br />
Bit0 cleared: no strings are triggered by the serial interface<br />
Bit1 cleared: no strings are triggered by NOTE ON<br />
Bit2 cleared: no strings are triggered by POLY KEY PRESSURE<br />
Bit3 cleared: no strings are triggered by CONTROL CHANGE<br />
Bit5 cleared: no strings are triggered by PROGRAM CHANGE and CHANNEL PRESSURE<br />
Bit5 cleared: no strings are triggered by PITCH WHEEL N<br />
Bit6 cleared: all strings triggered by <strong>MIDI</strong> messages are not sent from the serial interface,<br />
but instead from <strong>MIDI</strong> OUT (overwrites the direction individually set by !). Serially<br />
triggered messages are not influenced by this bit.<br />
Bit7 set: NOTE ON messages with velocity=0 and all NOTE OFF messages are ignored<br />
(even applied on standard conversions <strong>de</strong>scribed above)<br />
Bit7cleared: NOTE ON messages with velocity=0 are enabled to trigger strings.<br />
Comment: This setting is stored permanently and automatically restored at next microcontroller reset. The<br />
strings are not <strong>de</strong>leted by the % command and are active again after the corresponding bit is set. The bit mask<br />
is only effective in rotary switch positions 7 to C, for the direction <strong>MIDI</strong> ���� string in positions 5 and 6 too.<br />
Immediately after the command co<strong>de</strong> % the mask byte is entered as parameter, each bit has a specific effect.<br />
At <strong>de</strong>livery parameter value 255 (hexFF) is preset, i.e. any individually controlled filter is "transparent" at<br />
<strong>de</strong>livery, only NOTE OFF and velocity=0 are blocked.<br />
How to create the bit mask: Even without <strong>de</strong>tailled knowledge of information science it is possible to combine<br />
the individual bits to the mask byte by addition. Every set bit is represented by a byte, which is equivalent to its<br />
"weight". For each bit which shall be set, its weight byte is ad<strong>de</strong>d to get the mask byte. To clear a bit, its<br />
weight is subtracted from the mask byte. The same byte may only ad<strong>de</strong>d or subtracted once, of course ! Due<br />
to the special construction of the weights, no "carry" or "borrow" happens during this operation.<br />
bit number weight hexa<strong>de</strong>c. weight <strong>de</strong>cimal<br />
bit 0 1 1<br />
bit 1 2 2<br />
bit 2 4 4<br />
bit 3 8 8<br />
bit 4 10 16<br />
bit 5 20 32<br />
bit 6 40 64<br />
bit 7 80 128<br />
Example: Only strings programmed for NOTE ON (except velocity=0) and for serial bytes shall be<br />
triggered. To achieve this, bit0, bit1 and bit7 have to be ad<strong>de</strong>d:<br />
hexa<strong>de</strong>cimal 1 + 2 + 80 = hex83 and the same <strong>de</strong>cimal: 1 + 2 + 128 = 131<br />
14
! (don't confuse with command N )<br />
set <strong>MIDI</strong> channel (0 to 16) as filter when programming a string<br />
! 0 switches filtering OFF, i.e. any <strong>MIDI</strong> channel will trigger.<br />
Comment: The <strong>MIDI</strong> channel is entered in the same format, which is commonly used in manuals and<br />
<strong>MIDI</strong> text books. A <strong>MIDI</strong> message will trigger, if the channel is co<strong>de</strong>d in its status byte by one less<br />
(0-15/hexF). The command !0 causes the string to be triggered in<strong>de</strong>pen<strong>de</strong>ntly of the <strong>MIDI</strong> channel.<br />
The <strong>MIDI</strong> channel filter selected by command ! (0-16) will be stored in any subsequently programmed<br />
string, until another channel gets selected by a new ! - command.<br />
This parameter is not stored permanently. After a system seset (turning the switch or switch power<br />
on) the parameter is reset to 0. So, by <strong>de</strong>fault all strings are programmed to be triggered by any<br />
<strong>MIDI</strong> channel.<br />
In contrast to commmand N, the command ! is only effective at rotary switch position F, while strings are<br />
programmed. But the programmed channel filter is active when the string is to be triggered (pos. 5 to C).<br />
Example: !1:30Na"!2:31Nb" causes, that after a reception of a NOTE ON message at channel 1<br />
with tone pitch 30 the byte a (ASCII co<strong>de</strong> <strong>de</strong>cimal97/hex 61) will be transmitted from the serial interface<br />
wird and after reception of a NOTE ON message at channel 2 with tone pitch 31 the byte b (ASCII Co<strong>de</strong><br />
<strong>de</strong>zimal98/hex 62) will be transmitted.<br />
N (don't confuse with command ! )<br />
--- During a transformation byte���� <strong>MIDI</strong> message the <strong>MIDI</strong> channel (1 to 16) will<br />
be inserted into the transmitted <strong>MIDI</strong> message<br />
--- During a transformation <strong>MIDI</strong> message ���� byte exclusively received <strong>MIDI</strong><br />
messages with this channel will be transmitted from the serial interface. (This<br />
only applies for the standard transformation. For programmed strings, the <strong>MIDI</strong><br />
channel is applied, which was stored with command !. Transmission of programmed<br />
strings has priority before standard transformation)<br />
Comment: The <strong>MIDI</strong> channel is entered in the same format, which is commonly used in manuals and<br />
<strong>MIDI</strong> text books. In <strong>MIDI</strong> messages always the channel is co<strong>de</strong>d or filtered by one less (0-15/hexF).<br />
This system parameter is stored permanently and automatically restored after a system reset<br />
(turning the rotary switch or switch power on) .<br />
Example: N1 at rotary switch positions 7 to C transmission or filtering of status bytes hex90 (Note<br />
On), hexB0 (Control Change), hexC0 (Progr.Change) etc. is performed.<br />
$ (no parameter)<br />
Set number base to hexa<strong>de</strong>cimal<br />
Comment: All following parameter values of all commands are interpreted as hexa<strong>de</strong>cimal numbers<br />
and number output is hexa<strong>de</strong>cimal. This behavious remains active until the number base is set to<br />
<strong>de</strong>cimal by command &.<br />
All hexa<strong>de</strong>cimal numbers messaged from the serial interface are signed with a prefix "$".<br />
& (no parameter)<br />
Set number base to <strong>de</strong>cimal<br />
Comment: All following parameter values of all commands are interpreted as <strong>de</strong>cimal numbers and<br />
number output is <strong>de</strong>cimal. This behavious remains active until the number base is set to hexa<strong>de</strong>cimal by<br />
command $.<br />
All <strong>de</strong>cimal numbers messaged from the serial interface come without specifier symbol.<br />
15
S <br />
transmit programmed string no. 0 to127 from <strong>MIDI</strong> OUT<br />
Comment: Please keep notice of the following difference: Primarily strings are programmed with the<br />
command interpreter at rotary switch position F, to be triggered by the corresponding serial byte at<br />
rotary swith positions 7 to C. When the switch is at position F or E, reception of the corresponding byte<br />
will not trigger the string. .<br />
Command S however, causes immediate transmission of the corresponding string at rotary<br />
switch position F.<br />
Example: S65 causes transmission of the string which was stored to be triggered by letter A.<br />
M <br />
transmit the byte which follows in ASCII text representation immediately from<br />
<strong>MIDI</strong> OUT<br />
Example: serial text input $M90M30&M64 causes transmission of a NOTE ON messaga at <strong>MIDI</strong><br />
channel 1 for note c with standard velocity <strong>de</strong>cimal 64.<br />
@ (no parameter)<br />
polls the <strong>MIDI</strong> IN receive buffer and transmits the content ASCII text via the<br />
serial interface. Number base as set by command & or $ .<br />
Comment: The output starts with letter @, followed by the number of bytes which is actually stored in<br />
the buffer (always <strong>de</strong>cimal format) and a colon. Next follow max 16 el<strong>de</strong>st bytes from the buffer in<br />
the actual number base, which are <strong>de</strong>leted from the buffer, too. If the buffer contains more bytes,<br />
the command has to be given repeatedly to extract all bytes and flush the buffer.<br />
Example of a typical output: @3:$90 $30 $40 . Signals that a NOTE ON was<br />
received, transmits it via <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> and <strong>de</strong>letes it from the buffer.<br />
U <br />
Read analog input via serial interface.<br />
Parameter: input number (range 0 to 7)<br />
The result comes as 10 bit number 0 to 1023<br />
Example: U3 causes immediate readout of the actual voltage of input no.3.<br />
K < number ><br />
Select a digital (“Kombi“) I/O for subsequent action.<br />
Parameter: input number (range 0 to 3, with restricted effect 4 and 5)<br />
Example: K3 makes subsequent action commands effect on digital I/O no.3 (<strong>de</strong>vice selection but no<br />
action yet),<br />
to be completed: K3R causes immediate readout and message of the actual logic level (physical line<br />
level is read in<strong>de</strong>pen<strong>de</strong>nt if configured as input or output)<br />
K5H configures transistor switch K5 to ON state.<br />
Special case: KCR reads the logic levels of all I/O as one data word. Every bit of this<br />
data word is equal to the logic level of the respective I/O - number.<br />
I/O no.0 adds to the number with weight 1 and I/O no.5 adds with weight 32<br />
(in general: I/O no. n adds with weight 2 n )<br />
16
Example: If all digital I/O are configured as inputs with pull up resistors and the transistor switches<br />
are set to OFF (= state of <strong>de</strong>livery without external components), then the command KCR will<br />
message:”KC:15” or when hex numbers are active: “KC:$F”.<br />
L (no parameter)<br />
configures the previously selected digital I/O as output with LOW level<br />
Example: K3L<br />
H (no parameter)<br />
configures the previously selected digital I/O as output with HIGH level<br />
Alternative meaning: GHn sets the high portion of the square wave generator<br />
P (no parameter)<br />
sets the previously selected digital I/O as input with pull-up resistor<br />
Comment: The pull-up resistor (ca. 20-30 kKiloohm) connects the input internally with +5 Volt, as a result<br />
high level is read when no external components are connected. External signals may pull down this<br />
level. This kind of preset is rather insensitive to electric noise.<br />
Z (no parameter)<br />
sets the previously selected digital I/O as input with high impedance ("hi Z")<br />
Alternative meaning: JZ reset the pulse counter and the enco<strong>de</strong>r counter<br />
R(no parameter)<br />
“READ” = command to read (poll) an input value or OUT level<br />
Individual digital I/O are always reported <strong>de</strong>bounced. See command Y.<br />
The command KDR however reads the input states immediately and directly - without noise filtering-<br />
- and therefore it is best suitable for very fast evaluation.<br />
Comment: The answer is sent in the following ASCII format:<br />
--- Repetition of the polled I/O "<strong>de</strong>vice"<br />
--- if a<strong>de</strong>quate: I/O number<br />
--- colon<br />
--- result as number in ASCII text representation<br />
--- <br />
Examples: K3R messages for instance K3:0 <br />
KCR messages for instance KC:$A <br />
XRmessages for instance X:25478 <br />
Y )<br />
sets the time constant to <strong>de</strong>bounce readout of digital I/O (ca. in milliseconds)<br />
Parameter: time <strong>de</strong>lay between two samples and compares of the logic levels of the<br />
digitalI/O. in milliseconds<br />
17
The permanent sampling of input levels and comparison with their previous values is<br />
automatically performed as a background process. According to the inten<strong>de</strong>d application it<br />
makes sense to perform this comparison in short time intervals or with a certain <strong>de</strong>lay. For relay<br />
contacts 10 milliseconds most times is an appropriate time interval, but to <strong>de</strong>bounce simple<br />
pushbuttons 40-100 milliseconds are preferable.<br />
The <strong>de</strong>fault setting is 40 milliseconds.<br />
Because the sampling process is not synchronized with the changes of external signals, it takes<br />
at least one and up to two periods of the sampling timer to recognize a <strong>de</strong>bounced input change<br />
reliably. Pulses shorter than two periods may be disregar<strong>de</strong>d.<br />
Example: Y10 sets the I/O sampling perio<strong>de</strong> to 10 ms<br />
JR (no parameter)<br />
Poll pulse counter at I/O no. 0.<br />
Comment: Pulse counter and enco<strong>de</strong>r counter use separate memory cells, so they can be read<br />
in<strong>de</strong>pen<strong>de</strong>ntly. The reset command however influences both counters in common.<br />
JZ (no parameter)<br />
Reset pulse copunter and enco<strong>de</strong>r counter at I/O no. 0<br />
Comment: The reset command always influences both counters in common.<br />
XR (no parameter)<br />
Read enco<strong>de</strong>r counter at I/O no. 0<br />
(the direction of rotation<br />
= direction of count is <strong>de</strong>termined by the logic level at I/O no.1)<br />
Comment: whereas the the pulse counter is increased at any high-to-low level change at I/O no. 0,<br />
the enco<strong>de</strong>r counter checks the actual level at I/O no.1. If "high", the counter is incremented, if "low" the<br />
enco<strong>de</strong>r counter is <strong>de</strong>cremented<br />
1<br />
W4H <br />
Activates transistor switch no. 4 as pulse width modulator. In its standard setup the<br />
pulse width modulator words with a constant frequency of 15686 Hz and is adjustable with<br />
steps of 8 bit resolution (i.e. within 255 = hex FF steps).<br />
Parameter: high portion of the pulse shape at I/O no.4.<br />
expressed in percent: 100 x / 255<br />
Switch this pulse width modulator OFF with any command applied to transistor<br />
OUT no. 4 (K4L, K45H).<br />
Comment: Have a look at appendix A for more complex options of PWM setting.<br />
Example: W5H128 generates a square wave at transistor no.4 (open drain) with 50% high portion<br />
W5H <br />
Activates transistor switch no. 5 as pulse width modulator. In its standard setup the<br />
pulse width modulator words with a constant frequency of 3910 Hz and is adjustable with<br />
steps of 10 bit resolution (i.e. within 1023 = hex3FF steps).<br />
18
Parameter: high portion of the pulse shape at I/O no.0.<br />
expressed in percent: 100 x / 1023<br />
Switch this pulse width modulator OFF with any command applied to transistor<br />
OUT no. 5 (K5L, K5H) or with any command to start the square wave generator.<br />
Comment: Have a look at appendix A for more complex options of PWM setting.<br />
Example: W5H256 generates a square wave at transistor no.5 (open drain) with 25% high portion<br />
GT <br />
Activates digital I/O no. 5 as a programmable square wave generator.<br />
Parameter: Total period of the output sqare wave as a multiple of about 32<br />
microseconds. Therefore the max. Frequency is about 15,6 Kilohertz (GH=1,GT=2).<br />
Accepted parameters are in the range 1 to 65535 (hexFFFF). The maximum<br />
parameter sets the minimum frequency, which is about 1 Hz.<br />
Switch the frequency generator OFF with any 'K' - command applied to digital I/O<br />
no. 5 (K5L, K5H) or with any command which starts the pulse width modulator W5.<br />
Comment: The square wave generator is always started with a sequence of TWO commands:<br />
Before the square wave generator can be started, the duration of the high period has to be<br />
entered with the command 'GH'. Else unpredictable behaviour has to be expected. But when the<br />
square wave generator is active, total period and high period can be changed in<strong>de</strong>pen<strong>de</strong>ntly with<br />
immediate effect. Of course, the total period must always be bigger than the high period!<br />
Example: GH100GT200<br />
GH <br />
Preselection of the high period for I/O no. 5 as square wave generator.<br />
Q1<br />
Parameter: Duration of the high period of the output sqare wave as a multiple of about<br />
32 microseconds. Accepted parameters are in the range 1 to 65534 (hexFFFE).<br />
See comment at "GT" command above<br />
Comment: Before the square wave generator may be started, the duration of the high period<br />
has to be initialized with this command GH. While the square wave generator is active, total period<br />
and high period can be changed in<strong>de</strong>pen<strong>de</strong>ntly with immediate effect. Of course, the total period<br />
must always be bigger than the high period!<br />
Example: GH2GT$FFF<br />
switch RTS/CTS Handshake ON<br />
Q0<br />
switch RTS/CTS Handshake OFF<br />
19
{ ] (no parameter)<br />
Initiates "download" of the complete nonvolatile memory (all strings and permanently<br />
stored system configuration) to a PC via <strong>RS</strong>-<strong>232</strong> using the "XMODEM CRC" protocol<br />
Comment: This command allows to make a backup of possibly expensively programmed strings<br />
To avoid acci<strong>de</strong>ntal start of this command, both command bytes have to be entered in immediate<br />
sequence.<br />
On the computer which is used for the backup a software has to be installed and started which is able to<br />
perform the transfer als a sequence of <strong>de</strong>fined data packets using the XMODEM CRCprotocol.<br />
Applicable transfer software is for example "Hyperterminal", which is combined with a terminal software<br />
to perform any ASCII operation of the <strong>Converter</strong> too, especially rotary switch positions E and F.<br />
First the command sequence { ] has to be entered. Then a message is sent back to the controlling PC<br />
that the XMODEM CRC 'Receive' function should be started. Now the user opens a corresponding<br />
dialog at the XMODEM software where the name of the backup file is entered. The <strong>Converter</strong> remains<br />
waiting for max 100 seconds while these steps are performed on the PC. After this is finished the PC<br />
initiates and controls the download. Depending on the baud rate, the download takes about 1 minute.<br />
{ [ (no parameter)<br />
Initiates "upload" of a previously stored backup to the nonvolatile memory (all<br />
programmed string and permanently stored system configuration) from a PC via <strong>RS</strong>-<br />
<strong>232</strong> using the "XMODEM CRC" protocol<br />
Comment: On the controlling PC a software has to be started, which is able to transfer the backup as<br />
a sequence of <strong>de</strong>fined data packets using the "XMODEM CRC" protocol. This may be attractive to<br />
exchange different sets of "programmed strings"<br />
To avoid acci<strong>de</strong>ntal start of this command, both command bytes have to be entered in immediate<br />
sequence.<br />
It is exclusively possible to upload a backup from a <strong>MIDI</strong> <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> <strong>Converter</strong>, not from other<br />
similar Cinetix products. Un<strong>de</strong>r certain conditions after a hardware update (microcontroller module) a<br />
backup ma<strong>de</strong> with a previous version may be uploa<strong>de</strong>d - but un<strong>de</strong>r some conditions it may be<br />
impossible. Contact Cinetix service to check if this is possible in a specific case.<br />
First the command sequence { [ has to be entered. Then a message is sent back to the controlling PC<br />
that the XMODEM CRC 'Send' function should be started. Further gui<strong>de</strong> see comment of the<br />
complementary download command { ].<br />
? (no parameter)<br />
send all relevant system parameters as ASCII text string via serial interface<br />
Comment: The returned arguments <strong>de</strong>scribe following system features and the preceeding letters<br />
are i<strong>de</strong>ntical with the respective command co<strong>de</strong>s:<br />
KC: reads the actual levels of digital I/O no. 0 - 3 and digital OUT 4 and 5.<br />
o: data direction of digital I/O no. 0 - 3 as bit mask: bit=0: input, bit=1: output<br />
Y: <strong>de</strong>bounce time constand of the digital I/O in milliseconds<br />
Q: RTS/CTS handshake: 0=OFF, 1=ON<br />
@: actually stored number of bytes in the <strong>MIDI</strong> IN receive buffer<br />
N: configured <strong>MIDI</strong> channel for standard transformation serial byte �� <strong>MIDI</strong> message<br />
!: <strong>MIDI</strong> channel to be inserted into programmed strings<br />
%: bit mask for filtered trigger of programmed strings<br />
Example of a typical message:<br />
KC:15 o:0 Y:40 Q:0 @:0 N:1 !:0 %:255 <br />
20
~ ~ (no parameter)<br />
Sets the baud rate of the <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface to <strong>MIDI</strong> (31250 Bit/s)<br />
Comment: the 'til<strong>de</strong>' character has to be entered twice in immediate sequence. The changed baud<br />
rate wird is stored permanently, but not active before the next system reset (power on or turn of the<br />
rotary switch).<br />
| (no parameter)<br />
"clear all memory": All buffers and system parameters are reset to their <strong>de</strong>fault values:<br />
--- number base "<strong>de</strong>cimal"<br />
--- the <strong>MIDI</strong> channel for filtering of programmed strings (command !) is reset to 0 (= "all <strong>MIDI</strong> channels").<br />
--- All digital I/O are configured as ínput with pull-up resistor.<br />
--- digitalen OUT K4 and K5 are switched to low level (transistors OFF).<br />
--- All pulse generators are switched OFF<br />
The setting of the serial interface, the bit mask to filter trigger of programmed strings,<br />
the <strong>MIDI</strong> channel to be used for transformation serial byte �� <strong>MIDI</strong> vessage<br />
and all programmed strings remain unchanged.<br />
Merge- and Through-Box: (rotary switch position D) (new from July 2011)<br />
In this mo<strong>de</strong> of operation any <strong>MIDI</strong> channel messages and <strong>MIDI</strong> System Exclusive messages<br />
received at <strong>MIDI</strong> IN as well as those received at the serial interface are merged together<br />
maintaining correct integrity of messages (i.e. no <strong>MIDI</strong> message is interrupted or divi<strong>de</strong>d by<br />
another one from the other input). The resulting multiplexed signal is retransmitted<br />
simultaneously from <strong>MIDI</strong> OUT and from the serial interface. Running State is compensated<br />
(missing status bytes are inserted automatically to avoid confusion when different messages<br />
are merged).<br />
The baud rate of the serial interface is configurable, especially <strong>MIDI</strong> baud rate can be<br />
selected.<br />
By means of this technique for example <strong>MIDI</strong> messages transmitted from a media controller<br />
in standard PC baudrate can be copied into an existing stream of <strong>MIDI</strong> data. Or in<br />
combination with a "<strong>RS</strong>-<strong>422</strong> Expan<strong>de</strong>r for <strong>MIDI</strong> signals" two spatially wi<strong>de</strong> separated <strong>MIDI</strong>sources<br />
may be merged together.<br />
With some rather simple external hardware the <strong>RS</strong>-<strong>422</strong> interface (and with some restrictions the <strong>RS</strong>-<strong>232</strong><br />
interface too) can be modified to become a standard <strong>MIDI</strong> interface. See appendix B and<br />
"www.<strong>cinetix</strong>.<strong>de</strong>/interface/tiptrix/".<br />
21
The programmable command interpreter:<br />
Due to the complexity of this item only the most essential features can be indicated here. The complete<br />
documentation of the alternative programmable command interpreter is published at the website "www.ascontrol.<strong>de</strong>"<br />
or at the supplied CD-ROM.<br />
The programmable Command interpreter is only activated at position 0 of the rotary<br />
switch. Setup of the serial baud rate see "Installation and first operation" above.<br />
Operation and programming of the command interpreter are performed generally via the<br />
serial <strong>RS</strong>-<strong>232</strong>/<strong>RS</strong>-<strong>422</strong> interface. But with a suitable user program ist is possible, to run<br />
fuctions of the interpreter by use of <strong>MIDI</strong> messages.<br />
Apart from some special functions – which offer themselves for a <strong>de</strong>vice with <strong>MIDI</strong> interface –<br />
user programming is performed by means of a syntax, which roughly follows a very simplified<br />
"C" or "Java". It is implemented as a virtual stack engine that is completely created in fast<br />
assembly co<strong>de</strong> and so takes most out of the CPU power of the embed<strong>de</strong>d microcontroller.<br />
Differing from similar projects compilation of user projects takes place directly in the AS-<br />
Control interpreter and not in advance with a special tool on the host PC.<br />
Simplifications and modifications of the C syntax were ma<strong>de</strong> eyspecially to reduce the need<br />
for memory and to provi<strong>de</strong> a tool for efficient interactive and experimental handling. So there<br />
are no function prototypes and no mandatory "main" function. The interpreter runs<br />
permanently in the "main" loop: according to the situatiuon, it is set frome the interpreting into<br />
compiling state and after finishing this job it jumps back into interpreting/ executing state.<br />
Any function can be called from the controlling software (a terminal or industrial PLC, e.g.) at<br />
any time for its own - or it can be called by any function else during runtime .<br />
Some simple examples. For <strong>de</strong>tailled un<strong>de</strong>rstanding however, you are referred to the<br />
<strong>de</strong>tailled documentation:<br />
--- With the command "ops" a list of internal operators of the interpreter plus<br />
actually stored user-programmed funtions is listed via serial port. Internally all<br />
names of operators and functions are handled exclusively in upper case letters.<br />
But input is possible case in<strong>de</strong>pen<strong>de</strong>nt - differering from 'C'.<br />
--- Operators and previously programmed user functions may be composed<br />
spontaneously to immediate operations via terminal input,<br />
example: " p ( 2 + 3 ) " sends the resulting text '5' to the terminal.<br />
This <strong>de</strong>monstrates an essential restriction compared with a C-compiler usually running on a PC:<br />
every single syntactic element ("token") has to be separated with a SPACE.<br />
--- The same operationcan be compiled permanently as a user function as follows:<br />
" : sum p ( 2 + 3 ) ret "<br />
and from now an be called and executed with the phrase "sum " .<br />
The same procedure is applicable to I/O processes. For example the phrase<br />
" mtx3 (0xb0, 7 , u1 & 127 ) "<br />
evaluates one of the analog inputs as a <strong>MIDI</strong> volume control. With some<br />
additional programming work this can be compiled as an infinte loop within a<br />
user function or even as a background task..<br />
--- A set of user functions may be built "bottom-up" to more complex functions.<br />
--- this way chains of <strong>MIDI</strong> messages can be triggered with simple ASCII commands<br />
22
or by sensor input. Vice versa complex serial data messages may be triggered<br />
by a simple <strong>MIDI</strong> message.<br />
--- By use of the operator "autoexe" a user programmed function can be started<br />
automatically at system start. This provi<strong>de</strong>s a method for reset-proof<br />
standalone applications.<br />
Additionally at low system level a filter for <strong>MIDI</strong> channel messages is incorporated.<br />
<strong>MIDI</strong> channel messages which are filed arbitrarily into the data stream received at <strong>MIDI</strong> IN<br />
are picked out and put into a special buffer. They can be evaluated asynchroneously by the<br />
small standalone operating system. To get them clearly separated from other ASCII text it is<br />
strongly recommen<strong>de</strong>d not to send <strong>MIDI</strong> channel messages in running state! This way it<br />
is possible, for instance, to control a program flow with an external <strong>MIDI</strong> keyboard and to<br />
combine such an input with the states of the I/O lines. For this purpose the following special<br />
commands are implemented: MCHECK, GETMSG, DROPMSG, STATUS, MDAT1, MDAT2.<br />
MCHECK is equivalent to "kbhit" in C-programming. Instead of a TRUE flag it returns the<br />
status byte of the <strong>MIDI</strong> message which would be read next out of the buffer (= el<strong>de</strong>st<br />
available in the queue), but leaves the message in the buffer.<br />
GETMSG gets the next channel message out of the buffer (or waits infinitely for the next one<br />
to arrive). The components of this message are stored into the respective system variables<br />
STATUS, MDAT1 and MDAT2 – which subsequently can be read with commands of the<br />
same name. They are not <strong>de</strong>leted before the next <strong>MIDI</strong> message is taken out of the buffer<br />
with a GETMSG command.<br />
DROPMSG <strong>de</strong>letes the el<strong>de</strong>st channel message out of the buffer. The system variables<br />
<strong>de</strong>scribed about remain unchanged.<br />
Vice versa an easy to handle set of commands is implemented to format and send all <strong>MIDI</strong><br />
channel messages as well as System Exclusive messages. With the command MC the <strong>MIDI</strong><br />
channel inserted into <strong>MIDI</strong> messages may be temporarily modified with respect to the <strong>de</strong>fault<br />
setting.<br />
Appendix A:<br />
more complex configuration of the pulse width modulator at I/O no. 4:<br />
this pulse width modulator provi<strong>de</strong>s only 8 bit of resolution. The handling of Hi Arg and Low Arg corresponds<br />
with the <strong>de</strong>scription for I/O no. 5 below<br />
Hi Arg. (hex) Hi Arg. (<strong>de</strong>z) base frequency (ca Hz) Low Arg.(hex) Low Arg. (<strong>de</strong>z)<br />
0 o<strong>de</strong>r 100 256 15682 0 .. FF 0..255<br />
200 512 1960 0 .. FF 0..255<br />
300 768 490 0 .. FF 0..255<br />
400 1024 245 0 .. FF 0..255<br />
500 1280 123 0 .. FF 0..255<br />
600 1536 61 0 .. FF 0..255<br />
700 1792 15 0 .. FF 0..255<br />
23
more complex configuration of the pulse width modulator at I/O no. 5:<br />
With the configuration method <strong>de</strong>scribed in the main part of the manual, the pulse witdth modulators at<br />
transistor outputs no 4 and 5 are quite useful for generation of analog output voltages by means of an<br />
external low pass filter. With the alternatives <strong>de</strong>scribed as follows other interesting applications become<br />
possible, as drive of RC servo motors.<br />
The concept is un<strong>de</strong>rstood best when it is regar<strong>de</strong>d in hexa<strong>de</strong>cimal notation. The highest nibble (“Hi-Arg”)b<br />
<strong>de</strong>scribes base frequency and resolution, the lower 3 nibbles <strong>de</strong>fine the high portion of the generated<br />
square wave. "Thinking <strong>de</strong>cimal"you have tpo add both parts as “strange odd” numbers.<br />
Anyhow: the configuration <strong>de</strong>scribed in the main part of the manual is i<strong>de</strong>ntical with the one <strong>de</strong>scribed here with<br />
Hi Arg hex9000. When the pulse width modulator is started, the Hi-Arg always has to be entered explicitly (apart<br />
from special case cited above). If the Low-Arg shall be modified while the PWM is active, it is sufficient to<br />
set the hHigh-Argument = 0.<br />
Hi Arg. (hex) Hi Arg. (<strong>de</strong>z) resolution (Bit) base frequency (ca.Hz) Low Arg.(hex) Low Arg. (<strong>de</strong>z)<br />
1000 4096 8 15686 0 .. FF 0..255<br />
2000 8192 8 1960 0 .. FF 0..255<br />
3000 12288 8 245 0 .. FF 0..255<br />
4000 16384 8 61 0 .. FF 0..255<br />
5000 20480 8 15 0 .. FF 0..255<br />
9000 36864 10 3910 0 .. 3FF 0..1023<br />
A000 40960 10 489 0 .. 3FF 0..1023<br />
B000 45056 10 61 0 .. 3FF 0..1023<br />
C000 49152 10 15 0 .. 3FF 0..1023<br />
D000 53248 10 3.8 0 .. 3FF 0..1023<br />
Appendix B: <strong>MIDI</strong> interface at the <strong>RS</strong>-<strong>422</strong> interface<br />
* ) the <strong>RS</strong>-<strong>422</strong> driver IC has a certain source resistance. If more than 2 <strong>MIDI</strong> OUT are connected, the serial<br />
resistor at <strong>MIDI</strong> OUT should be reduced to 180 Ohm.<br />
Cinetix Medien und Interface GmbH<br />
Gemün<strong>de</strong>nerstr. 27 D-60599 Frankfurt/Main<br />
Fon: +49-69-68 51 05 Fax +49-69-68 600 409<br />
http://www.<strong>cinetix</strong>.<strong>de</strong>/interface/<br />
* Right of technical modifications reserved.<br />
* This <strong>de</strong>scription is for information only, no product specifications are assured in juridical sense.<br />
* Tra<strong>de</strong>marks and product names cited in this text are property of their respective owners.<br />
24