xenharmonic-devs / sonic-weave

The SonicWeave DSL for manipulating musical frequencies, ratios and equal temperaments
MIT License
5 stars 4 forks source link

Universal type #214

Closed frostburn closed 7 months ago

frostburn commented 7 months ago

An interchange format would benefit from a single type that can hold any TimeMonzo value. [1 -1 2.345 6 7>@-103/101.U translates to (-103/101) ~* (1s)^(-1) ~* (2.345rc) ~* [6 7>

All fields are mandatory: [1 0 0 -1 1>@1.U is the minimal spelling of 3/2.

Alternatively we could admit negative rationals, s, Hz, c and rc as subgroup basis, and denote a standard prime tail as ...

The first example becomes [1 1 2.345 6 7>@-103/101.Hz.rc.. and interchange consumers are expected to parse [-1 1> for 3/2.

Prime limit syntax (here with wart syntax [without actual warts]) would change from 12@5 to 12@..5 and 13@3..7 would be legal syntax for 13@3.5.7.

Something like 13@3.. would be nice too, but then the slash in the residual part becomes mandatory to disambiguate 420@101.. (101, 103, etc.) from 420@101/1.. (101, 2, 3, 5, etc.).

12@..6 would throw a runtime error.

frostburn commented 7 months ago

Including this in the first release because it would be nice to stabilize prime subgroup syntax.