• We would like to remind our members that this is a privately owned, run and supported forum. You are here at the invitation and discretion of the owners. As such, rules and standards of conduct will be applied that help keep this forum functioning as the owners desire. These include, but are not limited to, removing content and even access to the forum.

    Please give yourself a refresher on the forum rules you agreed to follow when you signed up.

How to convert tempo as two 7-bit MIDI bytes, LS first?

GotMetalBoy

Power User
I was reading the Axe-Fx III MIDI for 3rd Party devices v1.3 and it says:

Message format: F0 00 01 74 10 14 dd dd cs F7

Where dd dd is the desired tempo as two 7-bit MIDI bytes, LS first.

Is there a formula or a program I can use to figure out dd dd and the checksum? I took a beginners course for Python a few years ago but I could learn it again if I can use it.

I have a spreadsheet of sysex msgs to send to my Axe-Fx II to set the tempo and I want to do the same thing with my Axe-Fx III.
 

GM Arts

Power User
You need to get 7-bit values, so divide tempo by 128

For example 141 bpm, divided by 128 = 1 with a remainder of 13. The least significant value comes first, so that's 13, written in hex format as "0D". Next comes the most significant value of 1, written in hex format as "01".

You can find information on calculating the checksum here:
https://wiki.fractalaudio.com/axefx2/index.php?title=MIDI_SysEx#MIDI_SysEx:_calculating_the_SysEx_Checksum

Another example, this message sets tempo of 120 bpm: F0 00 01 74 10 14 78 00 79 F7
 

unix-guy

Legend!
You need to get 7-bit values, so divide tempo by 128

For example 141 bpm, divided by 128 = 1 with a remainder of 13. The least significant value comes first, so that's 13, written in hex format as "0D". Next comes the most significant value of 1, written in hex format as "01".

You can find information on calculating the checksum here:
https://wiki.fractalaudio.com/axefx2/index.php?title=MIDI_SysEx#MIDI_SysEx:_calculating_the_SysEx_Checksum

Another example, this message sets tempo of 120 bpm: F0 00 01 74 10 14 78 00 79 F7
So how does it work when the tempo is less than 128? The result would be a fraction...

In the case where it's less than 128 you just set lsb to the hex of the tempo and msb to 0?

Looking at your example, I think that is correct:

78 hex == 120 dec
00 hex == 0 dec

F0 00 01 74 10 14 78 00 79 F7
 

GotMetalBoy

Power User
Here's my conversion chart from Tempo to Sysex msg for the Axe-Fx !!! :D Also a big THANK YOU! to @Tumatauenga and @GM Arts

I have to split up the sysex msgs because I was getting an error that the post was too long.

Tempo 20-59

Code:
20 = F0 00 01 74 10 14 14 00 15 F7
21 = F0 00 01 74 10 14 15 00 14 F7
22 = F0 00 01 74 10 14 16 00 17 F7
23 = F0 00 01 74 10 14 17 00 16 F7
24 = F0 00 01 74 10 14 18 00 19 F7
25 = F0 00 01 74 10 14 19 00 18 F7
26 = F0 00 01 74 10 14 1A 00 1B F7
27 = F0 00 01 74 10 14 1B 00 1A F7
28 = F0 00 01 74 10 14 1C 00 1D F7
29 = F0 00 01 74 10 14 1D 00 1C F7
30 = F0 00 01 74 10 14 1E 00 1F F7
31 = F0 00 01 74 10 14 1F 00 1E F7
32 = F0 00 01 74 10 14 20 00 21 F7
33 = F0 00 01 74 10 14 21 00 20 F7
34 = F0 00 01 74 10 14 22 00 23 F7
35 = F0 00 01 74 10 14 23 00 22 F7
36 = F0 00 01 74 10 14 24 00 25 F7
37 = F0 00 01 74 10 14 25 00 24 F7
38 = F0 00 01 74 10 14 26 00 27 F7
39 = F0 00 01 74 10 14 27 00 26 F7
40 = F0 00 01 74 10 14 28 00 29 F7
41 = F0 00 01 74 10 14 29 00 28 F7
42 = F0 00 01 74 10 14 2A 00 2B F7
43 = F0 00 01 74 10 14 2B 00 2A F7
44 = F0 00 01 74 10 14 2C 00 2D F7
45 = F0 00 01 74 10 14 2D 00 2C F7
46 = F0 00 01 74 10 14 2E 00 2F F7
47 = F0 00 01 74 10 14 2F 00 2E F7
48 = F0 00 01 74 10 14 30 00 31 F7
49 = F0 00 01 74 10 14 31 00 30 F7
50 = F0 00 01 74 10 14 32 00 33 F7
51 = F0 00 01 74 10 14 33 00 32 F7
52 = F0 00 01 74 10 14 34 00 35 F7
53 = F0 00 01 74 10 14 35 00 34 F7
54 = F0 00 01 74 10 14 36 00 37 F7
55 = F0 00 01 74 10 14 37 00 36 F7
56 = F0 00 01 74 10 14 38 00 39 F7
57 = F0 00 01 74 10 14 39 00 38 F7
58 = F0 00 01 74 10 14 3A 00 3B F7
59 = F0 00 01 74 10 14 3B 00 3A F7
 

