Phase 32: add MIDI track CLAP, VST2 and VST3 instruments

This commit is contained in:
Johannes Findeisen 2026-10-27 17:51:48 +01:00
commit fe484537f9
41 changed files with 1138 additions and 65 deletions

View file

@ -65,8 +65,26 @@ with tempfile.TemporaryDirectory(prefix="xtc-inspect-") as directory:
if number == 3:
project.write_text(modern.replace(identity.encode().hex(), b"bad-class-id".hex()))
check("--validate", project, 1)
# V12 track bindings retain references without executing module contents.
for number, identity in ((1, "org.xtc.instrument"), (2, ""),
(3, "0123456789abcdef0123456789abcdef")):
binding = (f"INSTRUMENT 0 {number} 0 42 {b'synth'.hex()}\n"
f"MODULE {str(module).encode().hex()}\n"
f"IDENTITY {identity.encode().hex() if identity else '-'}\n")
document = base.replace("XTC_PROJECT 10", "XTC_PROJECT 12").replace(
"END\n", "TRACK_INSTRUMENTS 1\n" + binding + "LIVE_INSTRUMENT 0\nEND\n")
project.write_text(document)
check("--inspect", project, 0, "instrument track 0", "no plugin code executed")
for malformed in (
document.replace("TRACK_INSTRUMENTS 1", "TRACK_INSTRUMENTS 2").replace(binding,binding+binding),
document.replace("INSTRUMENT 0 ", "INSTRUMENT 99 "),
document.replace("LIVE_INSTRUMENT 0", "LIVE_INSTRUMENT 99"),
document.replace(f"INSTRUMENT 0 {number}", "INSTRUMENT 0 0"),
):
project.write_text(malformed)
check("--validate", project, 1)
for text, messages in [
(base.replace("XTC_PROJECT 10", "XTC_PROJECT 999"), ("line 1", "999", "1..11")),
(base.replace("XTC_PROJECT 10", "XTC_PROJECT 999"), ("line 1", "999", "1..12")),
("XTC_PROJECT 10\n", ("line 2", "APP")),
(base.replace("TEMPO 120000", "TEMPO 0"), ("line 3", "TEMPO")),
(base + "OPTIONAL_FUTURE 1\n", ("Unknown fields",)),