feat(opsl): vendor OPSL o1nk docs and add Swift<->OPSL parity check #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/opsl-parity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Phase 4b of the OPSL alignment: vendor the o1nk OPSL documents and add an automated parity check between
O1NKParameters.swift(the AU parameter tree) and the OPSL device/layout schema, so the two stop drifting silently.opsl-publictagv0.3.0(commit730919c) underopsl/:toilville-o1nk.sampler.device.json(roleinit— factory defaults + domains)toilville-o1nk-punchy-drums.device.json(rolepatch)toilville-o1nk-default.movemap.layout.json(controller layout)toilville-o1nk-demo.movemap.bundle.json(demo bundle)opsl/VERSIONrecords the source tag/commit for future re-vendoringscripts/opsl_parity.py, a standalone parity check (no test target exists ino1nk.xcodeproj— only theo1nkando1nkAudioUnitExtensiontargets — so this runs outside Xcode rather than via pbxproj surgery to add one). It parsesO1NKParameters.swiftwith regex (the file'scase .x: return yswitches are regular enough that this was cross-checked byte-for-byte against literally compiling the real enum withswiftc) and compares everyO1NKParamcase against the OPSL init device + layout for:domaindefaultValuevs the init device'sstate.param_values[identifier].value(mapping enum indices throughdomain.valueswhere needed)section_hint, cross-checked against the movemap layout's actual placementscripts/opsl_parity_allowlist.jsonfor mismatches that are real but not obviously a typo on either side — documented with notes rather than silently fixed.Testing
python3 scripts/opsl_parity.py— passes (exit 0). It finds 5 mismatches across 3 identifiers, all allowlisted as pending decisions (see below); no new, unallowlisted mismatch exists today.xcodebuild -project o1nk.xcodeproj -scheme o1nk -destination 'platform=iOS Simulator,id=<iPad simulator>' -configuration Debug build— BUILD SUCCEEDED, including theo1nkAudioUnitExtensiontarget (embedded as a PlugIn of the app). Simulator builds use ad hoc "Sign to Run Locally" signing, so no code-signing blocker was hit. Did not attempt a device/Release build (would need a provisioning profile).Mismatches found — need Peter's call, nothing changed on either side
None of these looked like an obvious typo (e.g., a transposed digit or a copy-paste slip with identical surrounding context), so per instructions I left both sides alone and just documented them in
scripts/opsl_parity_allowlist.json:sample.index— range: SwiftO1NKParam.rangeis0...127; OPSLdomainis-1...127(-1= "no sample loaded"). Default: SwiftdefaultValueis0; OPSL initstate.param_values["sample.index"].valueis-1. Open question: should the AU range/default be widened to include the-1sentinel, or is0(first sample) intentionally the AU-side floor with-1being host/state-only?modulation.table— same shape as above: Swift range0...128/ default0vs OPSL domain-1...127/ init value-1(-1= "none"). Same open question about the sentinel.sample.interpolation— SwiftvalueStringshas 3 modes (Classic,Linear,OverSmp— each documented in-code with distinct hardware-fidelity behavior); the OPSLdomain.valuesonly lists 2 (linear,none). Looks like the OPSL doc may predate the 3-way interpolation mode, but that's a guess — needs a decision on whether to add a 3rd domain value (and pick a raw token forClassic/OverSmp) or whether the device schema intentionally restricts this to 2 values.Impact Statement
O1NKParameters.swiftis untouched; this PR only adds vendored reference docs and a check script.opsl-publicv0.3.0; nothing in this repo defines or mutates the OPSL schema.opsl/*.json(vendored, not generated) andopsl/VERSIONas new tracked files. No existing data files touched.python3 scripts/opsl_parity.py) and isn't wired into CI yet — Peter can decide separately whether/where to run it as a gate (e.g. the samepython:3.12-slim-style containeropsl-public's own validator uses).opsl/andscripts/directories, README section). No existing file was modified except README.md.Docs
README.md— new "OPSL parity" section: how to runscripts/opsl_parity.py, what it checks, how the allowlist works, and the step-by-step for re-vendoringopsl/*.json+opsl/VERSIONfrom a futureopsl-publictag.