Sysex msgs that Axefx automatically sends.

bossredman

Inspired
Hi,

Anyone know what SysEx msgs the axefx automatically sends and under what conditions.

I seem to be recieving alot of (what I think are unpromted) Function ID 0x20 msgs (ie MIDI SysEx: MIDI_GET_ROUTING_GRID_LAYOUT).

Also I'm trying to capture the 0x0e msg (ie MIDI_GET_PRESET_EFFECT_BLOCKS_AND_CC_AND_BYPASS_STATE) at the end of my VOID setup() routine by sending MIDI.sendSysEx(8,EffectID_Sysex,true) where:
byte EffectID_Sysex[8] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x0E, 0x08, 0xF7};

.. but I never get it.

I can capture it it later in my code no problems - but just not in the Setup.
Does this request need to be proceeded by anything else or do I need to do soemthing different.

Appreciate any thoughts pls.
 
After hrs of going over my code I noticed a really stupid thing.
The erronious 0x20 msgs where not actually ID hex 20, they were decimal 20 which = 0x14.
So they were in fact Preset Number messages.
I think I can now understand why they are being sent/recieved.

But I still can fathom the 2nd part of my original post.
ie why can't I read the MIDI_GET_PRESET_EFFECT_BLOCKS_AND_CC_AND_BYPASS_STATE msg, when sent from within the void setup() block.

anyone - please?
 
Can anyone tell me if the 0x0e msg response (ie MIDI_GET_PRESET_EFFECT_BLOCKS_AND_CC_AND_BYPASS_STATE) is ALWAYS the same length or whether it varies in size depending on the number of blocks present in the preset pls?
 
Here's the code in question:

(FYI - the 'MIDI.sendSysEx' msgs sent during the "while" loop can be & are read successfully.
But "any" sysex msgs sent (from with the void setup() block) after the while loop has completed are not read.
(I've now determined it's not just the 0x0E msg - it's any msg).


Code:
void setup()
{
  Serial.begin(115200);
  MIDI.begin();
  MIDI.turnThruOff();
  MIDI.setHandleSystemExclusive(HandleSystemExclusive);  //tells arduino to run the "handleSysex" function every time a midi sysex message is received and the MIDI.read() command is executed

  lcd.begin(20, 4);  lcd.clear();  lcd.print("Welcome to AxeFX II");  lcd.print(".... rebooting ....");
  delay(150);
  lcd.clear();

//setup pins with INTERNAL pullups
      pinMode(BUTTON1,INPUT_PULLUP);
      pinMode(BUTTON2,INPUT_PULLUP);
      pinMode(BUTTON3,INPUT_PULLUP);
      ...etc

  while (Setup_Compl == false)                      //Checks if AxeFX is physically on so it can read PS Name - Loops until it is on.
                                                    //Gets set to TRUE when a Preset Name SYSex is successfully read.
  {
     MIDI.sendSysEx(8,Preset_Number_Sysex,true);    //send get Preset Number SysEx
     MIDI.read();
     MIDI.sendSysEx(8,Preset_Name_Sysex,true);      //send get Preset Name SysEx
     MIDI.read();
     lcd.clear();
     lcd.setCursor(0, 1);
     lcd.print("Turn on the AxeFX!!");
  }
    
      MIDI.sendSysEx(9,Looper_Status_Disable,true);      //Disable Looper Status Msgs by default on restart.
      MIDI.read();
      MIDI.sendSysEx(8,EffectID_Sysex,true);
      MIDI.read();
}
 
Thanks for the response - was starting to worry :).

Sorry - the sketch is nearly 2000 lines - so only posted the void setup code.

The Checksums are contained within the respective sysex msg arrays (last but one byte).
ie
Code:
byte Preset_Name_Sysex[8] ={0xF0, 0x00, 0x01, 0x74, 0x03, 0x0F, 0x09, 0xF7};
byte Preset_Number_Sysex[8] ={0xF0, 0x00, 0x01, 0x74, 0x03, 0x14, 0x12, 0xF7};
byte EffectID_Sysex[8] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x0E, 0x08, 0xF7};

..and these are in the block of code that preceeds teh void setup() block.
Not sure what that section is called.
 
Last edited:
Thanks for the response - was starting to worry :).

Sorry - the sketch is nearly 2000 lines - so only posted the void setup code.

The Checksums are contained within the respective sysex msg arrays (last but one byte).
ie
Code:
byte Preset_Name_Sysex[8] ={0xF0, 0x00, 0x01, 0x74, 0x03, 0x0F, 0x09, 0xF7};
byte Preset_Number_Sysex[8] ={0xF0, 0x00, 0x01, 0x74, 0x03, 0x14, 0x12, 0xF7};
byte EffectID_Sysex[8] = {0xF0, 0x00, 0x01, 0x74, 0x03, 0x0E, 0x08, 0xF7};