GotMetalBoy

Power User
Tempo 60-119

Code:
60 = F0 00 01 74 10 14 3C 00 3D F7
61 = F0 00 01 74 10 14 3D 00 3C F7
62 = F0 00 01 74 10 14 3E 00 3F F7
63 = F0 00 01 74 10 14 3F 00 3E F7
64 = F0 00 01 74 10 14 40 00 41 F7
65 = F0 00 01 74 10 14 41 00 40 F7
66 = F0 00 01 74 10 14 42 00 43 F7
67 = F0 00 01 74 10 14 43 00 42 F7
68 = F0 00 01 74 10 14 44 00 45 F7
69 = F0 00 01 74 10 14 45 00 44 F7
70 = F0 00 01 74 10 14 46 00 47 F7
71 = F0 00 01 74 10 14 47 00 46 F7
72 = F0 00 01 74 10 14 48 00 49 F7
73 = F0 00 01 74 10 14 49 00 48 F7
74 = F0 00 01 74 10 14 4A 00 4B F7
75 = F0 00 01 74 10 14 4B 00 4A F7
76 = F0 00 01 74 10 14 4C 00 4D F7
77 = F0 00 01 74 10 14 4D 00 4C F7
78 = F0 00 01 74 10 14 4E 00 4F F7
79 = F0 00 01 74 10 14 4F 00 4E F7
80 = F0 00 01 74 10 14 50 00 51 F7
81 = F0 00 01 74 10 14 51 00 50 F7
82 = F0 00 01 74 10 14 52 00 53 F7
83 = F0 00 01 74 10 14 53 00 52 F7
84 = F0 00 01 74 10 14 54 00 55 F7
85 = F0 00 01 74 10 14 55 00 54 F7
86 = F0 00 01 74 10 14 56 00 57 F7
87 = F0 00 01 74 10 14 57 00 56 F7
88 = F0 00 01 74 10 14 58 00 59 F7
89 = F0 00 01 74 10 14 59 00 58 F7
90 = F0 00 01 74 10 14 5A 00 5B F7
91 = F0 00 01 74 10 14 5B 00 5A F7
92 = F0 00 01 74 10 14 5C 00 5D F7
93 = F0 00 01 74 10 14 5D 00 5C F7
94 = F0 00 01 74 10 14 5E 00 5F F7
95 = F0 00 01 74 10 14 5F 00 5E F7
96 = F0 00 01 74 10 14 60 00 61 F7
97 = F0 00 01 74 10 14 61 00 60 F7
98 = F0 00 01 74 10 14 62 00 63 F7
99 = F0 00 01 74 10 14 63 00 62 F7
100 = F0 00 01 74 10 14 64 00 65 F7
101 = F0 00 01 74 10 14 65 00 64 F7
102 = F0 00 01 74 10 14 66 00 67 F7
103 = F0 00 01 74 10 14 67 00 66 F7
104 = F0 00 01 74 10 14 68 00 69 F7
105 = F0 00 01 74 10 14 69 00 68 F7
106 = F0 00 01 74 10 14 6A 00 6B F7
107 = F0 00 01 74 10 14 6B 00 6A F7
108 = F0 00 01 74 10 14 6C 00 6D F7
109 = F0 00 01 74 10 14 6D 00 6C F7
110 = F0 00 01 74 10 14 6E 00 6F F7
111 = F0 00 01 74 10 14 6F 00 6E F7
112 = F0 00 01 74 10 14 70 00 71 F7
113 = F0 00 01 74 10 14 71 00 70 F7
114 = F0 00 01 74 10 14 72 00 73 F7
115 = F0 00 01 74 10 14 73 00 72 F7
116 = F0 00 01 74 10 14 74 00 75 F7
117 = F0 00 01 74 10 14 75 00 74 F7
118 = F0 00 01 74 10 14 76 00 77 F7
119 = F0 00 01 74 10 14 77 00 76 F7
 

