Align audio-engineering types with vectors conventions#94
Merged
Conversation
…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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




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, andSemitonesmove fromktsu.Semanticstoktsu.Semantics.Quantities, alongside every other quantity type.One
RatioThe audio module shipped its own
Ratio<T>struct, shadowing the generated DimensionlessRatio<T>. The audio struct is deleted and the generated type becomes the single ratio currency:Decibels.ToPower(), theCents/Semitonesfrequency-ratio conversions, andPercent.FromRatio/ToRationow exchange the generatedRatio<T>.Dimensionless × Dimensionlessrelationship indimensions.jsongeneratesRatio × Ratio => Ratio(andSignedRatio × Ratio => SignedRatiofor free), preserving the multiplication the audio struct used to provide. Same-type division yields the raw storage value, consistent with every other quantity.Ratiois 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
AudioEngineeringTestsrewired for the newRatioplumbing, plus a new test pinning that ratio arithmetic comes from the generator.https://claude.ai/code/session_01AUgbNJjDBDCwcbUfPK3pGW
Generated by Claude Code