Momentary Pad Macros

Hi all, new around here. Just setting up my first E1 Preset for a Chase Bliss Generation Loss MKII.

I’m pretty happy with my preset so far. But I’m having a little trouble figuring out how to have a Momentary Pad send out multiple CC commands at once.

For instance, on this pedal, there is a ‘hidden’ freeze mode. In order to put the pedal in freeze mode, I need to send the following commands:

CC21 3
CC76 1
CC77 1

I’d like to make a momentary pad that sends all 3 of these at once.

The E1 seems so advanced, I’m sure it can be done. But I’m having a little trouble figuring it out. Could someone point me in the right direction? Is this what Lua is for?

Thanks!

Wade

Take a look at this preset. The bottom row has a momentary button to do that
multi CC example

A few notes - since you are sending multiple CCs, LUA is the easiest way to do that (I think).
So - the momentary button is defined as virtual and it calls a helper function sendMultiCC.

In the LUA code at the bottom, you’ll see that function and how it simply sends 3 CC messages.
The other small note is that there is a print statement at the beginning of the function and an “if” conditional. If you have the web UI debug window open, you’ll see the print statement is called 3 times - once when the preset loads, once when you press the button and once when you release it.

In all probability, you don’t want your multi-CC message sent 3 times, so the code simply returns (does nothing) during initialization and when you release the button.

Thanks very much oldgearguy.

I was able to copy the button and the Lua code into my preset. Just tested and it worked like a charm.

The other faders in your preset are also very interest. Thank you for sharing!

Ok, now that I have that working, not to push my luck…but what if I wanted it to be attached to a toggle pad?

So below I created the 2 states in Lua code (I think):

– Multi CC transmit function

ccMIDIport = PORT_1
ccMIDIchan = 2

function FreezeModeOn(valueObject, value)

print("value = " … value)

if (value == 0) then return end

midi.sendControlChange(ccMIDIport, ccMIDIchan, 21, 3)
midi.sendControlChange(ccMIDIport, ccMIDIchan, 76, 1)
midi.sendControlChange(ccMIDIport, ccMIDIchan, 77, 1)
end

– Multi CC transmit function

ccMIDIport = PORT_1
ccMIDIchan = 2

function FreezeModeOff(valueObject, value)

print("value = " … value)

if (value == 0) then return end

midi.sendControlChange(ccMIDIport, ccMIDIchan, 21, 1)
midi.sendControlChange(ccMIDIport, ccMIDIchan, 76, 0)
midi.sendControlChange(ccMIDIport, ccMIDIchan, 77, 0)
end

I’m stuck because in the editor for a toggle button I only see one function that can be added.

Thank you!

This is the plus/minus of diving into LUA. It helps if you have some understanding of what the LUA stuff is trying to do. A full background in programming isn’t necessary, but a basic idea of assignment statements (x = y), conditional checks (if x == 3 then …) and such makes life a lot easier when trying to extend the functionality. It’s practically impossible to provide full ‘grab and use’ examples for every scenario. However, there’s a ton of cool presets out there and even if you don’t own the target hardware, loading up a preset, pressing/turning some controls and then looking under the hood can really help explain what is happening.

Of course, keep asking questions and poking around and trying things. We’re all constantly learning and no one here should be discouraging and the more folks that learn how to customize their presets to full effect is better. I learn stuff from the regular posters here every day. The worst thing to do is give up and stop asking questions.

As I mentioned before, the sendMultiCC had a guard against sending the CC on messages every time you press and release (if value == 0 then return). That was because you didn’t want to do anything special after letting go.

For the toggle function you want to do something on the toggle On and then something else on the toggle Off. So you can’t ignore the value == 0 condition any more.

Take a look at the link again - I added a toggle button next to the original.
Look at the code carefully - there’s a new function called sendMultiToggle that looks at the press/release info (value = 0 or 1)and decides whether to send the On or Off CC info.

(slight apologies for the long rambling prelude to actually answering the question)

2 Likes

No need to apologize at all. I really appreciate your thoughtful response. Thank you for posting another example.

Usually when I start down a road of learning something new and technical, I just need a few examples to start to see the lay of the land before I’m off on my own journey of learning. But in the beginning, it really helps to be pointed in the right direction (which you have totally done). Granted, this is a little different for me because I have zero coding in my background.

The good new is, I think my need are very limited since I mainly picked up the e1 to use from the mix position processing audio through midi pedals in various racks. Pedals seem to be much less complicated than synths, for instance. But hopefully what I learn, will make me brave enough to start to think about using the e1 with my synths as well.

In any case, all this to say thanks! I’ll try out the toggle functionality tonight. Looking forward to it.

Glad to help. If I was retired, I could easily spend a full day every day answering questions, crafting examples, and writing/helping to write presets for folks.

Since I’m not :frowning_face: , I try to help others learn so they can work on their own customizations and maybe eventually help others. As you point out, everyone’s needs are different, so the more worked examples people have to see and experiment with, the better.

Martin’s documentation should not be ignored either. lol There’s a lot of cool stuff in there and there’s some good explanations especially in the beginning of the docs that lay out the thought behind the E1 and how best to get it set up and running and such.

This is one of the few consistently uplifting/positive forums I’ve been on and it seems the folks here work hard to keep it that way.

3 Likes

Ok, making some progress but a little bit stuck.

I now have 2 toggle pads in the preset below:

https://app.electra.one/preset/V9BLrwX0WqdutLgvWBbT

Each button is linked to a different Lua function in the editor (one for to StopAux and one for to FilterAux). I modified these functions from the examples provided by oldgearguy.

When I create the first button, everything works as intended. But when I create the 2nd button, both buttons now execute the 2nd button’s function.

When I look in the midi console, I can see 4 commands sent with each button press instead of 2, no matter which button I press.

So my question is, what’s wrong with my Lua code here? How can I have the Stop Aux pad call the StopAux function and the Filter Aux pad call the Filter Aux function?

I’m sure it’s something so dumb and obvious but I can’t seem to get it to work.

Thank you!!

It’s one of the quirks of the interface. When you copy and paste a control, the parameter number stays the same.
Easy fix – in the web UI, click on the second control. In the left panel, scroll down to where you see “Parameter Number”. Change it to something else (maybe increase it by 1 or something).
To verify that was the problem, you can also click on the first control and see what the parameter number was set to there.

When you create a new control, the number is automatically incremented. It’s only the copy/paste functions that keep everything the same.
(Maybe a future feature request?)

| theodd
October 24 |

  • | - |

Ok, making some progress but a little bit stuck.

I now have 2 toggle pads in the preset below:

https://app.electra.one/preset/V9BLrwX0WqdutLgvWBbT

Each button is linked to a different Lua function in the editor (one for to StopAux and one for to FilterAux). I modified these functions from the examples provided by oldgearguy.

When I create the first button, everything works as intended. But when I create the 2nd button, both buttons now execute the 2nd button’s function.

When I look in the midi console, I can see 4 commands sent with each button press instead of 2, no matter which button I press.

So my question is, what’s wrong with my Lua code here? How can I have the Stop Aux pad call the StopAux function and the Filter Aux pad call the Filter Aux function?

I’m sure it’s something so dumb and obvious but I can’t seem to get it to work.

Thank you!!

Ah, yes, that was it. Perfect. I’ll watch out for that going forward.
Thank you!