GotMetalBoy

Power User
Tempo 120-250

Code:
120 = F0 00 01 74 10 14 78 00 79 F7
121 = F0 00 01 74 10 14 79 00 78 F7
122 = F0 00 01 74 10 14 7A 00 7B F7
123 = F0 00 01 74 10 14 7B 00 7A F7
124 = F0 00 01 74 10 14 7C 00 7D F7
125 = F0 00 01 74 10 14 7D 00 7C F7
126 = F0 00 01 74 10 14 7E 00 7F F7
127 = F0 00 01 74 10 14 7F 00 7E F7
128 = F0 00 01 74 10 14 00 01 00 F7
129 = F0 00 01 74 10 14 01 01 01 F7
130 = F0 00 01 74 10 14 02 01 02 F7
131 = F0 00 01 74 10 14 03 01 03 F7
132 = F0 00 01 74 10 14 04 01 04 F7
133 = F0 00 01 74 10 14 05 01 05 F7
134 = F0 00 01 74 10 14 06 01 06 F7
135 = F0 00 01 74 10 14 07 01 07 F7
136 = F0 00 01 74 10 14 08 01 08 F7
137 = F0 00 01 74 10 14 09 01 09 F7
138 = F0 00 01 74 10 14 0A 01 0A F7
139 = F0 00 01 74 10 14 0B 01 0B F7
140 = F0 00 01 74 10 14 0C 01 0C F7
141 = F0 00 01 74 10 14 0D 01 0D F7
142 = F0 00 01 74 10 14 0E 01 0E F7
143 = F0 00 01 74 10 14 0F 01 0F F7
144 = F0 00 01 74 10 14 10 01 10 F7
145 = F0 00 01 74 10 14 11 01 11 F7
146 = F0 00 01 74 10 14 12 01 12 F7
147 = F0 00 01 74 10 14 13 01 13 F7
148 = F0 00 01 74 10 14 14 01 14 F7
149 = F0 00 01 74 10 14 15 01 15 F7
150 = F0 00 01 74 10 14 16 01 16 F7
151 = F0 00 01 74 10 14 17 01 17 F7
152 = F0 00 01 74 10 14 18 01 18 F7
153 = F0 00 01 74 10 14 19 01 19 F7
154 = F0 00 01 74 10 14 1A 01 1A F7
155 = F0 00 01 74 10 14 1B 01 1B F7
156 = F0 00 01 74 10 14 1C 01 1C F7
157 = F0 00 01 74 10 14 1D 01 1D F7
158 = F0 00 01 74 10 14 1E 01 1E F7
159 = F0 00 01 74 10 14 1F 01 1F F7
160 = F0 00 01 74 10 14 20 01 20 F7
161 = F0 00 01 74 10 14 21 01 21 F7
162 = F0 00 01 74 10 14 22 01 22 F7
163 = F0 00 01 74 10 14 23 01 23 F7
164 = F0 00 01 74 10 14 24 01 24 F7
165 = F0 00 01 74 10 14 25 01 25 F7
166 = F0 00 01 74 10 14 26 01 26 F7
167 = F0 00 01 74 10 14 27 01 27 F7
168 = F0 00 01 74 10 14 28 01 28 F7
169 = F0 00 01 74 10 14 29 01 29 F7
170 = F0 00 01 74 10 14 2A 01 2A F7
171 = F0 00 01 74 10 14 2B 01 2B F7
172 = F0 00 01 74 10 14 2C 01 2C F7
173 = F0 00 01 74 10 14 2D 01 2D F7
174 = F0 00 01 74 10 14 2E 01 2E F7
175 = F0 00 01 74 10 14 2F 01 2F F7
176 = F0 00 01 74 10 14 30 01 30 F7
177 = F0 00 01 74 10 14 31 01 31 F7
178 = F0 00 01 74 10 14 32 01 32 F7
179 = F0 00 01 74 10 14 33 01 33 F7
180 = F0 00 01 74 10 14 34 01 34 F7
181 = F0 00 01 74 10 14 35 01 35 F7
182 = F0 00 01 74 10 14 36 01 36 F7
183 = F0 00 01 74 10 14 37 01 37 F7
184 = F0 00 01 74 10 14 38 01 38 F7
185 = F0 00 01 74 10 14 39 01 39 F7
186 = F0 00 01 74 10 14 3A 01 3A F7
187 = F0 00 01 74 10 14 3B 01 3B F7
188 = F0 00 01 74 10 14 3C 01 3C F7
189 = F0 00 01 74 10 14 3D 01 3D F7
190 = F0 00 01 74 10 14 3E 01 3E F7
191 = F0 00 01 74 10 14 3F 01 3F F7
192 = F0 00 01 74 10 14 40 01 40 F7
193 = F0 00 01 74 10 14 41 01 41 F7
194 = F0 00 01 74 10 14 42 01 42 F7
195 = F0 00 01 74 10 14 43 01 43 F7
196 = F0 00 01 74 10 14 44 01 44 F7
197 = F0 00 01 74 10 14 45 01 45 F7
198 = F0 00 01 74 10 14 46 01 46 F7
199 = F0 00 01 74 10 14 47 01 47 F7
200 = F0 00 01 74 10 14 48 01 48 F7
201 = F0 00 01 74 10 14 49 01 49 F7
202 = F0 00 01 74 10 14 4A 01 4A F7
203 = F0 00 01 74 10 14 4B 01 4B F7
204 = F0 00 01 74 10 14 4C 01 4C F7
205 = F0 00 01 74 10 14 4D 01 4D F7
206 = F0 00 01 74 10 14 4E 01 4E F7
207 = F0 00 01 74 10 14 4F 01 4F F7
208 = F0 00 01 74 10 14 50 01 50 F7
209 = F0 00 01 74 10 14 51 01 51 F7
210 = F0 00 01 74 10 14 52 01 52 F7
211 = F0 00 01 74 10 14 53 01 53 F7
212 = F0 00 01 74 10 14 54 01 54 F7
213 = F0 00 01 74 10 14 55 01 55 F7
214 = F0 00 01 74 10 14 56 01 56 F7
215 = F0 00 01 74 10 14 57 01 57 F7
216 = F0 00 01 74 10 14 58 01 58 F7
217 = F0 00 01 74 10 14 59 01 59 F7
218 = F0 00 01 74 10 14 5A 01 5A F7
219 = F0 00 01 74 10 14 5B 01 5B F7
220 = F0 00 01 74 10 14 5C 01 5C F7
221 = F0 00 01 74 10 14 5D 01 5D F7
222 = F0 00 01 74 10 14 5E 01 5E F7
223 = F0 00 01 74 10 14 5F 01 5F F7
224 = F0 00 01 74 10 14 60 01 60 F7
225 = F0 00 01 74 10 14 61 01 61 F7
226 = F0 00 01 74 10 14 62 01 62 F7
227 = F0 00 01 74 10 14 63 01 63 F7
228 = F0 00 01 74 10 14 64 01 64 F7
229 = F0 00 01 74 10 14 65 01 65 F7
230 = F0 00 01 74 10 14 66 01 66 F7
231 = F0 00 01 74 10 14 67 01 67 F7
232 = F0 00 01 74 10 14 68 01 68 F7
233 = F0 00 01 74 10 14 69 01 69 F7
234 = F0 00 01 74 10 14 6A 01 6A F7
235 = F0 00 01 74 10 14 6B 01 6B F7
236 = F0 00 01 74 10 14 6C 01 6C F7
237 = F0 00 01 74 10 14 6D 01 6D F7
238 = F0 00 01 74 10 14 6E 01 6E F7
239 = F0 00 01 74 10 14 6F 01 6F F7
240 = F0 00 01 74 10 14 70 01 70 F7
241 = F0 00 01 74 10 14 71 01 71 F7
242 = F0 00 01 74 10 14 72 01 72 F7
243 = F0 00 01 74 10 14 73 01 73 F7
244 = F0 00 01 74 10 14 74 01 74 F7
245 = F0 00 01 74 10 14 75 01 75 F7
246 = F0 00 01 74 10 14 76 01 76 F7
247 = F0 00 01 74 10 14 77 01 77 F7
248 = F0 00 01 74 10 14 78 01 78 F7
249 = F0 00 01 74 10 14 79 01 79 F7
250 = F0 00 01 74 10 14 7A 01 7A F7
 

