Problem changing the presets of a patch on Pisound
I have the following problem changing the presets of a patch on my Pisound:
MIDI Program Change Channel: Select Set — This defines which channel (or none, or omni) the control node should listen to for program changes to load a set by index. In my system, this is channel 3.
MIDI Program Change Channel: Select Set Preset — This defines which channel (or none, or omni) the control node should listen to for program changes to load a preset by index. In my system, this is channel 4.
MIDI Program Change Channel: Select Patcher — This defines which channel (or none, or omni) the control node should listen to for program changes to load a patcher by index. In my system, this is channel 5.
So, program change orders over MIDI channel 3 switch between different graph settings, and everything is fine.
Program change orders over channel 5 switch through the patches on the Pisound, which works.
However, program change orders over channel 4 don’t change the preset in the patcher. I can switch presets manually in the PiWeb, but not via MIDI program change.
Midimapping works fine
Any idea?
Just to be clear.. you've indicated that channel 4 controls Select Set Preset, but then when you describe your problem you're talking about a patcher. Are you using patcher presets or set presets?
I use the snapshots that come with the patcher; they appear as presets in the PiWeb. It's also possible to store new presets (snapshots) there, but I can't switch them via MIDI.
I want to switch between these presets via MIDI. Thanx
Is this patcher instance connected to the source that sends MIDI program change messages?
no there is no midi connected
Ok, a little success here. I'm able to scroll through the presets with the OSC controller now. Here is the path: /rnbo/inst/0/presets/load
. But no success via MIDI so far.
New try with this script: I changed the MIDI request to OSC, and it works. It's not the best way, but for now, it works for me. However, it would be great to change the presets directly via MIDI into the PiSound."
import mido
def main():
# List all available MIDI ports
available_ports = mido.get_input_names()
if not available_ports:
print("No MIDI input ports available.")
return
print("Available MIDI ports:")
for i, port in enumerate(available_ports):
print(f"{i}: {port}")
# Choose a MIDI port
port_index = int(input("Choose the MIDI port (number): "))
if port_index < 0 or port_index >= len(available_ports):
print("Invalid selection.")
return
selected_port = available_ports[port_index]
print(f"Connected to: {selected_port}")
# Open the selected MIDI port and read incoming messages
with mido.open_input(selected_port) as inport:
print("Listening for MIDI messages. Press Ctrl+C to stop.")
try:
for message in inport:
# Check for Program Change messages
if message.type == 'program_change':
program_number = message.program
print(f"Program Change received: Program {program_number}, Channel {message.channel + 1}")
# Send a MIDI Control Change message to change the preset (e.g., CC 10)
cc_message = mido.Message('control_change', control=10, value=program_number)
inport.send(cc_message) # This sends the CC message to the device
print(f"Control Change sent: CC 10, Value {program_number}")
except KeyboardInterrupt:
print("\nStopped.")
if name == "__main__":
main()
greetings, Tom
If there is no midi connected to an instance, you cannot change its preset via MIDI, FYI.
Yeah, I understand the MIDI input, but how I link it with the saved presets is completely unclear to me. I’ve added a patch here again, where you can see how I usually switch between presets in Max. How can I apply this process to Rnbo so that it also works on the Pisound? Thanx!