I would suggest turning on each bit individually and see what tempo value is displayed. In other words, for each byte, test values 1, 2, 4, 8, 16, 32, and 64 while keeping the other bytes zero. Do the displayed tempo values double each time you double the byte value?
Binary
Because MIDI data bytes can only containare 7 bits, when an 8meaning they can have decimal values from 0 to 127.
In a 7-bit byte needsbinary number:
- the bit on the right represents a decimal value of 1.
- the next bit to the left represents a decimal value of 2.
- the next bits to the left represent decimal values of 4, 8, 16, 32, and 64.
Decimal values from 0 to 127 can be sent in a System Exclusive message, manufacturers sometimes just put 4 bitsexpressed in one data byte and the other 4seven bits in the next data byte. So this, where each bit is one kind of pattern to look fora 0 or 1.
binary decimal
0000001 1 = 1
0000010 2 = 2
0000011 3 = 2 + 1
0000100 4 = 4
0000101 5 = 4 + 1
0000110 6 = 4 + 2
0000111 7 = 4 + 2 + 1
0001000 8 = 8
0001001 9 = 8 + 1
...
1111111 127 = 64 + 32 + 16 + 8 + 4 + 2 + 1
Pattern
From the results you described, one hypothesis I have is thatsuspect the turntable only cares about the lowest 4 bits in each byte. In other words, only the bits with decimal values of 1, 2, 4, and 8 will have an effect on the tempo display. This means only byte values 0 to 15 are useful.
I suspect the turntable is using the following pattern:
byte5:B1 1 2B2 4 8
B3 B4 tempo: .01 .02display
0 0 0 0 .0400 .08
0
byte4: 0 0 0 1 .01 "
0 0 0 2 4 8 .02 "
tempo: 0 0 0 3 .1603 "
0 0 0 4 .3204 "
0 0 0 5 .6405 1 "
0 0 0 6 .2806 "
0 0 0 7 .07 "
byte3: 10 2 4 0 0 8
tempo: 2 .5608 5 "
0 0 0 9 .1209 "
0 0 0 10 .2410 20 .481
0 0 0 11 .11 "
byte2: 10 2 4 80 0 12 .12 "
tempo: 400 0 0 13 .9613 81 "
0 0 0 14 .9214 163 "
0 0 0 15 .8415 327 "
0 0 1 0 .6816 "
0 0 1 1 .17 "
byte1: 0 0 1 2 .18 "
tempo: 6550 0 1 3 .3619 "
0 0 1 4 .20 .2
...
In this pattern, the smallestThe byte values represent tempo value isvalues in .01. When units, but when the turntable displays the tempo, it appears to just drophides the hundredthslast digit (.09 displays as
This hidden digit explains why turning on multiple bytes doesn't always produce the sum of the tempos displayed by the individual byte values.0 and
B1 B2 B3 B4 tempo display
1 0 0 0 40.96 40.9
0 0 1 0 .16 .1
1 0 1 0 41.12 41.1
Bitwise math
When only some bits are used, bitwise math is indeed useful.10 displays as
For example, here's some Javascript to convert a tempo to the needed byte values:
t = 123.4;
v = 100 * t;
b1 = (v >> 12) & 15;
b2 = (v >> 8) & 15;
b3 = (v >> 4) & 15;
b4 = v & 15;
console.log(b1 + " " + b2 + " " + b3 + " " + b4);
x & 15
is a bitwise AND, in this case, to keep only the lowest four bits.1) instead of actually rounding
x >> 4
is a (right shift, in this case shifting the value 4 bits to the right, which discards the lowest four bits.04 would display This has the same effect as .0dividing by 16 and .05 would display as .1)discarding the remainder.
On the other hand,Here's some ofJavascript to convert the results you described suggest data byte values of 16to the displayed tempo:
b1 = 3;
b2 = 0;
b3 = 3;
b4 = 4;
b1 = b1 & 15;
b2 = b2 & 15;
b3 = b3 & 15;
b4 = b4 & 15;
v = 16*16*16*b1 + 16*16*b2 + 16*b3 + b4;
t = parseInt(v / 10) / 10;
console.log(t);
In your web browser, 32you can go to about:blank, then press F12 and 64 may have some kind of effect? Maybego to Console to enter these values duplicate the effect of the 1small Javascript calculations. (For your safety, 2enter about:blank in the address box, and 4 values of the next byte to the left? Maybe there is some other patternnever run code from strangers if you don't understand it.)