Arduino Axe-Fx control library

I’m pretty sure someone else had this working…. Perhaps post your code? Might be something simple
Yes, that's a good one. here is the code:

C++:
#pragma once


/*=======================================================================================================================================
      INCLUDE LIBRIARY'S
  =======================================================================================================================================*/
#include "SdFat.h"

SdFs sd;
FsFile presetNameFile;


const uint16_t bufSize = 60;      //This needs to be as long as the longest preset name + 1 byte

char presetName[10][bufSize];     //Array for storing the loaded preset names


void loadPresetNames()
{
  for (uint8_t i=0; i<10; i++) {
    int n = presetNameFile.fgets(presetName[i], bufSize);
    if (n > 7) {
      strcpy(presetName[i], &presetName[i][7]); // Skip first 7 characters
    }
  }
}


void preset_Names()
{

  //Open file
  if (!presetNameFile.open("preset names.txt", FILE_READ)) {
    Serial.println("Grrr, FCKN SD card is out of its sloth");
    return;
  };

  //Read through preset names, skipping lines until we reach the right 'set'
  uint16_t presetCount = 0;
  while (presetCount < PresetNumb) {
    presetNameFile.fgets(presetName[0], bufSize);  //Dummy storage for skipped preset name
    presetCount += 1;
  }

  //Load the next 10 lines into presetName array
  loadPresetNames();
 
  //Close file
  presetNameFile.close();

  //Print loaded preset names
  for (uint8_t i=0; i<10; i++)
  {
    //Serial.println(presetName[i]);
    switch (i)
          {
            case 0: strcpy(PresetName0, presetName[i]); break;
            case 1: strcpy(PresetName1, presetName[i]); break;
            case 2: strcpy(PresetName2, presetName[i]); break;
            case 3: strcpy(PresetName3, presetName[i]); break;
            case 4: strcpy(PresetName4, presetName[i]); break;
            case 5: strcpy(PresetName5, presetName[i]); break;
            case 6: strcpy(PresetName6, presetName[i]); break;
            case 7: strcpy(PresetName7, presetName[i]); break;
            case 8: strcpy(PresetName8, presetName[i]); break;
            case 9: strcpy(PresetName9, presetName[i]); break;
          }
  }
}

void presetRange()
{
  PresetNumb = floor(PresetNumb / 10) * 10;
  preset_Names();
}

/*=======================================================================================================================================*/
/*Axelman8*/
 
So it seems. Just dropped this code before heading to work. My bad
Here is the code

C++:
void PresetNameCallback(const PresetNumber presetNumber, const char *presetName, const byte length) 
{
  //To keep the standard of the Fractal export file "preset names.txt" output, I need to edit the presetnumber and add 3 spaces
  //The equalisation of presetNumber == presetNumberNames  is because this is the only way the program prints all 1023 presetnames
  if (presetNumber == presetNumberNames) 
  {
    presetNameFile = sd.open("preset names.txt", O_WRITE | O_APPEND); 
    char formattedNumber[5];
    snprintf(formattedNumber, sizeof(formattedNumber), "%04d", presetNumber);
    debug("\n"); debug(formattedNumber); debug("   "); debug(presetName);
    CS8L;
    presetNumberStyle();
    tft.println(presetNumber);
    CS8H;
    presetNumberNames++;
        
    if (presetNumberNames <= 1024) 
    {
      Axe.requestPresetName(presetNumberNames);
      if (presetNameFile) 
      {
        
        String formattedNumber = String(presetNumber);
        while (formattedNumber.length() < 4) {
          formattedNumber = "0" + formattedNumber;
        }
        
        String outputLine = formattedNumber + "   " + presetName + "\n";  
        presetNameFile.print(outputLine);  // 
        delay(10);
      }
    }
    presetNameFile.close();
  }
}



