1. We would like to remind our members that this is a privately owned, run and supported forum. You are here at the invitation and discretion of the owners. As such, rules and standards of conduct will be applied that help keep this forum functioning as the owners desire. These include, but are not limited to, removing content and even access to the forum.

    Please give yourself a refresher on the forum rules you agreed to follow when you signed up.
    Dismiss Notice

Arduino Axe-Fx control library

Discussion in 'Other MIDI Controllers' started by tysonlt, Feb 6, 2019.

  1. Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
  2. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    You with need tysonlt/Simple_Controls
     
    Piing likes this.
  3. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Here is my platformio.ini:

    [env:teensylc]
    platform = teensy
    board = teensylc
    framework = arduino
    upload_protocol = teensy-cli
    lib_deps =
    PaulStoffregen/ST7735_t3
    PaulStoffregen/ShiftPWM
    JChristensen/Timer
    thijse/Arduino-EEPROMEx
    tysonlt/Simple_Controls
    tysonlt/AxeFxControl
     
    Piing likes this.
  4. #84 Piing, Apr 21, 2019
    Last edited: Apr 21, 2019
    Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    Thank you!

    After having solved the issue with the EEPROMEx library by replacing "Wprogram.h" with "Arduino.h", I have the sketch compiling correctly for Arduino Mega.

    I've just ordered the TLC5940 and CD74HC4067 multiplexers and a ST7735 display. Once its working, I will move to a Nextion Touch Screen and 16 switches
     
  5. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    That branch is a bit busted atm, working on fixing it. If you come across any bugs let me know
     
    Piing likes this.
  6. #86 Piing, Apr 27, 2019
    Last edited: Apr 27, 2019
    Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    With the example "Preset Details" I got the data when the preset is changed, but the current Scene Name is not refreshed when the scene is changed, only the SceneNumber is refreshed. How can I get the current Scene Name on SceneChange?
    Or do I have to fetch all SceneNames on PresetChange and call the current one using the SceneNumber?
     
  7. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Hi Piing, away from computer at the moment, but the scene name is included in the preset object passed to the preset change callback. You have to copy it into a buffer, it’s called copySceneName or something like that
     
  8. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Do you mean refreshed when you change it on the front panel?
     
  9. Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    The SceneName is not refreshed neither when changing scene on the front panel or from the pedal
     
  10. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Do you have 'Send MIDI PC' enabled in the MIDI/Remote menu?

    Currently the library relies on this to detect changes and trigger refresh. The problem was that if the library automatically refreshes when you send a command, you will also get a refresh after the Axe send the PC notification, resulting in double refresh. Not a huge problem but can slow things down. I opted to make it rely on MIDI PC from the Axe, and intended to document it one day :)

    I might add a setting to tell it to either rely on the Axe to tell us when the preset has changed, or to ask when we send a command.
     
    Piing likes this.
  11. Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    I've got it!! I was missing this line on void setup()
    Code:
    Axe.enableRefresh(AXE_REFRESH_RATE);
    Now the Current Scene Name is always refreshed
    I've got it 2 times, but that is not an issue
    Thank you!
     
  12. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Ah yes, I always have that on, haven't done much testing without it!

    Regarding getting it twice, could you please send me the code you are using? Are you getting two preset change callbacks?
     
  13. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Also, could you please tell me whether you have Send MIDI PC enabled on the Axe?
     
  14. Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    I attach the latest version of my code.
    Yes, I have Send Midi PC enabled on CHAN1 at the Axe-FX
     

    Attached Files:

  15. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    All looks good! A couple of tips:

    * Make sure you call Axe.update() every time you change the scene. Axe won't notify us of this, we have to ask.

    * You don't need onPresetName() if you are using onPresetChange().

    * By default, effect list retrieval is now turned off. Call Axe.fetchEffects(true) to get the list with the preset.

    * I would avoid using delay() for debouncing. A delay could cause the RX buffer to fill up before we can read the sysex messages. I have a simple library to do easy debounce: https://github.com/tysonlt/Simple_Controls or any other debounce lib will be good.

    * Same with flashing the led, I use https://github.com/JChristensen/Timer for this:

    Code:
    void onTapTempo() {
      //turn on led...
      timer.after(TAP_TEMPO_LED_DURATION, turnOffTapTempoLed);
    }
    
    void turnOffTapTempoLed() {
      //turn off led
    }
    
    Looks great though!
     
    Piing likes this.
  16. Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    Thank you very much for the tips!
    I've never studied programming. I'm learning by trial and error :)
     
  17. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    Like most of us! It’s looking pretty good so far.
     
    Piing likes this.
  18. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    I hope you don't mind, but I made some changes to show you an example of doing this without using delay(). Using the button library means you don't have to do debounce with delay() and don't need to maintain global state.

    I also changed the led flash to use the timer library instead of delay().

    I haven't tested this though!!
     

    Attached Files:

    Piing likes this.
  19. #99 Piing, Apr 30, 2019
    Last edited: Apr 30, 2019
    Piing

    Piing
    Expand Collapse
    Forum Addict

    Joined:
    Jul 30, 2008
    Messages:
    1,291
    Likes Received:
    1,296
    Location:
    Thailand
    Sorry, I missed that post. That is much more refined, indeed. I am learning a lot from it. I will keep working from there.

    Thank you very much!
     
  20. tysonlt

    tysonlt
    Expand Collapse
    Inspired

    Joined:
    Dec 16, 2018
    Messages:
    212
    Likes Received:
    176
    Location:
    Victoria, Australia
    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...
     
    Piing likes this.

Share This Page