Arduino Axe-Fx control library

You are most welcome. Just didn't want to offend you by changing your code - it was pretty good as it was!

What part of Thailand are you from? My parents lived in Mae Sot for a few years...

No offense at all. On the contrary, I appreciate it because it helps me learning how to code with elegance.

I am from Barcelona, living in BKK
 
Hi you two Genius's ( @Piing & @tysonlt )

Quick questions - Hope you don't mind;
1- The latest file that Tyson has added to this thred is a complete version of Piings works to date with some mods and not a cut down version?
2- If starting from scratch, would I be better to use Tyson's or Piings code? Like - is one more complete than the other or is there criteria that would see me choose one over the other?

Thank again for this valuable work.
Pauly
 
I will highlight some differences:

Tyson is using a Teensy LC board and I am using Adruino Mega, but the code is compatible.

Tyson is using multiplexers for the buttons and the LEDs. I am not, because the Arduino Mega has plenty of I/Os to connect everything directly to the board

Tyson's program is coded nicely and professionally while mine is frankenstenized, as I am learning while I reverse-engineer pieces of code from different sources. But thanks to the tips that Tyson has kindly offered to me, now I am learning to code in a more orthodox way.

I don't like to add a single line to my code until I don't fully understand how it works. That is why the addition of new features at my development is taking so long, because I go step by step.

My knowledge still not arrives to understand 100% of Tyson's code. I can download it on my Arduino Mega, but I am not yet able to reverse-engineer the multiplexers to use my buttons/LEDs configuration. So I have ordered the multiplexers and the same display that he is using, with the intention of educating myself while playing with his code.

Currently I am working on the Analog Inputs for the use of external pedals. I still have to refine the presentation of the tuner at the screen

My next step will be to implement a touchscreen (probably a Nextion) to facilitate the personalization of switches configurations in different user layouts, etc. I am also looking for small I2C LCD's to install one individual display over each switch. Bad times for the FC-12 :p
 
Last edited:
Regarding the improved version of my code that Tyson has released, I did not see his post on Sunday, so I continued working for a while with my old dirty code. But now I am using that release as a base and I will rework everything from there.
 
Last edited:
Thanks @Piing
So tyson's version of your code is complete?... IE; I can start with that?
Thanks again
Pauly

I will highlight some differences:

Tyson is using a Teensy LC board and I am using Adruino Mega, but the code is compatible.

Tyson is using multiplexers for the buttons and the LEDs. I am not, because the Arduino Mega has plenty of I/Os to connect everything directly to the board

Tyson's program is coded nicely and professionally while mine is frankenstenized, as I am learning while I reverse-engineer pieces of code from different sources. But thanks to the tips that Tyson has kindly offered to me, now I am learning to code in a more orthodox way.

I don't like to add a single line to my code until I don't fully understand how it works. That is why the addition of new features at my development is taking so long, because I go step by step.

My knowledge still not arrives to understand 100% of Tyson's code. I can download it on my Arduino Mega, but I am not yet able to reverse-engineer the multiplexers to use my buttons/LEDs configuration. So I have ordered the multiplexers and the same display that he is using, with the intention of educating myself while playing with his code.

Currently I am working on the Analog Inputs for the use of external pedals. I still have to refine the presentation of the tuner at the screen

My next step will be to implement a touchscreen (probably a Nextion) to facilitate the personalization of switches configurations in different user layouts, etc. I am also looking for small I2C LCD's to install one individual display over each switch. Bad times for the FC-12 :p
 
If possible it is always better to use spare pins rather than multiplexers, especially when you are learning. Multiplexers add one more part that can go subtly but infuriatingly wrong.

Also any tft screen will be fine, or even an lcd. Sometimes doing it from scratch your own way is when you learn an enormous amount. Eg when doing the axe library, I initially started by modifying the FCBInfinity project, until I’d learned enough to rewrite from scratch.

The Axe library examples *should* provide enough to create a full controller. Just let me know if anything is confusing.
 
Thanks @Piing
So tyson's version of your code is complete?... IE; I can start with that?
Thanks again
Pauly

Hi again Pauly, if want to learn the most, I would consider starting your own from scratch, and only implement one feature at a time. Then you will understand every piece of the code.

At first, use serial print to write out what is happening. You might also want to wire up some cheap little push buttons that you can operate easily by hand. It’s a lot easier than working with an enclosure and foot switches.

https://www.jaycar.com.au/black-miniature-pushbutton-spst-momentary-action-125v-1a-rating/p/SP0711
 
The Axe library examples *should* provide enough to create a full controller. Just let me know if anything is confusing.

The library example "FetchAllScenes", is it supposed to read all Scene Names? I am only getting scene names 1, 2, 6 and 8 with corrupted names

This is what I read at the Serial Monitor:

Extra Scene: 1: 80's Rock Rhythm

=====================
Preset: 362
Extra Bogner Ecstasy Presets

Scene: 1
80's Rock Rhythm
=====================

Extra Scene: 1: 80's Rock Rhythm
Extra Scene: 2: Early 80's Leadck)
Extra Scene: 6: Brk-Up Strat Neck- BFmid TSt
Extra Scene: 8: Seeing Red ⸮
 
Last edited:
Hmm, that is a new feature that hasn’t been very thoroughly tested. That reverse question mark might mean that the data is corrupt. This can happen if you send too many commands at once and the input buffer on the arduino gets full.

I will have a look at a better way of doing it.
 
On a hunch, can you try it on a preset with shorter names?

Same result:


=====================
Preset: 193
Viva Santana

Scene: 3
Lead 2
=====================


Extra Scene: 1: Lead
Extra Scene: 2: Crunch
Extra Scene: 6: Tha guy
Extra Scene: 8: Tha guy Rich ⸮
 
Try this:

Code:
#include <AxeFxControl.h>

#define NUM_SCENES 8

struct SceneInfo {
    SceneNumber number = -1;
    const char *name;
};

SceneInfo scenes[NUM_SCENES];
AxeSystem Axe;

void setup() {

    Serial.begin(9600);

    Axe.begin(Serial1);
    Axe.registerPresetChangeCallback(onPresetChange);
    Axe.registerSceneNameCallback(onSceneName);
    Axe.requestPresetDetails(); 

}

void loop() {
    Axe.update();
}

void onPresetChange(AxePreset preset) {
    Serial.println("\nonPresetChange()\n=====================");
    Serial.printf("Preset: %d - %s\n", preset.getPresetNumber(), preset.getPresetName());
    Serial.printf("Scene: %d - %s\n", preset.getSceneNumber(), preset.getSceneName());
    Serial.println("=====================\n\n");
}

void onSceneName(const SceneNumber number, const char* name, const byte length) {

    Serial.printf("onSceneName(): %d: %s\n", number, name);
    scenes[number-1].number = number;
    scenes[number-1].name = name;

    for (byte i=0; i<NUM_SCENES; i++) {
        if (scenes[i].number == -1) {
            Axe.requestSceneName(i+1);
            break;
        }
    }

}
 
Back
Top Bottom