j5v / xetune

Experimental visualiser and basic editor for multiple microtonal tunings.
https://johnvalentine.co.uk/app/xetune/app.html
MIT License
5 stars 0 forks source link

Generated ED tunings don't cover required ranges #25

Open j5v opened 1 year ago

j5v commented 1 year ago

Fix: For ED or generated repeating tunings, dynamically infer notes outside the explicitly defined range 0 .. Repeat ratio. Don't overwrite user-customized notes. Indicate inferred notes in the UI.

Background

Most tunings are cyclic, defined explicitly over a Repeat ratio. Any notes outside the explicit range should be inferred for display and analysis.

Currently for ED tunings, we generate notes in the range -1 octaves .. +3 octaves, and export only the range -1 to , inclusive. While this works for most scenarios, it can be tricky to infer the provenance of individual notes (especially after editing), and we currently don't properly cover the display range for all sensible Repeat ratio values.

We already set tunings[].notes[].isDefined, but need some analysis about the instantiation of implied 'ghost' notes for on-demand drawing and UI interactions, and whether they should persist in the tunings[].notes[] array - and if so, do we use tunings[].notes[].isDefined to distinguish explicit from implicit notes?

Suggestion

Whenever view parameters change (e.g. zoom bounds on the tuning rows, or analysis), expand/re-generate notes, setting .isDefined = false. This needs a function to solve boundary frequency or count limits for scale generation.

j5v commented 1 year ago

TBC: solve n, for x=y^(n/m) n = (m log(x))/log(y)