TRACKS OUT builds the locations' sets (Location Setup PDF): SC and WS in their own PCO keys (pitched stems transposed, locator, Waves Tune, pads, CtW/Salvation), consolidated in Live; AB as NA; key check per location; never edits a set open in Live
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -343,6 +343,64 @@ class TestBuild(unittest.TestCase):
|
||||
self.assertTrue(os.path.isdir(os.path.join(os.path.dirname(path), "Ableton Project Info"))) # else Live finds no audio
|
||||
self.assertTrue(os.path.isdir(os.path.join(self.fin, "OLD SONG [Eb]", "Ableton Project Info")))
|
||||
|
||||
def test_the_locations_sets_in_their_own_keys(self):
|
||||
"""Waters_Worship_Location_Setup.pdf: WS (and SC) from the finished NA set in their own plan's keys; AB as NA."""
|
||||
self.run_job()
|
||||
na = os.path.join(self.proj, "NA", "261101 NA Project", "261101 NA Project.als")
|
||||
root = A.load(na)
|
||||
for c in root.iter("AudioClip"): # NA consolidated
|
||||
A.setv(c, "PitchCoarse", 0)
|
||||
A.save(root, na)
|
||||
A.LOC_STATUS = os.path.join(self.dir, "loc.json")
|
||||
job = dict(self.cfg, job="locations", site="NA", date="261101", folder="{date} {loc} Project", locations=["AB", "WS"],
|
||||
transpose={"WS": [{"title": "Grace", "key": "B"}, {"title": "Something Else", "key": "C"}]})
|
||||
path = os.path.join(self.proj, "WS", "261101 WS Project", "261101 WS Project.als")
|
||||
orig = A.live_set
|
||||
A.live_set = lambda: path # WS's set open in Live: not touched
|
||||
try:
|
||||
A.run_locations(job)
|
||||
finally:
|
||||
A.live_set = orig
|
||||
with open(A.LOC_STATUS) as f:
|
||||
self.assertIn("WS: ITS SET IS OPEN IN LIVE: OPEN ANOTHER SET, THEN HOLD TRACKS OUT", json.load(f)["log"])
|
||||
self.assertIn("2- GRACE - E", [A.val(l, "Name") for l in A.load(path).iter("Locator")])
|
||||
A.run_locations(job)
|
||||
st = json.load(open(A.LOC_STATUS))
|
||||
self.assertEqual(st["state"], "done", st.get("trace"))
|
||||
self.assertTrue(os.path.exists(os.path.join(self.proj, "AB", "261101 AB Project", "261101 AB Project.als")))
|
||||
ab = A.load(os.path.join(self.proj, "AB", "261101 AB Project", "261101 AB Project.als")).find("LiveSet")
|
||||
self.assertIn("2- GRACE - E", [A.val(l, "Name") for l in ab.findall("Locators/Locators/Locator")]) # AB keeps NA's keys
|
||||
root = A.load(path)
|
||||
ls = root.find("LiveSet")
|
||||
self.assertEqual(A.check(root), [])
|
||||
names = [A.val(l, "Name") for l in sorted(ls.findall("Locators/Locators/Locator"), key=lambda l: A.fval(l, "Time"))
|
||||
if not A.val(l, "Name").startswith("LOOP")]
|
||||
self.assertEqual(names, ["1- CALL TO WORSHIP - B", "2- GRACE - B", "3- GRACE - B", "4- BRAND NEW - D", "5- SALVATION - B"])
|
||||
by = {A.tname(t): t for t in A.tracks(ls)}
|
||||
self.assertEqual([(A.val(c, "Name"), A.val(c, "ProgramChange")) for c in A.clips(by["WAVES TUNE"])],
|
||||
[("Bmaj", "11"), ("Bmaj", "11"), ("Bmaj", "11"), ("Bmaj", "11")])
|
||||
self.assertEqual([A.val(c, "Name")[:2] for c in A.clips(by["AMBIENT PADS"])], ["B ", "B ", "B ", "B "])
|
||||
self.assertTrue(os.path.exists(os.path.join(os.path.dirname(path), "Samples/Imported/B - WARM - CHURCHFRONT PADS.wav")))
|
||||
g1 = [t for t in A.tracks(ls) if A.tname(t) == "GRACE"][0]
|
||||
keys = [t for t in A.family(ls, g1) if A.tname(t).startswith("5-Keys")][0]
|
||||
drums = [t for t in A.family(ls, g1) if A.tname(t) == "6-Drums (Live)"][0]
|
||||
self.assertEqual((A.val(A.clips(keys)[0], "IsWarped"), A.val(A.clips(keys)[0], "WarpMode"), A.val(A.clips(keys)[0], "PitchCoarse")),
|
||||
("true", "6", "-5"))
|
||||
self.assertEqual(A.val(A.clips(drums)[0], "PitchCoarse"), "0") # unpitched: as it was
|
||||
self.assertEqual([x[1] for x in A.pending(root)], ["5-Keys 1 [x]"]) # consolidated next, in Live
|
||||
self.assertIn("WS: GRACE E>B (1 CLIPS)", st["log"])
|
||||
self.assertIn("WS: NO BRAND NEW IN ITS PLAN, LEFT IN D", st["log"])
|
||||
self.assertIn("WS: SOMETHING ELSE IS NOT IN THE SET", st["log"])
|
||||
self.assertTrue([n for n in os.listdir(os.path.join(os.path.dirname(path), "Backup")) if "before WS keys" in n])
|
||||
# Again: nothing left to change.
|
||||
A.run_locations(job)
|
||||
st = json.load(open(A.LOC_STATUS))
|
||||
self.assertEqual([r.get("keys_changed") for r in st["results"]], [0])
|
||||
# TRACKS OUT on the READY page: the locator against WS's plan, and the clips still to consolidate.
|
||||
line = rd.eval_track_bundle({}, {"bundles": {"WS": {"als": True, "locators": names, "transposed": 1}}},
|
||||
{"WS": [{"title": "Grace", "key": "B"}, {"title": "Brand New", "key": "C"}]})
|
||||
self.assertEqual([m for _, m, _ in line.faults], ["WS BRAND NEW D NOT C", "CONSOLIDATE WS"])
|
||||
|
||||
def test_a_set_that_is_there_is_left_alone(self):
|
||||
os.makedirs(os.path.join(self.proj, "NA", "261101 NA Project"))
|
||||
st = self.run_job()
|
||||
|
||||
Reference in New Issue
Block a user