Tune key at every location: the key the tracks send must reach each location's FOH (SuperRack) in that location's own Planning Center key

NA works out each location's expected Waves Tune programs (campus_tune) and serves them at /api/tune/<id>; locations
fetch their list, read ProPresenter through Companion's connection, and compare with a MIDI witness on the FOH Mac
(SC FOH now; WS FOH needs the Command Line Tools first). FOH KEY WRONG / FOH GOT NO KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 11:51:09 -04:00
co-authored by Claude Opus 5.5
parent 5d0263a9b9
commit e4a33ff660
9 changed files with 140 additions and 11 deletions
+18
View File
@@ -1267,6 +1267,21 @@ def eval_keys(rc, plan, look):
return line
def campus_tune(keys, library):
"""The Waves Tune programs a location's songs must reach its FOH with (2026-10-28, every location): each song's own
Planning Center key -> the programs of the clips in the Tune library that fit it (a minor song may sit on its
relative major). keys: [{"title", "key"}] from that location's plan; library: {clip name: program}."""
out = {}
for it in keys or []:
want = it.get("key") or ""
if not key_of(want):
continue
fits = sorted(n for n in library if tune_key(n) and same_tune(tune_key(n), want) and library[n] is not None)
if fits:
out[norm(it["title"])] = {"title": it["title"], "key": want, "clips": fits, "programs": sorted({library[n] for n in fits})}
return out
def tune_key(name):
"""The key a Waves Tune clip sets: "Ebmaj" -> "Eb", "C#min" -> "C#m"; None for "OFF | Chromatic" or "LOOP CUE"."""
m = re.match(r"^\s*([A-G](?:#|b)?)\s*(maj|min|m)?\b", name or "")
@@ -1936,6 +1951,9 @@ def look(cfg, now=None, data_dir=None, sources=None):
cplan = src["pco_campus"](campus["service_type"])
LAST.setdefault("campus_keys", {})[campus.get("short")] = [
{"title": it["title"], "key": it["key"]} for it in plan_songs(rc, cplan)]
LAST.setdefault("tune_expect", {})[campus.get("short")] = dict(
campus_tune(LAST["campus_keys"][campus.get("short")], al.get("tune_library") or {}),
_plan={"id": cplan.get("id"), "dates": cplan.get("dates"), "time": time.time()})
res = campus_ltc(rc, plan, na_songs, campus, cplan)
eval_campus_ltc(rc, res, lines["timecode"])
others.append(dict(res, songs=[dict(s, item={"id": s["item"]["id"], "note_ids": s["item"]["note_ids"]}) for s in res["songs"]]))