View Single Post
Old 01-13-2018, 12:14 PM   #68
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

Quote:
Originally Posted by fundorin View Post
I can easily convert separate numbers, like
header = 240;
instead of
header = "\xF0";
and replace %s with %c in sprintf.

But, how would one replace this string:
"\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02"
with dec numbers line?
Then assuming header is supposed to contain a number to store a byte, let the compiler do the work and the programmer still see the hex value.

Write
header = $xF0;

What you have written is already a clear way of storing the bytes of the SYSEX header in a string. They are binary values without meaningful character equivalents. Decimal values simply confuse since the Novation programmer manual uses hex.

Put a // comment alongside it in the code to make it clear that it is SYSEX header.

Last edited by goldenarpharazon; 01-13-2018 at 12:41 PM. Reason: Oops $ : then worked out it is SYSEX header
goldenarpharazon is offline   Reply With Quote