char-slop/chordpad.vibed.software

git clone https://git.t4t.associates/char-slop/chordpad.vibed.software

Charlotte Somwheel of fifths mate844055b

main
406 B9 linesraw
1import { type Analysis, origin } from "../theory/analysis.ts";
2
3/** the class that colours a chord by where it comes from, relative to the key */
4export function originClass(a: Analysis | undefined): string {
5  const from = a && origin(a);
6  if (from === "home" || from === "sharp" || from === "flat" || from === "inverse")
7    return `on-${from}`;
8  return from ? `from-${from}` : a ? "chromatic" : "";
9}