Skip to content

Commit 7b68279

Browse files
committed
Add a custom command for running SooperLooper GUI and fix MIDI Bindings loading.
1 parent 276ca16 commit 7b68279

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

zyngine/zynthian_engine_sooperlooper.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,20 @@ def __init__(self, state_manager=None):
323323

324324
self.osc_target_port = self.SL_PORT
325325

326-
self.command = ["sooperlooper", "-q", "-l 0", "-D no", f"-p {self.osc_target_port}", f"-j{self.jackname}"]
327-
328326
# Load custom MIDI bindings
329327
custom_slb_fpath = self.config_dir + "/sooperlooper/zynthian.slb"
330328
if os.path.exists(custom_slb_fpath):
331-
self.command += [f"-m {custom_slb_fpath}"]
332329
logging.info(f"loading sooperlooper custom MIDI bindings: {custom_slb_fpath}")
330+
else:
331+
custom_slb_fpath = None
332+
333+
# Build SL command line
334+
if self.config_remote_display():
335+
self.command = ["slgui", "-l 0", f"-P {self.osc_target_port}", f"-J {self.jackname}"]
336+
else:
337+
self.command = ["sooperlooper", "-q", "-l 0", "-D no", f"-p {self.osc_target_port}", f"-j {self.jackname}"]
338+
if custom_slb_fpath:
339+
self.command += ["-m", custom_slb_fpath]
333340

334341
self.state = [-1] * self.MAX_LOOPS # Current SL state for each loop
335342
self.next_state = [-1] * self.MAX_LOOPS # Next SL state for each loop (-1 if no state change pending)
@@ -413,9 +420,9 @@ def __init__(self, state_manager=None):
413420
# ---------------------------------------------------------------------------
414421

415422
def start(self):
416-
#logging.warning("Starting SooperLooper")
423+
logging.debug(f"Starting SooperLooper with command: {self.command}")
417424
self.osc_init()
418-
self.proc = Popen(self.command, stdout=DEVNULL, stderr=DEVNULL)
425+
self.proc = Popen(self.command, stdout=DEVNULL, stderr=DEVNULL, env=self.command_env, cwd=self.command_cwd)
419426
sleep(1) # TODO: Cludgy wait - maybe should perform periodic check for server until reachable
420427

421428
# Register for common events from sooperlooper server - request changes to the currently selected loop

0 commit comments

Comments
 (0)