ProgramChange with bank select

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

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

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! :smiley: )
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…