Global control messages, Host connection and initialization, Global – Apple Logic 7 User Manual
Page 240

240
Appendix B
Logic Control—MIDI Implementation
Global Control Messages
Host Connection and Initialization
Received:
Device Query
Host Connection Reply
Go Offline
Transmitted:
Host Connection Query
Host Connection Confirmation
Host Connection Error
ss
=
Serial number (7 bytes ASCII text, non null-terminated)
ll
=
Challenge code (4 bytes)
rr
=
Response code (4 bytes)
Offline
Mode:
Logic
Control
employs
a
query
system
to
maintain
a
connection
to
the
host
software.
When
Logic
Control
is
initially
powered
up,
it
defaults
to
Offline
mode.
In
Offline
mode,
Logic
Control’s
faders
move
to
their
lowest
setting,
and
the
LCD
reads
“EMAGIC
LOGIC
CONTROL
--
by
MACKIE.”
After
power-on,
Logic
Control
also
transmits
a
system
exclusive
Host
Connection
Query
message
that
is
used
(by
the
host)
to
detect
a
connection,
and
what
type
of
device
is
connected
(Logic
Control/Logic
Control
XT).
Communications
Initialization:
When
the
host
software
receives
a
Host
Connection
Query
message
(containing
a
serial
number
and
a
random
challenge
code),
it
should
transmit
a
Host
Connection
Reply
command
within
300ms
to
initialize
Logic
Control.
The
command
must
contain
the
same
serial
number
and
the
correct
response
code
for
the
challenge
code.
Here
is
the
algorithm
(l1
to
l4
=
challenge
code
bytes
1
to
4,
r1
to
r4
=
response
code
bytes
1
to
4):
r1
=
0x7F
&
(l1
+
(l2
^
0xa)
–
l4);
r2
=
0x7F
&
((l3>>4)
^
(l1+l4));
r3
=
0x7F
&
(l4-(l3<<2)
^
(l1|l2));
r4
=
0x7F
&
(l2-l3+(0xF0^(l4<<4)));
Logic
Control
will,
in
turn,
respond
with
either:
Â
a
Host
Connection
Confirmation
message
that
contains
the
serial
number,
and
switch
to
Online
mode—where
it
will
await
further
instructions
from
the
host,
or
Â
reply with a Host Connection Error message, if the response code was wrong.