• 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.

Arduino Axe-Fx control library

miknshla

Inspired
Ya. I don't know how to turn an effect on or off in the preset's effect list.

Here's what I'm trying to achieve. I have FCB1010 which I used FCB_Infinity code years ago to control AxeFx2. I would like to get it working with FM3. Here's what works so far:
1. Expression Pedals
2. TapTempo/Tuner
3. Preset Inc/Dec
4. Scene Change
5. Led's to indicate which effects are engaged in a preset and they update when scene or preset changes.

So, now I am trying to get foot switches to turn off/on effect blocks and get the led's to update with the current status.

I'm using onPresetChange to build an array of effects and their position in the array indicates there index number for that preset.
At the same time, it builds an array of the effect bypass states.

I use that info to update led's for those effects.

With Axe.toggleEffect(ID_COMP1); I can toggle the compressor on/off but the LED doesn't update.

I think I would like to try using AxeEffect.enable(index_no) but I don't know how to use anything in the AxeEffect.h. I thought I would just type AxeEffect.xxxxxxx(yyy); but I get errors like this:

fcb1010: In function 'void loop()':
fcb1010:264: error: expected unqualified-id before '.' token
AxeEffect.bypass(Btn_Upper_Effect_Index[0]);
^
expected unqualified-id before '.' token
 

miknshla

Inspired
Ok a little more digging and I find that I can put

effect.enable();

inside onPresetChange and it will turn on all the effects as it loops thru the list.

what does effect.enable() need to be inside for it to be recognized?
 

tysonlt

Experienced
what does effect.enable() need to be inside for it to be recognized?
Not really sure what you mean... if you call enable()/disable()/toggle() on an AxeEffect object, it will immediately send it to the AFX. If you have a look here:

https://github.com/tysonlt/AxeFxControl/blob/master/examples/EffectList/EffectList.ino

All you need to do is loop over the effect list returned from AxePreset. The effect index indicates where the effect sits in the list of effects for that preset. Once you fetch the effect with AxePreset.getEffectAt(index), you can read it and control its state. There is no need to worry about the internal EFFECT_ID_ values (eg ID_COMP1) if you do it this way.
 

miknshla

Inspired
Thanks for the reply and trying to understand me, Tyson. My problem might be that I don't understand callbacks and pointers, yet. I will keep at it.

On my FCB1010, I have a mode button so that I can make the buttons respond differently for different modes of operation. 2 of the 12 buttons are always for inc/dec preset but the other 10 buttons depend on the mode of operation:
1. 10 stomps mode uses 10 buttons for effects
2. Scenes modes is similar to above but uses bottom 5 buttons for scenes
3. Looper mode uses bottom 5 buttons for looper functions
4. 10 stomps Extended mode uses the 10 buttons as a 2nd page of effects

So, I handle these modes in my void loop () section and I was hoping to use the index numbers there to enable/disable effects.

I'm not sure why but when I enter this line in the void loop() section:
AxePreset.getEffectAt(index);

I get this error on compile
fcb1010: In function 'void loop()':
fcb1010:266: error: expected unqualified-id before '.' token
AxePreset.getEffectAt(0);
^

expected unqualified-id before '.' token

Do I have to register something? Or can I only call AxePreset.getEffectAt(index); from within void onPresetChange(AxePreset preset)?
 

tysonlt

Experienced
Ah, I think we are having a problem with terminology. AxePreset.getIndexAt is shorthand for “whatever your preset variable is called”.getEffectAt().

So in your onPresetChange callback, if you have defined it like this: onPresetChange(AxePreset preset), then you would call preset.getEffectAt(...).

have a look at the examples in the repo and it should be clear.
 

Axelman8

Inspired
Hey there,

Here is my approach of using the effects


//Function:
void onEffectsReceived(PresetNumber number, AxePreset preset)

In this function, I set the effectindex to a variable so i can reuse it. i guess you can skip this part and just use effectId.
I use the variables to let the program descide to wich button to add the effect. My tft screen(s) show the name of the effect.

//loop through:
switch (effectindex)
{
case 1:
effect1 = (effect.getEffectId());


//For the buttons I call the variable i made (effect1), but for your FCB1010, you could call the effect ID and set it to a button and led
AxeEffect *effect = Axe.getCurrentPreset().getEffectById(effect1); // <- you enter the effectId here
effect->toggle(); // set ON or OFF, most easy approach

//Effect bypass option for the led
AxeEffect *effect = Axe.getCurrentPreset().getEffectById(effectindex);
if (effect->isBypassed()) { //Code here for led on/off; }


* See attachment for the effectId list.


-> Some idea to show if an effect is available in a preset:
You could also create a function for your own convenience to show if a effect is available yes/no
f.i.: If delay is not used in the preset, than the led is OFF. If effect is present, but bypassed, you could BLINK the led or something and if the effect is present and active led is ON.. or something like that. If i remember correctly the FCB only has a red LED color. if it had Green also it would be much more easier to deal with this situation.


Hope this helps you out


Cheers
 

Attachments

  • AxeFxIII_effect_Id list.txt
    2.1 KB · Views: 8
Last edited:

miknshla

Inspired
Hey there,

Here is my approach of using the effects


//Function:
void onEffectsReceived(PresetNumber number, AxePreset preset)

In this function, I set the effectindex to a variable so i can reuse it. i guess you can skip this part and just use effectId.
I use the variables to let the program descide to wich button to add the effect. My tft screen(s) show the name of the effect.

//loop through:
switch (effectindex)
{
case 1:
effect1 = (effect.getEffectId());


//For the buttons I call the variable i made (effect1), but for your FCB1010, you could call the effect ID and set it to a button and led
AxeEffect *effect = Axe.getCurrentPreset().getEffectById(effect1); // <- you enter the effectId here
effect->toggle(); // set ON or OFF, most easy approach

//Effect bypass option for the led
AxeEffect *effect = Axe.getCurrentPreset().getEffectById(effectindex);
if (effect->isBypassed()) { //Code here for led on/off; }


* See attachment for the effectId list.


-> Some idea to show if an effect is available in a preset:
You could also create a function for your own convenience to show if a effect is available yes/no
f.i.: If delay is not used in the preset, than the led is OFF. If effect is present, but bypassed, you could BLINK the led or something and if the effect is present and active led is ON.. or something like that. If i remember correctly the FCB only has a red LED color. if it had Green also it would be much more easier to deal with this situation.


Hope this helps you out


Cheers
Thanks guys. I will check this out. And yes, i have a “reveal” button that I used with axefx2 that would show which effects are available so that is feature on my list to get working again
 
Top Bottom