# ProgramChange with bank select

**URL:** <https://forum.electra.one/t/programchange-with-bank-select/3645>\
**Category:** General discussion\
**Created:** [April 13, 2025, 1:07pm UTC](https://forum.electra.one/t/programchange-with-bank-select/3645 "2025-04-13T13:07:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kx3](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kx3](https://forum.electra.one/u/kx3)\
**Post date:** [April 13, 2025, 1:07pm UTC](https://forum.electra.one/t/programchange-with-bank-select/3645/1 "2025-04-13T13:07:57Z")

</div>

E1mk2, FW is 4.0

It looks like PC with bank select is not yet implemented as a simple control.  
Is there a way to do it without using LUA?

After some research I came with this lua solution:

function Roland(ValueObject, value)  
if value==0 then return end  
midi.sendControlChange (PORT\_1, 1, 0, 00)  
midi.sendControlChange (PORT\_1, 1, 32, 00)  
midi.sendProgramChange (PORT\_1, 1, 1)  
end

However it’s not convenient: how can I make the actual PrgChange number a variable that can be defined by a momentary pad control with a fixed value.  
or any other suggestion to make it as simple as it can be because I need dozens of buttons like this

---

<div class="post-metadata">

**Author:** ![Manu](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/manu/32/3770_2.png) [@Manu](https://forum.electra.one/u/Manu)\
**Post date:** [April 13, 2025, 9:40pm UTC](https://forum.electra.one/t/programchange-with-bank-select/3645/2 "2025-04-13T21:40:02Z")

</div>

Hi @kx3, if you want to control bank and program number you have to set 2 controls one for each. Set a list control with banks and a list with program numbers. Then call this function from both controls. Set your controllers ids:

```
function Roland(ValueObject, value)

  local bankCtrl = controls.get(YOUR BANK CTRL ID)
  local programCtrl = controls.get(YOUR PROGRAM CTRL ID)
  local newProgram = programCtrl:getValues()[1]:getMessage():getValue()
  local newBank = bankCtrl:getValues()[1]:getMessage():getValue()
  midi.sendControlChange (PORT_1, 1, 0, 00)
  midi.sendControlChange (PORT_1, 1, 32, newBank)
  midi.sendProgramChange (PORT_1, 1, newProgram)

end

```

if you wan’t to use a momentary with fixed value for the program use this function (set your momentary off value to nil):

```
function Roland(ValueObject, value)

  if value then
    local bankCtrl = controls.get(YOUR BANK CTRL ID)
    local programCtrl = controls.get(YOUR PROGRAM CTRL ID)
    local newProgram = programCtrl:getMessage():getOnValue()
    local newBank = bankCtrl:getValues()[1]:getMessage():getValue()
    midi.sendControlChange (PORT_1, 1, 0, 00)
    midi.sendControlChange (PORT_1, 1, 32, newBank)
    midi.sendProgramChange (PORT_1, 1, newProgram)
  end    

end

```

I think this should work

---

<div class="post-metadata">

**Author:** ![kx3](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kx3](https://forum.electra.one/u/kx3)\
**Post date:** [April 14, 2025, 1:20am UTC](https://forum.electra.one/t/programchange-with-bank-select/3645/3 "2025-04-14T01:20:56Z")

</div>

Many thanks for your help, I’m a total noob in LUA scripting and you give me a place to start. I have much to learn to get comfortable with it.  
I’ll start by studying it to get a grasp at the whole concept (even though I’m almost proud of my single button press script! 😃 )  
For my needs, I can’t afford double button strokes because I use it for fast scene switch in musicals where half a second is an eternity…
