Roland V-Piano Grand GP-7 Implementation page 12

Midi implementation
Table of Contents

Advertisement

MIDI Implementation
■ Example of an Exclusive Message and Calculating a
Checksum
Roland Exclusive messages (RQ1, DT1) are transmitted with a checksum at the end (before
F7) to make sure that the message was correctly received. The value of the checksum is
determined by the address and data (or size) of the transmitted Exclusive message.
●How to calculate the checksum
(hexadecimal numbers are indicated by "H")
The checksum is a value derived by adding the address, size, and checksum itself and
inverting the lower 7 bits.
Here's an example of how the check sum is calculated. We will assume that in the Exclusive
message we are transmitting, the address is aa bb cc ddH and the data or size is ee ffH.
aa + bb + cc + dd + ee + ff = sum
sum ÷ 128 = quotient ... remainder
128 - remainder = checksum
<Example> Setting Temperament to JUST MINOR (DT1)
According to the "Parameter Address Map" (p. 7), the start address of System is 20 00 00
00H, the offset address of System Common is 00 00H, and the address of Temperament is 00
04H. Therefore the address of Temperament of System is;
20 00 00 00H
00 00H
+)
00 04H
20 00 00 04H
JUST MINOR has the value of 02H.
So the system exclusive message should be sent is;
F0
41
10
00 00 39
12
(1)
(2)
(3)
(4)
(5)
(1) Exclusive Status
(2) ID (Roland)
(4) Model ID (V-Piano Grand (GP-7))
Then calculate the checksum.
20H + 00H + 00H + 04H + 02H = 32 + 0 + 0 + 4 + 2 = 38 (sum)
38 (sum) ÷ 128 = 0 (quotient) ... 38 (remainder)
checksum = 128 - 38 (remainder) = 90 = 5AH
This means that F0 41 10 00 00 39 12 20 00 00 04 02 5A F7 is the message should be sent.
■ASCII Code Table
Setup Name of MIDI data are described the ASCII code in the table below.
+——————+——————+——————++——————+——————+——————++——————+——————+——————+
|
D
|
H
| Char ||
D
|
H
+——————+——————+——————++——————+——————+——————++——————+——————+——————+
|
32 |
20H |
SP
||
64 |
40H |
|
33 |
21H |
!
||
65 |
41H |
|
34 |
22H |
"
||
66 |
42H |
|
35 |
23H |
#
||
67 |
43H |
|
36 |
24H |
$
||
68 |
44H |
|
37 |
25H |
%
||
69 |
45H |
|
38 |
26H |
&
||
70 |
46H |
|
39 |
27H |
`
||
71 |
47H |
|
40 |
28H |
(
||
72 |
48H |
|
41 |
29H |
)
||
73 |
49H |
|
42 |
2AH |
*
||
74 |
4AH |
|
43 |
2BH |
+
||
75 |
4BH |
|
44 |
2CH |
,
||
76 |
4CH |
|
45 |
2DH |
||
77 |
4DH |
|
46 |
2EH |
.
||
78 |
4EH |
|
47 |
2FH |
/
||
79 |
4FH |
|
48 |
30H |
0
||
80 |
50H |
|
49 |
31H |
1
||
81 |
51H |
|
50 |
32H |
2
||
82 |
52H |
|
51 |
33H |
3
||
83 |
53H |
|
52 |
34H |
4
||
84 |
54H |
|
53 |
35H |
5
||
85 |
55H |
|
54 |
36H |
6
||
86 |
56H |
|
55 |
37H |
7
||
87 |
57H |
|
56 |
38H |
8
||
88 |
58H |
|
57 |
39H |
9
||
89 |
59H |
|
58 |
3AH |
:
||
90 |
5AH |
|
59 |
3BH |
;
||
91 |
5BH |
|
60 |
3CH |
<
||
92 |
5CH |
|
61 |
3DH |
=
||
93 |
5DH |
|
62 |
3EH |
>
||
94 |
5EH |
|
63 |
3FH |
?
||
95 |
5FH |
+——————+——————+——————++——————+——————+——————++——————+——————+——————+
D: decimal
H: hexadecimal
* "SP" is space.
12
20 00 00 04
02
??
address
data
checksum
(3) Device ID (17)
(5) Command ID (DT1)
(6) End of Exclusive
| Char ||
D
|
H
| Char |
@
||
96 |
60H |
`
|
A
||
97 |
61H |
a
|
B
||
98 |
62H |
b
|
C
||
99 |
63H |
c
|
D
||
100 |
64H |
d
|
E
||
101 |
65H |
e
|
F
||
102 |
66H |
f
|
G
||
103 |
67H |
g
|
H
||
104 |
68H |
h
|
I
||
105 |
69H |
i
|
J
||
106 |
6AH |
j
|
K
||
107 |
6BH |
k
|
L
||
108 |
6CH |
l
|
M
||
109 |
6DH |
m
|
N
||
110 |
6EH |
n
|
O
||
111 |
6FH |
o
|
P
||
112 |
70H |
p
|
Q
||
113 |
71H |
q
|
R
||
114 |
72H |
r
|
S
||
115 |
73H |
s
|
T
||
116 |
74H |
t
|
U
||
117 |
75H |
u
|
V
||
118 |
76H |
v
|
W
||
119 |
77H |
w
|
X
||
120 |
78H |
x
|
Y
||
121 |
79H |
y
|
Z
||
122 |
7AH |
z
|
[
||
123 |
7BH |
{
|
\
||
124 |
7CH |
|
|
]
||
125 |
7DH |
}
|
^
||
|
|
|
_
||
|
|
|
F7
(6)

Advertisement

Table of Contents
loading

Table of Contents