..and these are in the block of code that preceeds teh void setup() block.
Not sure what that section is called.
Then i don't know. You'd probably better have a cleaner code. Anyway the axefx always answers a sysex message with an error code if incorrect , do you get those answers ?
 
Which model is your AxeFX? I have the Axe-Fx II XL+, and the ID for the Axe is not 0x03, it's 0x07. That caused me issues for a while until I noticed the model # change (I added this to the Wiki). I just added a second define statement and commented out the one for 0x03 as a reference so I could remember why I changed it...
/*
All Axe-Fx II SysEx messages have the same header as follows:

0xF0 sysex start
0x00 Manf. ID byte0
0x01 Manf. ID byte1
0x74 Manf. ID byte2
0x03 Model # (Axe-Fx II = 0x03)
0xdd Function ID
*/
#define MIDI_AXEFX_MAN_ID_BYTE_0 0x00
#define MIDI_AXEFX_MAN_ID_BYTE_1 0x01
#define MIDI_AXEFX_MAN_ID_BYTE_2 0x74
//#define MIDI_AXEFX_MODEL_NUM 0x03 // Axe-FX II = 0x03
#define MIDI_AXEFX_MODEL_NUM 0x07 // Axe-FX II XL+ = 0x07 ??? Based on what I'm seeing from the MIDI data

Regarding which messages it always sends, I see Tempo all the time
#define MIDI_AXEFX_TEMPO_BEAT 0x10

If you turn on the Tuner, it does that constantly
#define MIDI_AXEFX_TUNER_INFO 0x0D


One thing that helped me also is if you install a MIDI monitor program. I'm on OS X and they have one called, MIDI Monitor. You can see all the messages you are sending and getting from the Axe. Then using AxeEdit, when you change a preset or press various buttons, you can see what the Axe is doing under those cases.

Under the Axe I/O menu, you can also enable USB Adapter Mode. What this has helped me with is when I have my MIDI circuit connected to the Axe and I am sending MIDI messages via the MIDI ports, they are also echoed to the USB connection and the MIDI monitor program will see them. That way you can see the full messages you are sending.

Two items to know that you may run into. From what I understand, when you change to a preset, the Scene always defaults to Scene 1. There is no 'get current scene' ID that I know of. You have to use 0x29 and set the scene, and then keep track of what you set it to. And if the preset changes, reset the current scene to scene 1.

The other item is regarding the routing grid. What I have noticed is AmpInfo exists for both amps, even if you are not using one at all. So you further have to get the status of the amps and see if they are used before displaying that information (if you are doing that). In my case, I have a 20x4 LCD and am showing which amps are used for each preset. And the second amp always shows up even if not used. So I am adding code to verify it's enabled or not before showing it.
 
Hi Chad - thanks for helping out.

I have an AxeFX II - so I believe my model # number of 0x03 is correct.

The msg gets recieved when called in the void loop() code - so I've got to assume the format of msg is correct.
I just can't seem to recieve it when called from the void setup().

The other weird thing is teh msg appears to be over 200 bytes long. Some time 300+.

Heres the code that desyphers the msg:

