Message
Re: Problem with crafting values to be sent
2012-08-20 by Royce
> While working on implementation file for SY77 I encountered a problem
> I cannot solve: sending a specific range with sign bit. Long story
> short:
> - values 0 ... 7 correspond to range 0 ... 7
> - value 8 is ignored
> - values 9 ... 15 correspond to range -7 ... -1
This is the standard way to set a negative number.
Look at the bit0 to bit3
0 0000 0 use bit4 1 0000 16
1 0001 1 use bit4 1 0001 ; 17
2 0010 2 use bit4 1 0010 18
3 0011 3 use bit4 1 0011 19
4 0100 4 use bit4 1 0100 20
5 0101 5 use bit4 1 0101 21
6 0110 6 use bit4 1 0110 22
7 0111 7 use bit4 1 0111 23
- 1000 8 use bit4 0 1000 clear bit4
-7 1001 9 use bit4 0 1001 ; ; 9
-6 ; 1010 10 use bit4 0 1010 10
-5 1011 11 use bit4 ; 0 1011 11
-4 1100 12 use bit4 0 1100 12
-3 ; 1101 13 use bit4 0 1101 13
-2 1110 14 use bit4 0 1110 14
-1 1111 15 use bit4 0 1111 15
So you can use val03 to mask off bit4 (bit0 to bit3)
...
.maxmin 9 23
.default 16 ; 0 as far as you are concerned
.tx $F0 sysex header val03 $F7
...
All the best
Royce
Attachments
- No local attachments were found for this message.