View Single Post
Old 01-28-2018, 07:44 PM   #304
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554

I've created a new method inside csurf_main.cpp's class threadedMIDIOutput and called it SendStr.

    virtual void SendStr(unsigned char *sysexMsg)
        len = sysexMsg::size;

        MIDI_event_t evt->frame_offset = 0;
        MIDI_event_t evt->size = len;

        for (int i = 0; i <= len; i++)
            MIDI_event_t evt->midi_message[i] = sysexMsg[i];
        SendMsg(&evt, 0);
Code as a picture:

Then, I'm trying to call this method with the following code:

unsigned char automapOnline[] = { 0xF0, 0x00, 0x20, 0x29, 0x03, 0x03, 0x12, 0x00, 0x02, 0x00, 0x01, 0x01, 0xF7 };

As a picture:

Changed size of midi_message array from 4 to 512.
typedef struct
  int frame_offset;
  int size; // bytes used by midi_message, can be >3, but should never be <3, even if a short 1 or 2 byte msg
  unsigned char midi_message[512]; // size is number of bytes valid -- can be more than 4!
} MIDI_event_t;
As a picture:

reaper_plugin.h addition at line 1031:
virtual void SendStr(unsigned char *sysexMsg) = 0; // frame_offset can be <0 for "instant" if supported
As picture:

I'm running it in my csurf plugin at Reaper start.
And immediately getting an error on debug.
The task is to send sysex message from the csurf plugin to the midi controller.
What am I doing wrong here?
fundorin is offline   Reply With Quote