Skip to content

Align audio-engineering types with vectors conventions#94

Merged
matt-edmondson merged 1 commit into
vectorsfrom
claude/vectors-sync-progress-ofoith
Jun 13, 2026
Merged

Align audio-engineering types with vectors conventions#94
matt-edmondson merged 1 commit into
vectorsfrom
claude/vectors-sync-progress-ofoith

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Summary

Aligns the audio-engineering types — merged from main in #88 and still carrying 1.x conventions — with the rest of the vectors branch. (The 1.x → 2.0 migration guide that was bundled with the first draft of this work already merged in #93; this PR is the code refactor on its own.)

Namespace

Cents, Decibels, Gain, NormalizedParameter, ParameterTaper, Percent, QFactor, and Semitones move from ktsu.Semantics to ktsu.Semantics.Quantities, alongside every other quantity type.

One Ratio

The audio module shipped its own Ratio<T> struct, shadowing the generated Dimensionless Ratio<T>. The audio struct is deleted and the generated type becomes the single ratio currency:

  • Decibels.ToPower(), the Cents/Semitones frequency-ratio conversions, and Percent.FromRatio/ToRatio now exchange the generated Ratio<T>.
  • A new Dimensionless × Dimensionless relationship in dimensions.json generates Ratio × Ratio => Ratio (and SignedRatio × Ratio => SignedRatio for free), preserving the multiplication the audio struct used to provide. Same-type division yields the raw storage value, consistent with every other quantity.
  • Note: the generated Ratio is V0 (non-negative), which is the right semantics for the frequency/power ratios these types use.

The migration guide is touched only to correct the audio-types row (they move with everything else now, rather than staying in ktsu.Semantics).

Testing

  • AudioEngineeringTests rewired for the new Ratio plumbing, plus a new test pinning that ratio arithmetic comes from the generator.
  • Full suite: 683 pass, zero regressions (the 93 failures are the pre-existing Windows-path tests on the Linux runner).
  • Local verification used a temporarily pinned Roslyn 4.12.0 (not committed); CI builds the repo's 5.3.0 natively.

https://claude.ai/code/session_01AUgbNJjDBDCwcbUfPK3pGW


Generated by Claude Code

…branch

- Move Cents, Decibels, Gain, NormalizedParameter, ParameterTaper,
  Percent, QFactor and Semitones from ktsu.Semantics to
  ktsu.Semantics.Quantities, alongside every other quantity type.
- Delete the audio-specific Ratio<T>: the generated Dimensionless Ratio
  is the single ratio currency. Decibels.ToPower(), Cents/Semitones
  frequency-ratio conversions and Percent.FromRatio/ToRatio now exchange
  the generated type, and a Dimensionless x Dimensionless relationship
  supplies Ratio * Ratio (same-type division yields the storage value,
  as for every quantity).

https://claude.ai/code/session_01AUgbNJjDBDCwcbUfPK3pGW
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4 Security Hotspots
0.0% Coverage on New Code (required ≥ 80%)
C Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@matt-edmondson matt-edmondson merged commit 936b222 into vectors Jun 13, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants