|
|
@@ -244,6 +244,49 @@ def validate_mod_host_channel_routes(state, source_by_id):
|
|
|
return errors
|
|
|
|
|
|
|
|
|
+def validate_additional_looper_routes(routing):
|
|
|
+ errors = []
|
|
|
+ links = routing.get("managed_links")
|
|
|
+ if not isinstance(links, list):
|
|
|
+ return ["routing.managed_links must be a list"]
|
|
|
+
|
|
|
+ second_loop_inputs = {
|
|
|
+ f"sooperlooper:loop1_in_{channel}" for channel in range(1, 5)
|
|
|
+ }
|
|
|
+ input_routes = [
|
|
|
+ link
|
|
|
+ for link in links
|
|
|
+ if (
|
|
|
+ isinstance(link, dict)
|
|
|
+ and isinstance(link.get("to"), str)
|
|
|
+ and link["to"] in second_loop_inputs
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ if input_routes:
|
|
|
+ errors.append("SooperLooper loop1 inputs must remain unconnected")
|
|
|
+
|
|
|
+ second_loop_output_links = [
|
|
|
+ link
|
|
|
+ for link in links
|
|
|
+ if isinstance(link, dict)
|
|
|
+ and isinstance(link.get("from"), str)
|
|
|
+ and link["from"].startswith("sooperlooper:loop1_out_")
|
|
|
+ ]
|
|
|
+ expected_edge = (
|
|
|
+ "sooperlooper:loop1_out_1",
|
|
|
+ "rigforge.direct-mix.input:playback_AUX8",
|
|
|
+ )
|
|
|
+ declared_edges = [
|
|
|
+ (link.get("from"), link.get("to"))
|
|
|
+ for link in second_loop_output_links
|
|
|
+ ]
|
|
|
+ if declared_edges != [expected_edge]:
|
|
|
+ errors.append(
|
|
|
+ "SooperLooper loop1 must route only output 1 to direct-mix AUX8"
|
|
|
+ )
|
|
|
+ return errors
|
|
|
+
|
|
|
+
|
|
|
def validate_state(state):
|
|
|
errors = []
|
|
|
if not isinstance(state, dict):
|
|
|
@@ -295,7 +338,7 @@ def validate_state(state):
|
|
|
if physical_inputs != {1, 2, 3, 4}:
|
|
|
errors.append("physical inputs must cover 1 through 4 exactly once")
|
|
|
|
|
|
- # The required looper is one instance containing one four-channel loop.
|
|
|
+ # One SooperLooper instance hosts two four-channel loops.
|
|
|
system = state.get("system")
|
|
|
components = system.get("components") if isinstance(system, dict) else None
|
|
|
if not isinstance(components, list):
|
|
|
@@ -306,8 +349,8 @@ def validate_state(state):
|
|
|
errors.append(f"exactly one looper component is required, got {len(loopers)}")
|
|
|
elif loopers[0].get("instance_count") != 1:
|
|
|
errors.append("looper.instance_count must be 1")
|
|
|
- elif loopers[0].get("loop_count") != 1:
|
|
|
- errors.append("looper.loop_count must be 1")
|
|
|
+ elif loopers[0].get("loop_count") != 2:
|
|
|
+ errors.append("looper.loop_count must be 2")
|
|
|
elif loopers[0].get("channels_per_loop") != 4:
|
|
|
errors.append("looper.channels_per_loop must be 4")
|
|
|
|
|
|
@@ -369,6 +412,7 @@ def validate_state(state):
|
|
|
|
|
|
errors.extend(validate_mod_host_chain(routing, source_by_id))
|
|
|
errors.extend(validate_mod_host_channel_routes(state, source_by_id))
|
|
|
+ errors.extend(validate_additional_looper_routes(routing))
|
|
|
|
|
|
parameters = state.get("parameters")
|
|
|
if not isinstance(parameters, dict):
|