Thread: Midi <-> OSC
View Single Post
Old 11-19-2017, 04:29 AM   #97
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,437
Default

Quote:
Originally Posted by fundorin View Post
What code should I use instead to display proper sysex message in console?
If you want to display sysex in hex, you could use:

Code:
function format_hex(str_in) local(str_out, pos, len) ( 
  strcpy(str_out=#,""); 
  len=strlen(str_in);
  pos=0;
  while (pos<len) (
    strcat(str_out,sprintf(#,"%02x ",str_getchar(str_in,pos)));
    pos+=1;
  );
  str_setlen(str_out,strlen(str_out)-1); // returns str_out
);

printf("%s\n",format_hex(sysex_message));
(untested but ought to work...)
Justin is offline   Reply With Quote