xenpaper
xenpaper copied to clipboard
Implement retunable primes
Implements #62 using the following syntax:
(primes: <a> <b> <c> ...)
Where a b c ... are interval tunings of consecutive primes 2/1, 3/1, 5/1, 7/1, 11/1, etc...
The example below will play
- 2*2 / 2*2: rootHz
- 5 / 2*2: 51 steps of 22 edo above rootHz, minus (2/1) x (2/1) = 7 steps of 22 edo (down major third)
- 3*2 / 2*2: 1900c above rootHz plus (2/1) minus (2/1)x(2/1) = 700c (7 steps of 12 edo perfect fifth)
- 7 / 2*2: 87 steps of 31 edo above rootHz, minus 4/1 = 25 steps of 31 edo (augmented 6th)
(primes: 2/1 1900c 51\22 87\31) 4:5:6:7
the primes: token is implemented as a Setter under the type SetPrimes, so it can be chained together with other setters in a SetterGroup, e.g. (primes: 12\12 19\12 28\12 34\12; osc:square8) 4:5:6:7
More examples and details are written in the 'info' tab. A simple parsing test was added to grammar.test.ts under 'should parse sequence with primes tuning setter'.
Additional fixes:
- Fix invalid ratios causing browser freeze
- Improve generalized pitchDegreeWrap and ratioWrap calculations
Tested & ready for review @dxinteractive
Hey @euwbah - I'm so sorry I missed this for so long! Thank you for putting all this effort in, including basic housekeeping that I haven't got around to. I'll review and leave some comments, but for the most part it looks great!