Add similar scales analysis tab - #984
Conversation
| isFetching.value = true | ||
| fetchError.value = null | ||
| try { | ||
| const response = await fetch(SCALE_CENTS_URL) |
There was a problem hiding this comment.
This is not OK. We absolutely cannot add an unvetted dynamic dependency. Publish your library on npm and pull a versioned copy from there.
There was a problem hiding this comment.
Sorry about that! I've published scale-cents.json as an npm package and pulled it from jsDelivr now.
| }) | ||
|
|
||
| describe('Maximum nearest-note distance', () => { | ||
| it('finds zero distance for a child which is a subset of the parent', () => { |
There was a problem hiding this comment.
Scale Workshop tries to follow XenWiki naming-conventions. Your parent-child-relationship is inverted compared to https://en.xen.wiki/w/MOS_scale_family_tree .
There was a problem hiding this comment.
I was thinking of the general sense of 'larger parent containing smaller child' - does that make sense? In fact the tables aren't about MOS; they're about general scales where one approximately contains the other.
There was a problem hiding this comment.
It's about tree-relationships. One small scale begets many larger scales.
There was a problem hiding this comment.
Thanks, I see what you mean - I've swapped parent/child now. Also I've swapped them on scalelibrary.org too, so everything will be consistent.
|
Please indicate external links with that rounded square with a northeast-pointing arrow or at least an unicode link symbol. Add yourself to the About page. After swapping parent/child naming, this should be good for a QA deployment. We'll let people test it for a week over at https://sw3.lumipakkanen.com/ before merging and deploying to production. |
|
That sounds great - thanks very much! I've added unicode link symbols for the external links, added myself to the About page, and swapped parent/child naming. Thanks for all your help! |
|
Deployed to https://sw3.lumipakkanen.com/ for testing. |
| import { computeSimilarScales, type LibraryScale, type SimilarResult } from '@/similar-scales' | ||
|
|
||
| const SCALE_CENTS_URL = | ||
| 'https://cdn.jsdelivr.net/npm/@narenratan/scale-library@1.3.0/scale-cents.json' |
There was a problem hiding this comment.
It would make more sense to have the dependency listed in package.json. I can host the data inside our distribution once it's pulled from a versioned package. Just don't want a dynamic dependency that's impossible to control or verify.
There was a problem hiding this comment.
Thanks, I've added the dependency in package.json and updated SCALE_CENTS_URL to use it.
| :href="`https://scalelibrary.org/scales/${entry.stem}/`" | ||
| target="_blank" | ||
| rel="noopener" | ||
| >{{ stemBasename(entry.stem) }} 🔗</a |
There was a problem hiding this comment.
The link underline doesn't usually extend to the external link icon. You probably want to style this as an after pseudo element.
| :href="`https://scalelibrary.org/scales/${entry.stem}/`" | ||
| target="_blank" | ||
| rel="noopener" | ||
| >{{ stemBasename(entry.stem) }} 🔗</a |
There was a problem hiding this comment.
Use a dedicated CSS class so that the link icon doesn't need to be repeated inline.
There was a problem hiding this comment.
I've used a CSS class for this now.
|
Looking good! |
|
Got positive feedback from QA testing. Giving the code a final glance and merging. |
I've been working on scalelibrary.org, a library of microtonal scales with sources attributed, and I've found the tables of similar, parent, and child scales super interesting (for example on this scale page). I thought it might be interesting to show these tables in Scale Workshop - I got something working so I thought I'd make a PR to at least have something concrete to talk about. I've attached a screenshot (there's a Child scales table off-screen).