void printAllPresets()
{
  PresetNumber presetNumberNames = 0;
    if (presetNameFile.open("preset names.txt", O_WRITE))
    {
    presetNameFile.truncate(0);
    presetNameFile.close();
    delay(10);
    Serial.println(" SD kaart bestand -> Preset Names.txt leeggemaakt.");
    }
    clearSceneScreens();
    CS8L;
    tft.setTextColor(screen13Style_txt3_color,screen13Style_fillscreen);
    tft.setTextSize(3); tft.setCursor(12, 5);
    tft.println("Updating");
    tft.setTextSize(2); tft.setCursor(40, 35);
    tft.println("SD-CARD");
    CS8H;
    Axe.requestPresetName(presetNumberNames);
    }
 }
 
Last edited:
Try this:

C++:
  // This we be called if we get a preset message for a preset other than the current one.
  // Use this if you want to read all preset names. If not set, stale preset messages are dropped.
  void registerStalePresetNameCallback(PresetNameCallback);

It's a clunky solution, but (I'm told) it works. The person I worked with to do this has it working but I can't find where they posted their solution!
 
Basically, the library will drop a preset MIDI packet if it does not match the current preset. This is because if you spin the wheel or click through fast on the unit, it sends dozens of messages for presets that are no longer current.

Try something like this:

C++:
Axe.registerPresetNameCallback(PresetNameCallback);
Axe.registerStalePresetNameCallback(PresetNameCallback);
 
Did it, it works, but it really screwed up my peddleboard. After the updating of the presetnames to the SD card, some buttons activate the function again. I let it run and stopped it at preset 2000 .

So now I have reset everything with a backup, but I think that the SD is corrupted, it doesnt show the presetnames in my screens anymore .

I have seen it work, but it doesnt work for me. Will try to restore to my working solution and be happy with it ;)

Thank you for your time and effort 🤘. Still an amazing Library you have shared with us.

Cheers 🍻
 
Note to self:
Be happy if it works. If it ain't broken... don't break it

The last update for fetching all presetnames really screwed up my program. Took me a while to restore/recover, but yes...I t's fixed, it's working!

Next 🫣😁


Have a great weekend
Cheers @tysonlt
 
Note to self:
Be happy if it works. If it ain't broken... don't break it

The last update for fetching all presetnames really screwed up my program. Took me a while to restore/recover, but yes...I t's fixed, it's working!

Next 🫣😁


Have a great weekend
Cheers @tysonlt
Nice!

When I did my board I made a thing where if you’re holding a certain button during boot it goes into admin mode where you can read preset names, etc. That way nothing interferes with normal operation.

I’ve moved now so I’ll try to find all my stuff and maybe help debug it. It might be something simple!
 
Haven’t had a chance to peruse this thread, the fractal sysex charts or your code yet - but can I just ask - is it possible to query the parameter values for any effect in the chain along with the name etc?

The fact an iPad app seems to exist that - I’m guessing- supports editing everything ( or am I wrong ? ) suggests that the answer is yes?

Bi-directional communication is - of course what MIDI 2.0 ( MIDI CI ) will support and enable but it would be uber-cool if your arduino code and fractal devices support this already ( if - of course- albeit in a proprietary way :) )
 
Last edited:
Haven’t had a chance to peruse this thread, the fractal sysex charts or your code yet - but can I just ask - is it possible to query the parameter values for any effect in the chain along with the name etc?

The fact an iPad app seems to exist that - I’m guessing- supports editing everything ( or am I wrong ? ) suggests that the answer is yes?

Bi-directional communication is - of course what MIDI 2.0 ( MIDI CI ) will support and enable but it would be uber-cool if your arduino code and fractal devices support this already) albeit in proprietary ways )
the axe fx library on GitHub is doing that querying it via syshex messages. there's a fractal specification document somewhere. i think this is what you're looking for https://github.com/tysonlt/AxeFxControl/blob/main/examples/PresetDetails/PresetDetails.ino
 
Haven’t had a chance to peruse this thread, the fractal sysex charts or your code yet - but can I just ask - is it possible to query the parameter values for any effect in the chain along with the name etc?

