I want to use an ILI 9341 Display to show the active plugins on my pedalboard as well as a switch state (for hardware bypass, see Topic GPIO output Hardware Bypass for Modep Patchbox OS) has anyone done something to that end or could point me into the right direction?
if one exists.
I have never programmed a UI or with the MODEP API -if one exists.
Pi-stomp is probably what you’re looking for
Yeah, I figured. But I already have all parts and dont want to spend another 200$. Cant make heads or tails with the code, and the switch information on the bottom of the screen is wasted real estate, since I am using a pedalino Mini to control the box. I just want the top half of the screen on Pistomp basically (and maybe hardware bypass).
That and I dont have an encoder hooked up. i was hoping to get touch input for menu items, but i abandoned that idea quickly.
I will say that I’m working on a project to provide similar information but using an LCD 4x20. I already built a basic midi controller and want to expand it to make it smarter when working with MODEP.
There is indeed a MODEP API that works over http requests but it doesn’t give you detail information and control over individual effects. If you want more detailed plugin information you’ll need to use LILV libraries. I’m working on this now and using the pi-stomp source code for learning how this can be accomplished.
So I wrote in the Pistomp forum, and Radall quickly answered solving my issue. Apparently the Beta branch has new code for the UI, with much more readable code. I have modified it as per his instructions, and will now see how that works out. Ill likely add an encoder and pot to my box. I’ll post (possibly in a few months) once I have done that. The beta branch of Pi-Stomp is installing as we speak.
Randall is an absolute hero!
Let us know how you get on, itd be great to see your hardware setup.
So the beta branch - as expected of a beta - is quite buggy, or I didnt set it up correctly. Im still waiting on my encoder, so the initial setup isnt fully complete yet. The main problem I have now is, that pistomp doesnt show changes made from within the UI. Apparently MOD-UI doesnt publish that?
How is your work going? I am working on some similar project and in my case, I am considering modifying modep webUI code by inserting a whistlblower function tells my code, via unix socket, what messages webUI is sending to its host
###webserver.py
import socket
def notify_diy_project(message="", socket_path="/tmp/diy_project_socket.sock"):
try:
client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
client_socket.connect(socket_path)
client_socket.send(message.encode('utf-8'))
client_socket.close()
and put below anywhere I want to be notified
`class ServerWebSocket(websocket.WebSocketHandler): #since all the changes from webui transmitted to mod-host through here...
...
def on_message(self, message):
if message == "pong":
return
data = message.split(" ",1)
cmd = data[0]
notify_diy_project(message=message) #Here we put our whistlblower
...
elif cmd == "param_set":
data = data[1].split(" ",2)
port = data[0]
value = float(data[1])
SESSION.ws_parameter_set(port, value, self)
and now I can recieve the message webUI is processing
import socket
import os
import signal
import sys
def start_listener():
socket_path = "/tmp/diy_project_socket.sock"
# Ensure the socket does not already exist
try:
os.unlink(socket_path)
except OSError:
if os.path.exists(socket_path):
raise
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
sock.bind(socket_path)
# Optional: Adjust permissions if necessary
os.chmod(socket_path, 0o666) # Allow read/write for all users
print("Hardware controller listening...")
def cleanup_socket(signum, frame):
print("Cleaning up socket...")
sock.close()
os.unlink(socket_path)
sys.exit(0)
signal.signal(signal.SIGINT, cleanup_socket) # Handle Ctrl+C gracefully
while True:
try:
data, _ = sock.recvfrom(1024)
message = data.decode('utf-8')
print(f"Received notification: {message}")
# Handle the notification (e.g., update hardware state)
except Exception as e:
print(f"Error receiving message: {e}")
break # Exit loop on error (optional)
if __name__ == "__main__":
start_listener()
I don’t think it is the most clever and future-proofed way but at least we can follow changes occured through webui (effector bypass on/off, added/removed effector, …)
My rpi got fried, so I had to total my build. Since then I upgraded to an rpi 5, and am now running bookworm beta on pistomp hardware. It’s just not worth the hassle of doing it yourself.
Sorry to hear that.
Not sure this comforts you but I too have fried 2 pisounds and a Pi (few gpio pins only though).
All is well that ends well tho. Now I can run NAM with some overhead left… I hope. Didn’t have enough time to play around with that yet. It doesn’t even have a case yet😅