Skip to content

Commit 817a672

Browse files
committed
Change the MIDI & audio ports used to interface with zynthian.
1 parent e4acfc2 commit 817a672

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

mod/host.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,8 @@ def init_jack(self):
11841184
self.midi_aggregated_mode = has_midi_merger_output_port() or has_midi_broadcaster_input_port()
11851185

11861186
#Add monitor ports for Zynthian routing
1187-
self.audioportsIn.append("zynmixer_send_0")
1188-
self.audioportsIn.append("zynmixer_send_1")
1187+
self.audioportsIn.append("zynthian_send_0")
1188+
self.audioportsIn.append("zynthian_send_1")
11891189

11901190
return True
11911191

@@ -2090,7 +2090,7 @@ def report_current_state(self, websocket):
20902090
websocket.write_message("add_hw_port /graph/%s midi 0 %s %i" % (name.split(":",1)[-1], title, i+2))
20912091

20922092
# Zynthian Router
2093-
websocket.write_message("add_hw_port /graph/zynthian_main_out midi 0 Zynthian_Main_Out 1")
2093+
websocket.write_message("add_hw_port /graph/zynthian_midi_out midi 0 Zynthian_MIDI_Out 1")
20942094

20952095
# MIDI Out
20962096
if self.midi_aggregated_mode:
@@ -2115,7 +2115,7 @@ def report_current_state(self, websocket):
21152115
websocket.write_message("add_hw_port /graph/%s midi 1 %s %i" % (name.split(":",1)[-1], title, i+2))
21162116

21172117
# Zynthian Router
2118-
websocket.write_message("add_hw_port /graph/zynthian_main_in midi 1 Zynthian_Main_In 1")
2118+
websocket.write_message("add_hw_port /graph/zynthian_midi_in midi 1 Zynthian_MIDI_In 1")
21192119

21202120
if self.midi_loopback_enabled:
21212121
websocket.write_message("add_hw_port /graph/midi_loopback midi 1 MIDI_Loopback 42")
@@ -3364,19 +3364,23 @@ def _fix_host_connection_port(self, port):
33643364
if data[2] == "capture_2":
33653365
return self.jack_hw_capture_prefix + "2"
33663366

3367-
# Zynthian ports: ---------------------------
3368-
# Zynmixer Send => Audio routed from Zynthian Layer
3369-
if data[2].startswith("zynmixer_send_"):
3370-
num = data[2].replace("zynmixer_send_","",1)
3367+
#----------------------------------------------------------
3368+
# Zynthian Ports:
3369+
#----------------------------------------------------------
3370+
# Zynmixer => Audio routed from Zynthian to mod-ui
3371+
if data[2].startswith("zynthian_send_"):
3372+
num = data[2][len("zynthian_send_"):]
33713373
if num=="0":
3372-
return "zynmixer:send_a"
3374+
return "zynmixer:output_moduia"
33733375
elif num=="1":
3374-
return "zynmixer:send_b"
3375-
# ZynMidiRouter => MIDI routed to/from Zynthian
3376-
if data[2].startswith("zynthian_"):
3377-
subport = data[2].replace("zynthian_","",1)
3378-
return "ZynMidiRouter:{}".format(subport)
3379-
# -------------------------------------------
3376+
return "zynmixer:output_moduib"
3377+
# ZynMidiRouter => MIDI routed from Zynthian to mod-ui
3378+
elif data[2].startswith("zynthian_midi_out"):
3379+
return "ZynMidiRouter:mod_out"
3380+
# ZynMidiRouter => MIDI routed from mod-ui to Zynthian
3381+
elif data[2].startswith("zynthian_midi_in"):
3382+
return "ZynMidiRouter:main_in"
3383+
# ----------------------------------------------------------
33803384

33813385
# Default guess
33823386
return "system:%s" % data[2]

0 commit comments

Comments
 (0)