Arduino Axe-Fx control library

Interesting! Thanks for the explanation. Do you happen to know if the III sends more / larger SysEx data per second than the II (and Ultra)? Because with the Ultra I've never seen an issue like that.

All the more reason to use checksums! Well done to put them in your library!! :)

I don't know regarding the II. I think it's good that the III just sends a ton of tuner data, it is up to the receiver to deal with it - more powerful chips might do better. You can also increase the arduino input buffer size but I don't want to make the library rely on hacking the arduino core files.

Ah, yes, well... I WASN'T checking the checksums... AlbertA suggested I do so! :)
 
The corrupted data is the note name and the string number.

In the meantime, I've found a way to prevent the LCD display to hang when corrupted data is received:

Code:
  int len = strlen(note);
  if ((len <= 2) & (string < 7)) 
    String noteName = note;
    String noteNumber = string;
 
The corrupted data is the note name and the string number.

In the meantime, I've found a way to prevent the LCD display to hang when corrupted data is received:

Code:
  int len = strlen(note);
  if ((len <= 2) & (string < 7))
    String noteName = note;
    String noteNumber = string;
Yeah it’s curious. The library will filter them out now.
 
Yep the lib is still there, I made the actual foot controller private until I could work on it a bit more... call it pride? Anyway it's open again now.

Stoked somebody's still interested in it! I'll open it up again. I have built a controller and used it in anger for about 7 gigs, so far so good. I haven't really changed the code in ages.

There is some experimental stuff with setting up a custom layout, but honestly I just use CC messages now and map stuff in the Axe, rather than turning custom effects on and off. I usually have scenes on the top row and IA on the bottom row.
 
Getting some arduino stuff in the mail today, going to give this a shot over the holiday break. Always been fascinated with midi controllers, switchers etc.
Happy to help out with implementation details. I designed a pedal and used it on about 10 gigs and then got disappointed because there was no more coding to do!
 
Not sure if anyone is still using this, but there is a new version: https://github.com/tysonlt/AxeFxControl/releases/tag/v1.2

Thanks to @prongs_386 and his awesome build https://forum.fractalaudio.com/threads/multi-screen-diy-controller.166504 for prompting the method to drop incomplete sysex messages. Occasionally the Axe will send a new sysex message before the previous one could be completely read, and the previous code waited until the sysex end byte was received before trying to validate. Now if a new message starts mid-stream, it silently drops the previous fragment and resets the buffer. Seems obvious in hindsight.
 
Hey there @tysonlt
For starters, best wishes for 2021

Thank you for your library, as it is working for me when i am testing the code with the axeFxIII.

I am not a programmer and dont understand much of C++, but have learned some how to create a sketch and use it for testing.
The Serial monitor gives all information about PresetNumber, PresetName, SceneNumber, SceneName that i would like to reuse by showing it on seperate display's (15)
Spent some hours trying to figure it out to pass information by value, pointer* or Reference, but that didnt work for me.

My Question:
After Axe.update()
Is there a trick that i can use to store the PresetNumber, PresetName, SceneNumber, SceneName etc so i can reuse it anywhere and anytime i need?
After the "void onPresetChanging" these stored values should be overwritten and be re-used again.

dont know if this is the way in C++
I got some experience in coding with Visual Basic for Applications (VBA) and stored the variable so i can reuse it anytime. I cannot find a solution like that in C++.

hope you can help me out :)

Thank you in advance

Cheers
 
Sure, just create some global variables in the sketch (above the setup() function). For the preset and scene numbers just declare a couple of integer variables, and for the preset and scene names you will need to declare a buffer, like so:

Code:
PresetNumber currentPresetNumber;
SceneNumber currentSceneNumber;
char currentPresetName[MAX_PRESET_NAME];
char currentSceneName[MAX_SCENE_NAME];

Then in the preset change callback, just copy the information to your global variables:

Code:
void onPresetChange(AxePreset preset) {
  currentPresetNumber = preset.getPresetNumber();
  currentSceneNumber = preset.getSceneNumber();
  preset.copyPresetName(currentPresetName, MAX_PRESET_NAME);
  preset.copySceneName(currentSceneName, MAX_SCENE_NAME);
}

Otherwise, you can always just get the current preset out of the AxeSystem variable. Presuming you have declared a variable called Axe in your sketch, you can call Axe.getCurrentPreset() to get the preset and scene info. I think it's better to use the callbacks though! :)

I'm away from the code at the moment so I haven't actually run this. Check the examples in the library, eg: https://github.com/tysonlt/AxeFxControl/blob/master/examples/PresetDetails/PresetDetails.ino
 
Hey there @tysonlt

Thank you a lot for your very fast response. I really tried my best but guess i am really CPP stupid. I just dont get it.
Maby it is not that hard to understand, but i am thinking in another way (the old way)
The code you gave is not tested as you have say'd... it gives me the same errors i am getting for hours now (x not declared etc... C++ forbidden to use etc...)

Hope you can or want to help me out:
i would only need 10 presets and 8 scenes to declare and reuse each time.. ( in the future, if i understand some more i can declare and instantiate the effects and effect states myself (that is my goal ;) )


My VB
This is what i would do in VB to declare, instantiate and than reuse the variable. I really dont understand this in the C++