GotMetalBoy

Power User
You need to get 7-bit values, so divide tempo by 128

For example 141 bpm, divided by 128 = 1 with a remainder of 13. The least significant value comes first, so that's 13, written in hex format as "0D". Next comes the most significant value of 1, written in hex format as "01".

You can find information on calculating the checksum here:
https://wiki.fractalaudio.com/axefx2/index.php?title=MIDI_SysEx#MIDI_SysEx:_calculating_the_SysEx_Checksum

Another example, this message sets tempo of 120 bpm: F0 00 01 74 10 14 78 00 79 F7
Is this the formula to convert a 16bit value into 7bit values?

Value = 65533 / 2^14 = 3 = 0x03 Remainder = 16381 / 2^7=127 = 0x7F Remainder = 125 = 0x7D

LSB 1st = 7D 7F 03
 

GotMetalBoy

Power User
I also figured out how to do it in Python.

* Here's the online Python Shell: https://www.python.org/shell/
* To calculate the checksum for a tempo of 181 Type:
Code:
hex(0xF0^0x00^0x01^0x74^0x10^0x14^0x35^0x01)
* Which = 0xB5
* Now type:
Code:
hex(0xB5 & 0x7F)
* Which = the checksum 0x35
 
Last edited:

GotMetalBoy

Power User
To format HEX in Excel to include the 0x like 0x35, create a Custom Number format and use:
Code:
"0x"@
and include the 2 quotes.
 

