[SOLVED] MIDI Pedalboard change after closing web UI

Hello again everyone!

So I’m aware of the fact that MIDI pedalboard changes are not allowed when the web UI is open. However, I’ve been playing with MOD compiled from their GitHub repos, and one thing that I noticed was that MIDI pedalboard switching starts working again as soon as the web UI is closed. Whereas with MODEP, it’s not possible and I have to restart the modep-mod-ui service after closing the web UI for MIDI pedalboard change to work again. Is it possible to implement that, @Giedrius? I remember seeing the piece of code in either MOD’s GitHub repos or their forums a couple days ago, but I can’t find seem to find it now at all.

Thanks.

Found it. Seems it’s this:

1 Like

I modified the file to add the lines shown above and went through the build and setup processes. It was a bit of a pain setting it up again, but I was able to do so. I can confirm that pedalboard changing starts working as soon as all the active browser instances are closed, without the need to restart the modep-mod-ui service.

However, I later found out that there’s actually an easier way to implement it than going through the entire process I did. You just have to change the contents of one file. So for anyone wanting to give it a try, here’s how they can do it:

  1. Run nano /usr/lib/python3/dist-packages/mod/host.py
  2. Scroll down to line number 1565. You’ll see the following text:
if not self.hmi.initialized:
    callback(True)
    return
  1. Replace those lines with the following lines instead:
if not self.hmi.initialized:
    # typically initialize_hmi takes care of this but without HMI we need to do it manually
    midi_pb_prgch, midi_ss_prgch = self.profile.get_midi_prgch_channels()
    if midi_pb_prgch >= 1 and midi_pb_prgch <= 16:
        self.send_notmodified("monitor_midi_program %d 1" % (midi_pb_prgch-1), callback)
    else:
        callback(True)
  1. Restart MOD UI using sudo systemctl restart modep-mod-ui.

Now you should be able to change pedalboards after closing the web UI, without needing to restart the service. @Giedrius maybe this can be implemented in the next release of MODEP?

1 Like