Thread: Midi <-> OSC
View Single Post
Old 11-16-2017, 07:19 AM   #53
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
I can confirm that oscii-bot sysex send works properly here. I assume you have confirmed that you can send a regular 3-byte MIDI message fro oscii-bot in response to the same input?

Actually, your input test is a odd both in its structure and that it's mixing hex and decimal. "msg1 == 0xbf ? (msg2 == 40 && msg3 == 0)" is equivalent to "msg1 == 0xbf && msg2 == 0x28 && msg3 == 00)", which would be a balance LSB message on channel 15. Did you perhaps mean 0x40, sustain pedal? And do you really mean channel 15?
This is the code of the button that I'm using to initiate the sysex command. 0x29 and 41 are the same CC message. It's just some CC at MIDI channel 16 wuth no special purpose. Channel 16 is used exclusively with midi port 3 of the controller.
This button, if it's important:



oscii-bot can use both hex and dec values. I've seen it in many scripts, including sample_script.txt that comes with oscii-bot:
Code:
msg1 == 0x90 ? (
  msg2 == 0x5b ? oscsend(destdevice, "b/rewind", msg3>64);
  msg2 == 0x5c ? oscsend(destdevice, "b/forward", msg3>64);

  msg3>64 ? (
    fmt0 = (msg2&7) + 1;

    msg2 < 8 ?  oscsend(destdevice, "t/track/%.0f/recarm/toggle", 0) :
      msg2 < 16 ?  oscsend(destdevice, "t/track/%.0f/solo/toggle", 0) :
        msg2 < 24 ?  oscsend(destdevice, "t/track/%.0f/mute/toggle", 0) : 
    (
      msg2 == 0x5e ? oscsend(destdevice, "b/play", 1);
      msg2 == 0x5d ? oscsend(destdevice, "b/stop", 1);
      msg2 == 0x5f ? oscsend(destdevice, "b/record", 1);
    )
  );
);
This is my test script:
Code:
@input midi_in MIDI "MIDIIN3 (SL MkII)"
// @output midi_out MIDI "loopMIDI Port"
@output midi_out MIDI "MIDIOUT3 (SL MkII)"

@init

@timer

@oscmsg

@midimsg 

msg1 == 0xBF ? (    
    sysexMsg = "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\x04\x01\x09\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x32\x00\x01\x09\x03\x04\x20\x20\x20\x31\x00\x01\x12\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x33\x00\x01\x12\x03\x04\x20\x20\x20\x4F\x4E\x00\xF7";
      msg2 == 0x29 && msg3 > 0x00 ? (
          midisend_str(midi_out, sysexMsg);
          printf("Button was pressed \n");
          );
      );
oscii-bot log:


midi-ox window:


P.S. Tested. Yes, I can send regular 3-byte messages with the same code. Tested it with LED light of one button.

UPD. What if midisend_str sends sysex to channel 1(0) by default, while I need it to be at channel 16(15)? But, as far as I know, sysex doesn't need midi channel.

Last edited by fundorin; 11-16-2017 at 07:41 AM.
fundorin is offline   Reply With Quote