The fact an iPad app seems to exist that - I’m guessing- supports editing everything ( or am I wrong ? ) suggests that the answer is yes?

Bi-directional communication is - of course what MIDI 2.0 ( MIDI CI ) will support and enable but it would be uber-cool if your arduino code and fractal devices support this already ( if - of course- albeit in a proprietary way :) )
Only the block bypasstate or active channel can be Query'd. Have not seen options to query block parameters with the FXIII and this lib.

What you are referring to, seems to me like using your hands to edit parameters.. you can do this in axe-edit with the performance page, or FXIII frontpanel.

A cheap touchscreen windows/android tablet works great... Even my Fold6 with Fracpad works good, but prefer the 13' Surface tablet that is somewhat more convenient.
Have no experience with an iPad, but that should work great too I guess.
 
Haven’t had a chance to peruse this thread, the fractal sysex charts or your code yet - but can I just ask - is it possible to query the parameter values for any effect in the chain along with the name etc?

The fact an iPad app seems to exist that - I’m guessing- supports editing everything ( or am I wrong ? ) suggests that the answer is yes?

Bi-directional communication is - of course what MIDI 2.0 ( MIDI CI ) will support and enable but it would be uber-cool if your arduino code and fractal devices support this already ( if - of course- albeit in a proprietary way :) )
Hi, yes you can send and receive sysex, but only what is publicly published in the fractal MIDI guide.

FracPad can query the internal parameters because the author has access to the proprietary/private sysex protocol that AxeEdit/FC uses, so unfortunately no, you can’t easily query or set individual effect parameters.

What you CAN do is assign controllers to some parameters and set the controller values via MIDI, so if you set that up in advance then yes, you can get some control over effects.
 
.....What you CAN do is assign controllers to some parameters and set the controller values via MIDI, so if you set that up in advance then yes, you can get some control over effects.
Ah that’s a REAL shame - I was presuming that the rationale for all this Arduino code stuff was because Fractal had kindly/graciously released their SYSEX spec publicly...

Guess I’ll have to wait now until Fractal update the firmware in their current ( or only new ) models to support MIDI 2.0 (more specifically MIDI-CI) - :(
 
Ah that’s a REAL shame - I was presuming that the rationale for all this Arduino code stuff was because Fractal had kindly/graciously released their SYSEX spec publicly...

Guess I’ll have to wait now until Fractal update the firmware in their current ( or only new ) models to support MIDI 2.0 (more specifically MIDI-CI) - :(
That's probably going to be a long wait... ;)

You could always sniff the sysex and try and figure it out. Others have done this in the past (I'm pretty sure most of FracPad was done this way).
 
What you are referring to, seems to me like using your hands to edit parameters.. you can do this in axe-edit with the performance page, or FXIII frontpanel.
Was mulling a maker project with displays like yours but with encoder knobs and radial LED rings - say 32 of them - like the upcoming Behringer BCR-32 - but with a display area/scribble strip for each knob. I’ve used iPad apps - for other modellers - it’s okay but not the best ergonomic and “flow” enabling tech if im honest. There’s nothing like a physical unit to tweak things.
 
Yes indeed! I wanted to make a control surface with knobs, but it’s not possible with the current MIDI spec. There are many wishes about this.

Having MIDI 2.0 won’t change the fact that we don’t have the secret MIDI codes. As unix said, the only option is sniffing and reverse-engineering the protocol, but that’s a challenging job and I don’t know if this is allowed or perhaps polite. For FracPad, Al has said he paid to get the secret codes.
 
Yes indeed! I wanted to make a control surface with knobs, but it’s not possible with the current MIDI spec. There are many wishes about this.

Having MIDI 2.0 won’t change the fact that we don’t have the secret MIDI codes. As unix said, the only option is sniffing and reverse-engineering the protocol, but that’s a challenging job and I don’t know if this is allowed or perhaps polite. For FracPad, Al has said he paid to get the secret codes.
No, i sniffed most of it, just paid to get few missing things
 
Back
Top Bottom