unix-guy

Legend!
I also figured out how to do it in Python.

* Here's the online Python Shell: https://www.python.org/shell/
* To calculate the checksum for a tempo of 181 Type:
Code:
hex(0xF0^0x00^0x01^0x74^0x10^0x14^0x35^0x01 & 0x7F)
* Which = 0xB5
* Now type:
Code:
hex(0xB5 & 0x7F)
* Which = the checksum 0x35
Why are you and'ing 0x7F twice? You already have it in the first code block... Which is what the wiki says to do.
 

GM Arts

Power User
Is this the formula to convert a 16bit value into 7bit values?

Value = 65533 / 2^14 = 3 = 0x03 Remainder = 16381 / 2^7=127 = 0x7F Remainder = 125 = 0x7D

LSB 1st = 7D 7F 03
That's correct. To code a division by 128 I would use bit shifting:

Remainder of dividing x by 128 is: x & 0x7F
Integer portion of dividing x by 128 is: x >> 7
 
Last edited:

GotMetalBoy

Power User
Why are you and'ing 0x7F twice? You already have it in the first code block... Which is what the wiki says to do.
Sorry that was a typo but I just fixed my post. Thanks for bringing that to my attention :)

The first line of code is supposed to be: hex(0xF0^0x00^0x01^0x74^0x10^0x14^0x35^0x01)
 

GotMetalBoy

Power User
That's correct. To code a division by 128 I would use bit shifting:

Remainder of dividing x by 128 is: x & 0x7F
Integer portion of dividing x by 128 is: x >> 7
@GM Arts I want to thank you again for explaining this, so I could understand it. I never understood what 7bit or LSB first was but now I do and it opens a whole new door of things I can do with sysex and my Axe-Fx II and Axe-Fx III :D
 
Top Bottom