Program change in Modep: button vs midi behavior

I’m seeing a difference in behavior when I do a program change between using the button and sending a midi program change.

When I press the button x times, the pedalboard that is at the x-1th position in the default bank is loaded where the default bank is the bank in the 0th position in the bank list.

But, when I send the same x using midi program change on channel 15, the apparent behavior is to load the xth pedalboard in the pedalboard directory (/var/modep/pedalboards/) as sorted by alphabetical order. (Note that I changed the file /var/modep/profile5.json such that midiChannelForPedalboardsNavigation is set to 15 as I read in this forum which does seem to work).

My preference is that the midi program change behavior would be like the button behavior. Is there a way to make it so that it behaves like that?

This is the location that makes the decision which pedalboard to load:

There’s a host.py somewhere under /usr/lib in your file system, you may modify it to print out some additional information to figure out what’s going on exactly.

It seems it does have some logic for preferring the first user bank and its order, otherwise, taking all the pedalboards alphabetically. From your description, it sounds like the latter option gets picked.

For seeing any additional output you add, restart the modep-mod-ui.service and check its journal log:

sudo systemctl restart modep-mod-ui

journalctl -u modep-mod-ui

Thanks. This was exactly what I needed to track down the behavior. Unfortunately, having tracked it down, I don’t see any way that it could ever execute the path that uses the userbanks instead of alluseropedalboards. When you save a pedalboard in bank 0, the code in bank.py saves the bank_id as -2, then when it reads it in it adds the 2 back in so bank_id will be 0. However, at lines 344-353, when the Host object is instantiated, self.userbanks_offset is set to 2 if there are factory pedalboards or 1 otherwise. Since there are no factory pedalboards it will be 1, but either way it will fail the test at line 1746. I don’t see any user settable way to make this behave differently. I could hard code it to behave like I want, but obviously that will fail after an update. I’d love to be proven wrong on this - I even brought in Claude Code to try to find a solution and it failed also.

My workaround is to prefix the names of my pedalboards with A01_, A02, etc so they are always in the right order. Inelegant, but it works.

Yeah, it’s the way how MOD Audio implemented it. I checked their latest version code here, it’s still identical. You could try and submit a pull request to them proposing a better implementation.

Your naming workaround sounds like the best quick solution to the issue.