Different 0x0E sysex msgs for same preset

bossredman

Inspired
HI,

I've been trying implement Effect Block X/Y switching in my DIY MFC.
I'm "getting" the current XY state of an effect using:

Code:
byte Get_EffectXY_Sysex[12] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x11, byte1, byte2, 0x00, 0x00, CheckSum, 0xF7};
MIDI.sendSysEx(12, Get_EffectXY_Sysex, true);

And then "setting" the opposite state via:

Code:
byte Set_EffectXY_Sysex[12] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x11, byte1, byte2, Set_XY, 0x01, CheckSum, 0xF7};
MIDI.sendSysEx(12, Set_EffectXY_Sysex, true);

I then re-capture PRESET_BLOCKS_DATA using 0x0E.

Each effect's eff ID ( in the preset_) is written to an array after being captured & extracted using the 0x0E sysex.
The 0x0E work's fine when changing preset & is accurate 100% of teh time.
But after toggling the X/Y state, it frequently reports back a SHORTER length 0x0E msg & therefore a lesser amount of Effects.
It essentially truncates the Array & the last few effects are missing.
This is casuing the XY toggle to not work for the missing effects from the array.

Any ideas why the 0x0E msg can report back differnt lenghth msgs for the same preset?
I've checked teh last byte & it is always an F7.(terminating bit)

My Test Preset has 14 blocks - so msg length should be 77 (5, for Hdr,1 for Function 14*5 for effs. 1 for F7 (terminating bit)

WHen it does not work - I get varying lengths eg 67, 68, 69
 
Hi thanks for eesponding.

Its currently set to 1024
Code:
struct MySettings : public midi::DefaultSettings
    {
        // override default settings here
        static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long.
    };
    MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, MySettings);

What would you suggest increasing to pls?

Just curious though, for teh same preset how would teh buffer size impact this as the erroneous msg's are shorter in length
 
I've continued searching Google for similar issues with no luck.

I did see several sysex related issues where it was stated ..
"Make sure you write your code to handle this message with no data payload. "
d
can any one elaborate on what affect this would have pls and also how I would go about doing it.

is it saying thst the header, function id , terminating bytes would be in the msg.
but just no data bytes present?
 
Wow,
I seem to have fixed it.
Is it possible the AXEFX doesn't like seeing the same Function ID's sysex sent consecutively?

This was what I had when the issue was happeneing:
Code:
void Instance_Access_XY_Toggle_LONG()
{
    //Build sysex to - Read current XY state of Effect Block by sending 'Get' sysex
        byte byte1 = (Disp_FX_eID[IA_Switch] + 100) & 0x7F;
        byte byte2 = ((Disp_FX_eID[IA_Switch]+ 100) >> 7) & 0x7F;
        byte sysex_1st_chunk = (0xF0 ^ 0x00 ^ 0x01 ^ 0x74 ^ 0x03 ^ 0x11 ^ byte1 ^ byte2);
        byte CheckSum = ((sysex_1st_chunk ^ Set_XY ^ 0x00) & 0x7F);
        byte Get_EffectXY_Sysex[12] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x11, byte1, byte2, 0x00, 0x00, CheckSum, 0xF7};
        
    //Send 'get' sysex msg  to read the current XY state.
        MIDI.sendSysEx(12, Get_EffectXY_Sysex, true);
        
    // If current state = X set to Y  ---- 0 = effect is X, 1 = effect is Y [XY8 = 0x11's SysExArray[8] = 0xdd 0 = effect is X, 1 = effect is Y]  - NOTE: for the 0x0E msg the Bypass & XY states are in the same byte - where 0 = Y & OFF, 1 y & ON, 2 = X & OFF, 3 = X & ON
        if (XY8 == 0)
        {
           Set_XY = 0x01;
        }
    //If current state = Y set to X
        else if (XY8 == 1)
        {
          Set_XY = 0x00;
        }

    //Build sysex to - Send 'set' XY state toggle sysex
        sysex_1st_chunk = (0xF0 ^ 0x00 ^ 0x01 ^ 0x74 ^ 0x03 ^ 0x11 ^ byte1 ^ byte2);
        CheckSum = ((sysex_1st_chunk ^ Set_XY ^ 0x01) & 0x7F);
        byte Set_EffectXY_Sysex[12] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x11, byte1, byte2, Set_XY, 0x01, CheckSum, 0xF7};
    //Send 'set' sysex - to toggle the XY state
        MIDI.sendSysEx(12, Set_EffectXY_Sysex, true);   //********

    sysEx_Requests_IA_XY();
}
..where - sysEx_Requests_IA_XY() just calls the 0x0E sysex msg.

Not sure what made me think about it, but I added a 'Get Firmware' sysex before the 'Set' sysex (//****) & Robert is your Ma's brother!
 
hmmm.
Well it appears I spoke too soon.
Back to square 1 & the condition in teh original Post.

Any suggestions anyone PLEASE
 
Back
Top Bottom