Synth Forum

Notifications
Clear all

ARP type conversion to Hex number for SysEx

2 Posts
2 Users
0 Reactions
1,433 Views
Posts: 0
New Member
Topic starter
 

I am a MOXF8 user and making MIDI foot controller using arduino.
I would like to send ARP type thru SysEx defined in Data list. But it is very confusing to me to know what hex number is to be sent.
There are 7891 ARP types thru p48 to p96 in the list.
p132 provides some clue too me. It says the default ARP type for SF1 button is 05 4A in hex for MA_pf Arp1 type, which is Arp no 714 as decimal defined in p52.
But hexadecimal 05 4A is actually 1354 in decimal not 714.
The p132 also introduces its data range in Hex 00 - 3E 00 - 2D, 40 - 41, 00 - 7F for off, Preset 0001 ... 7981, User 001 ... 256.
I thought the max number in hex is 3E 2D for preset 7981 but 3E 2D is decimal 15917. It doesn't make sense at all to me.
How can I convert the decimal ARP type number into hex to send SysEx? I have absolutely no idea. Please advise.

 
Posted : 10/09/2019 4:22 am
Jason
Posts: 8259
Illustrious Member
 

Your issue is understanding MIDI is 7-bit for data. The 8th bit is reserved for just a few special cases - but, for the most part, you can pretend that MIDI is 7-bit. That's why all parameters in the data list are 0-7F and not 0-FF.

Lets break down the two bytes 05 4A -- and not ignore that we're dealing with 7-bit values.

0x4A = 1001010 (7-bits) - these are the least significant bits aka LSB
0x05 = 0000101 (7-bits) - these are the most significant bits aka MSB

Now mash these together - you were adding an extra "0" before.

00001011001010b - MSB first, LSB second

Binary "00001011001010" = 714 decimal.

You can represent this in 8-bit logic ...
(00)00 0010 1100 1010

The (00) are the extra 2 bytes patting on the MSB, extra bit for each byte (going from 7-bit each to 8-bit each).

That's

0x0 0x2 0xC 0xA (converting each nibble in the 8-bit logic binary)

... and bytes: 0x02 0xCA

... or just a word: 0x02CA

... which is decimal 714.

This is fundamental to making sense of MIDI. Some standard CC messages have two parameters with MSB and LSB - and there you have to apply the same 7-bit "conversion". Really, it's a matter of properly packing the bits so you do not add any 0-bit padding between the MSB and LSB. In SysEx - you may have any number of 7-bit values that need to be packed together (could have 3, or 20 ... or more. It's up to each implementation to make their own definition). So although I've shown just 2 bytes - the same would apply to any number of bytes.

So rework with this - and see if it all comes together.

Current Yamaha Synthesizers: Montage Classic 7, Motif XF6, S90XS, MO6, EX5R

 
Posted : 10/09/2019 4:56 am
Share:

© 2024 Yamaha Corporation of America and Yamaha Corporation. All rights reserved.    Terms of Use | Privacy Policy | Contact Us