Code:
if (MIDI.getSysExArray()[5] == 0x0e)         //If read a MIDI_GET_PRESET_EFFECT_BLOCKS_AND_CC_AND_BYPASS_STATE - sysex
  {
      Serial.println("          ++++ Preset Blocks Received! - 0x0e +++++");  //\n");
      int i = 0;
      int  byState, afxCC;    //eID,
      for (int j = 0; j < nBlocks; j++)                   // reset local blocks arrays (ie put all elements to 0):
      {
        AFX_blocks[j] = 0;                                // Array containing all possible effect block ID's in AxeFX. Each effect block has a fixed ID number (0 - 70). 1 = present in preset / 0 = not in preset.
        AFX_blockStatus[j] = 0;                           // Corresponding array to list current By-Pass state of each effect block ( 1 = Enambled / 0 = By-Passed).
      }

      Local_IA_number = 0;
      IA_SR = 0;
      Block_Enabled = 0;
      Block_Present = 0;
      eID_zero_count = 0;
     
      for (int x =0; x <7; x++)                            //Reset Arrays
      {
        IA_Present_Array[x] = 0;
        IA_ByPass_Status_Array[x] = 0;
      }

      while (MIDI.getSysExArray()[i] != 0xf7)               // Any effect block present in preset is detailed by a 5 byte 'chunk'. (Status, CC# LSB, CC# MSB, Eff ID LSB, Eff ID MSB).
      {
          Serial.print(i);  Serial.print("  =  ");  Serial.println(MIDI.getSysExArray()[i], HEX);
          //Serial.print(" ");
         
          if ((i > 5) && (((i - 5) % 5) == 0))              //takes last byte of chunk (ie  Effect ID MSB).
          {         
              eID = (0xf0 & ((MIDI.getSysExArray()[i] & 0x0f) << 4)) + ((MIDI.getSysExArray()[i - 1] & 0x78) >> 3);             // get effect ID (description in header):
              if (eID >= 100 && eID < 171)
              {
                eID = eID - 100;
                if (eID == 0)
                {
                    eID_zero_count = eID_zero_count + 1;
                }

                if (eID_zero_count < 2)
                {
                    AFX_blocks[eID] = 1;                              // set local variables:
                    byState = MIDI.getSysExArray()[i - 4] & 0x01;     // get bypass state:
                    AFX_blockStatus[eID] = byState;                   // set local variables:
                    afxCC = (0xC0 & ((MIDI.getSysExArray()[i - 2] & 0x03) << 6)) + ((MIDI.getSysExArray()[i - 3] & 0x7E) >> 1);   // get Axe's CC value:
                   
//                    Serial.print("Block ID: ");   Serial.print(eID);              Serial.print("\t");
//                    Serial.print("Block Name: "); Serial.print(blockNames[eID]);  Serial.print("\t");
//                    Serial.print("MIDI CC: ");    Serial.print(afxCC);
//                    if (byState)
//                    {
//                      Serial.print(" is ENABLED\n");
//                    }
//                    else
//                    {
//                      Serial.print(" is bypassed\n");
//                    }
                    updateInstantAccess_SR_Byte();
                }   
              }

          }
          i++;

      }

      Serial.print(i);  Serial.print("  =  ");  Serial.println(MIDI.getSysExArray()[i], HEX);
     
      updateShiftRegister();

      for(int i = 0; i < 7; i++)
      {

      }


  }
 
..and a sample of the Serial Monitor output (post formatted in Excel):
++++ Preset Blocks Received! - 0x0e ++++