Declaring the preset as a variable:
dim myPresetNumber1, myPresetNumber2, myPresetNumber3 as integer
dim myPresetName1, myPresetName3, myPresetName3 as string
dim mySceneNumber1, mySceneNumber2, mySceneNumber3 as integer
dim mySceneName1, mySceneName2, mySceneName3 as string
etc.

Instantiate the variable:
my variable: (C++ AxeSystem)
myPresetNumber1 = ((Preset(1).number))
myPresetName1 = ((Preset(1).name))

mySceneNumber1 = ((Scene(1).number))
mySceneName1 = ((Scene(1).name))

Reuse a variable in my code for the screens i would use it like this:
:if using layout presets. --> screen 1-10 (CS1-CS10)



Why do i want to declare variables and reuse them:
I try to do it this way, so that all the variables are allready known and ready to use when i am setting the value to the screens.
This way, the 15 screens would only take 1 second to be created and shown instead of beeing created one by one (doesn't look and feel right).

digitalWrite (CS1, LOW);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(3);
tft.setCursor(10,0);
tft.println("Preset");
tft.setTextSize(3);
tft.setCursor(110,0);
tft.setTextColor(ST7735_WHITE);
tft.println(myPresetNumber1);
tft.setCursor(10,60);
tft.setTextSize(3);
tft.setTextColor(ST7735_WHITE);
tft.println(myPresetName1);
digitalWrite (CS1, HIGH);

etc: --> CS2, CS3

:if using layout for scenes --> Screen 1-4 and 6-9 (CS1-CS4 and CS6-CS9)

digitalWrite (CS1, LOW);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(3);
tft.setCursor(10,0);
tft.println("Scene:");
tft.setTextSize(3);
tft.setCursor(30,50);
tft.setTextColor(ST7735_WHITE);
tft.println(mySceneNumber1);
tft.setCursor(75,85);
tft.setTextSize(3);
tft.setTextColor(ST7735_WHITE);
tft.println(mySceneName1);
digitalWrite (CS1, HIGH);

etc: --> CS2, CS3

> The AxeFx has 511 presets.

BANKS up or DOWN for preset layout: (+10 or -10 function)
In my configuration this would lead to make a configuration for BANK A - F
each bank would have 10 numbers ( 0-9)

Preset:
000-009 would be BANK A0
010-019 would be BANK A1
100-109 would be BANK B0
330-339 would be BANK C3
510-511 would be BANK F1

The Banknumbers would tell me which presetnumbers to collect and set to myPresetNumber1, myPresetNumber2 etc.
currentPresetNumber would tell me what the current bank it is... that way i know what bank i want to select if i go BANK-UP or BANK-DOWN and get the info.

How it would work: (preset 028)
First number of the activePreset.number is 0, that is Bank A
Second number is 2,
Now i know i am in Bank A2

BANK-UP would be To A3
BANK-DOWN would be to A1
(BANK A1 to F2 or visa versa is not figgured out yet)


It is not your problem that i don't understand the C++. If you have the time, hope you want to help me out to understand.
I have visited many C++ and Arduino forums, but all are way off the AxeFx library. This is as close as i can get to try to learn.

Thank you in advance

Cheers
 
Last edited:
Declaring variables is simple, it's just <type> <variable name>, like 'int myVar;' instead of 'dim myVar as integer'. The main thing to get used to is pointers, but I tried to make the library so you don't have to use too many. Instead of using strings, on a microcontroller you are better off using char buffers (an array of characters). I also tried to make this easy.

I would recommend keeping it super simple to start with if you're still getting used to C++. Rather than trying to implement your whole idea at once, try just once small thing at a time, get that working, and then add new features one by one. That will make debugging easier!
 
Hello there,
im totally new to programming.
I try to build my own midi Controller with this cool library. I already understood how to engage the tuner
and how to get the scene names. Very cool :)

Now I want to get the effect bypass status, but all examples in the library I tried said no effects engaged even If some effects are engaged...
Maybe someone can point me to what Im doing wrong.

Im using a Teensy 3.6 and a FX3.

Thanks :)
 
Last edited:
Hi, it's a bit difficult to help without more information. Perhaps post a screenshot of the axe grid with effects engaged, and then the output of the teensy? (Nice platform btw, I love teensy!)
 
Thank you for your reponse :)
I made few screenshots, hope they help.
As I said Im a totaly newbie in c++ or arduino.
I saw your library and thought this is my chance to get midi working :D
Maybe in the FX3 is an option to activate like PC oder Sysex realtime as I did for the Tuner and Preset refresh?
 

Attachments

  • Effect.jpg
    Effect.jpg
    277.7 KB · Views: 16
  • Scenes.jpg
    Scenes.jpg
    318 KB · Views: 17
  • Tuner.jpg
    Tuner.jpg
    376.4 KB · Views: 14
  • Preset.jpg
    Preset.jpg
    309.7 KB · Views: 17
Ah, I know what the problem is. I was worried that fetching effects every request was inefficient if they're not being used, so it is disabled by default. Clearly I neglected to update the examples!

To get the effects dump, you have to call this in the setup() function just after Axe.begin():

Code:
void setup() {
  ...

  Axe.begin(Serial1);

  Axe.fetchEffects(true);

  ...

}

I will update the examples if time permits.
 
Back
Top Bottom