0 = F0 / 50 = 0 / 100 = 0 / 150 = 0 / 200 = 0 / 250 = 0 / 300 = 0
1 = 0 / 51 = 0 / 101 = 0 / 151 = 0 / 201 = 0 / 251 = 0 / 301 = 0
2 = 1 / 52 = 0 / 102 = 0 / 152 = 0 / 202 = 0 / 252 = 0 / 302 = 0
3 = 74 / 53 = 0 / 103 = 0 / 153 = 0 / 203 = 0 / 253 = 0 / 303 = 0
4 = 3 / 54 = 0 / 104 = 0 / 154 = 0 / 204 = 0 / 254 = 0 / 304 = 0
5 = E / 55 = 0 / 105 = 0 / 155 = 0 / 205 = 0 / 255 = 1 / 305 = 0
6 = 3 / 56 = 0 / 106 = 0 / 156 = 0 / 206 = 0 / 256 = 0 / 306 = 0
7 = 4A / 57 = 0 / 107 = 0 / 157 = 0 / 207 = 0 / 257 = 0 / 307 = 0
8 = 10 / 58 = 0 / 108 = 0 / 158 = 0 / 208 = 0 / 258 = 0 / 308 = 0
9 = 53 / 59 = 0 / 109 = 0 / 159 = 0 / 209 = 0 / 259 = 0 / 309 = 0
10 = 6 / 60 = 0 / 110 = 0 / 160 = 0 / 210 = 0 / 260 = 0 / 310 = 0
11 = 3 / 61 = 0 / 111 = 0 / 161 = 0 / 211 = 0 / 261 = 0 / 311 = 0
12 = 4E / 62 = 0 / 112 = 0 / 162 = 0 / 212 = 0 / 262 = 0 / 312 = 0
13 = 18 / 63 = 0 / 113 = 0 / 163 = 0 / 213 = 0 / 263 = 0 / 313 = 0
14 = 63 / 64 = 0 / 114 = 0 / 164 = 0 / 214 = 0 / 264 = 0 / 314 = 0
15 = 6 / 65 = 0 / 115 = 0 / 165 = 0 / 215 = 0 / 265 = 0 / 315 = 0
16 = 3 / 66 = 0 / 116 = 0 / 166 = 0 / 216 = 0 / 266 = 0 / 316 = 0
17 = 52 / 67 = 0 / 117 = 0 / 167 = 0 / 217 = 0 / 267 = 0 / 317 = 0
18 = 20 / 68 = 0 / 118 = 0 / 168 = 0 / 218 = 0 / 268 = 0 / 318 = 0
19 = 23 / 69 = 0 / 119 = 0 / 169 = 0 / 219 = 0 / 269 = 0 / 319 = 0
20 = 7 / 70 = 0 / 120 = 0 / 170 = 0 / 220 = 0 / 270 = 0 / 320 = 0
21 = 2 / 71 = 0 / 121 = 0 / 171 = 0 / 221 = 0 / 271 = 0 / 321 = 0
22 = 5E / 72 = 0 / 122 = 0 / 172 = 0 / 222 = 0 / 272 = 0 / 322 = 0
23 = 28 / 73 = 0 / 123 = 0 / 173 = 0 / 223 = 0 / 273 = 0 / 323 = 0
24 = 3 / 74 = 0 / 124 = 0 / 174 = 0 / 224 = 0 / 274 = 0 / 324 = 0
25 = 7 / 75 = 0 / 125 = 0 / 175 = 0 / 225 = 0 / 275 = 0 / 325 = 0
26 = 2 / 76 = 0 / 126 = 0 / 176 = 0 / 226 = 0 / 276 = 0 / 326 = 0
27 = 62 / 77 = 0 / 127 = 0 / 177 = 0 / 227 = 0 / 277 = 0 / 327 = 0
28 = 30 / 78 = 0 / 128 = 0 / 178 = 0 / 228 = 0 / 278 = 0 / 328 = 0
29 = 2B / 79 = 0 / 129 = 0 / 179 = 0 / 229 = 0 / 279 = 0 / 329 = 0
30 = 78 / 80 = 0 / 130 = 0 / 180 = 0 / 230 = 0 / 280 = 0 / 330 = 0
31 = 2 / 81 = 0 / 131 = 0 / 181 = 0 / 231 = 0 / 281 = 0 / 331 = 0
32 = 64 / 82 = 0 / 132 = 0 / 182 = 0 / 232 = 0 / 282 = 0 / 332 = 83
33 = 34 / 83 = 0 / 133 = 0 / 183 = 0 / 233 = 0 / 283 = 0 / 333 = C
34 = 33 / 84 = 0 / 134 = 0 / 184 = 0 / 234 = 0 / 284 = 1 / 334 = 0
35 = 78 / 85 = 0 / 135 = 0 / 185 = 0 / 235 = 0 / 285 = 11 / 335 = 0
36 = 1 / 86 = 0 / 136 = 0 / 186 = 0 / 236 = 0 / 286 = 0 / 336 = 0
37 = 26 / 87 = 0 / 137 = 0 / 187 = 0 / 237 = 0 / 287 = 0 / 337 = 0
38 = 51 / 88 = 0 / 138 = 0 / 188 = 0 / 238 = 0 / 288 = 0 / 338 = 0
39 = 73 / 89 = 0 / 139 = 0 / 189 = 0 / 239 = 0 / 289 = 0 / 339 = 0
40 = 6 / 90 = 0 / 140 = 0 / 190 = 0 / 240 = 0 / 290 = 0 / 340 = 0
41 = 3 / 91 = 0 / 141 = 0 / 191 = 0 / 241 = 0 / 291 = 0 / 341 = C
42 = 42 / 92 = 0 / 142 = 0 / 192 = 0 / 242 = 0 / 292 = 0 / 342 = 0
43 = 7C / 93 = 0 / 143 = 0 / 193 = 0 / 243 = 0 / 293 = 0 / 343 = 0
44 = 4F / 94 = 0 / 144 = 0 / 194 = 0 / 244 = 0 / 294 = 0 / 344 = 74
45 = 7A / 95 = 0 / 145 = 0 / 195 = 0 / 245 = 0 / 295 = 0 / 345 = 3
46 = 0 / 96 = 0 / 146 = 0 / 196 = 0 / 246 = 0 / 296 = 0 / 346 = F
47 = 0 / 97 = 0 / 147 = 0 / 197 = 0 / 247 = 0 / 297 = 0 / 347 = 9
48 = 0 / 98 = 0 / 148 = 0 / 198 = 0 / 248 = 0 / 298 = 0 / 348 = F7
49 = 0 / 99 = 0 / 149 = 0 / 199 = 0 / 249 = 0 / 299 = 0 /
 
Hi - OK managed to solved one problem atleast - ie the why the length of the 0x0e msg was so long.
Turns out I had 2 versions of the midi library on my PC.
An old version (v3.2) & a new version (v4.3.1) - but my sketch was picking up the old version.
This old version had a bug which was fixed in v4.2 that fixed as issued where the msg terminating byte (ie 0xF7) was getting converted to 0.
So my code was not seeing the F7 to know when the msg had finished.
Deleting the old version of the library & re-compiling do the trick.
Thanks to Franky47 teh library owner.

So - that just leaves me with the issue of why I can't seem to capture the 0x0e msg (ie MIDI_GET_PRESET_EFFECT_BLOCKS_AND_CC_AND_BYPASS_STATE) when called from my VOID setup() routine.
It's like it just doesnt even get sent - but the code is definately sending it.
And again as previously stated, works ok when called from teh void loop() block.

Appreciate any thoughts pls.
 
Back
Top Bottom