{"version":3,"file":"index.mjs","names":["roman"],"sources":["../index.ts"],"sourcesContent":["import { transpose, transposeFifths } from \"@tonaljs/note\";\nimport { accToAlt, altToAcc, note } from \"@tonaljs/pitch-note\";\nimport { get as roman } from \"@tonaljs/roman-numeral\";\n\nconst Empty: readonly string[] = Object.freeze([] as string[]);\n\nexport interface Key {\n  readonly type: \"major\" | \"minor\";\n  /** The tonic pitch class, like \"F\". Empty for an invalid key. */\n  readonly tonic: string;\n  /** Number of accidentals in the key signature: positive for sharps, negative for flats. */\n  readonly alteration: number;\n  /** The key signature as accidentals: \"\" (none), \"bb\" (two flats), \"###\" (three sharps). */\n  readonly keySignature: string;\n}\n\nconst NoKey: Key = {\n  type: \"major\",\n  tonic: \"\",\n  alteration: 0,\n  keySignature: \"\",\n};\n\nexport interface KeyScale {\n  readonly tonic: string;\n  /** Roman numeral of each degree, like [\"I\", \"II\", \"bIII\", ...]. */\n  readonly grades: readonly string[];\n  /** Interval from the tonic to each degree, like [\"1P\", \"2M\", \"3M\", ...]. */\n  readonly intervals: readonly string[];\n  /** Notes of the scale, one per degree. */\n  readonly scale: readonly string[];\n  /** Triad of each degree, like [\"F\", \"Gm\", \"Am\", ...]. */\n  readonly triads: readonly string[];\n  /** Seventh chord of each degree, like [\"Fmaj7\", \"Gm7\", ...]. */\n  readonly chords: readonly string[];\n  /** Harmonic function of each chord: \"T\" (tonic), \"SD\" (subdominant) or \"D\" (dominant). Empty string if none. */\n  readonly chordsHarmonicFunction: readonly string[];\n  /** Scale that fits each chord, like [\"F major\", \"G dorian\", ...]. */\n  readonly chordScales: readonly string[];\n  /** Dominant seventh chord that resolves to each degree (\"\" if the degree has none), like [\"\", \"D7\", \"E7\", ...] for F major. */\n  readonly secondaryDominants: readonly string[];\n  /** The ii chord that precedes each secondary dominant (\"\" if none): a minor seventh, or a half-diminished chord when the target is minor. */\n  readonly secondaryDominantSupertonics: readonly string[];\n  /** Tritone substitution of each secondary dominant (\"\" if none): the dominant seventh a tritone away. */\n  readonly substituteDominants: readonly string[];\n  /** The minor seventh ii chord that precedes each substitute dominant (\"\" if none). */\n  readonly substituteDominantSupertonics: readonly string[];\n\n  /** @deprecated use secondaryDominantSupertonics */\n  readonly secondaryDominantsMinorRelative: readonly string[];\n  /** @deprecated use substituteDominantSupertonics */\n  readonly substituteDominantsMinorRelative: readonly string[];\n}\n\nconst NoKeyScale: KeyScale = {\n  tonic: \"\",\n  grades: Empty,\n  intervals: Empty,\n  scale: Empty,\n  triads: Empty,\n  chords: Empty,\n  chordsHarmonicFunction: Empty,\n  chordScales: Empty,\n  secondaryDominants: Empty,\n  secondaryDominantSupertonics: Empty,\n  substituteDominantsMinorRelative: Empty,\n  substituteDominants: Empty,\n  substituteDominantSupertonics: Empty,\n  secondaryDominantsMinorRelative: Empty,\n};\n\nexport interface MajorKey extends Key, KeyScale {\n  readonly type: \"major\";\n  /** Tonic of the relative minor key, like \"D\" for \"F\". */\n  readonly minorRelative: string;\n  readonly scale: readonly string[];\n  readonly substituteDominants: readonly string[];\n  readonly secondaryDominantSupertonics: readonly string[];\n  /** @deprecated use substituteDominantSupertonics */\n  readonly substituteDominantsMinorRelative: readonly string[];\n}\n\nconst NoMajorKey: MajorKey = {\n  ...NoKey,\n  ...NoKeyScale,\n  type: \"major\",\n  minorRelative: \"\",\n  scale: Empty,\n  substituteDominants: Empty,\n  secondaryDominantSupertonics: Empty,\n  substituteDominantsMinorRelative: Empty,\n};\n\nexport interface MinorKey extends Key {\n  readonly type: \"minor\";\n  /** Tonic of the relative major key, like \"C\" for \"A\". */\n  readonly relativeMajor: string;\n  /** Natural minor (aeolian) scale and its chords. */\n  readonly natural: KeyScale;\n  /** Harmonic minor scale and its chords. */\n  readonly harmonic: KeyScale;\n  /** Melodic minor (ascending) scale and its chords. */\n  readonly melodic: KeyScale;\n}\n\nconst NoMinorKey: MinorKey = {\n  ...NoKey,\n  type: \"minor\",\n  relativeMajor: \"\",\n  natural: NoKeyScale,\n  harmonic: NoKeyScale,\n  melodic: NoKeyScale,\n};\n\nexport type KeyChord = {\n  /** Chord symbol, like \"Dm7\". */\n  name: string;\n  /** Functions the chord plays in the key: \"T\", \"SD\", \"D\", or \"V/II\", \"ii/V\", \"subV/II\", \"subii/II\" for secondary and substitute dominants. */\n  roles: string[];\n};\n\nconst mapScaleToType = (scale: string[], list: string[], sep = \"\") =>\n  list.map((type, i) => `${scale[i]}${sep}${type}`);\n\nfunction keyScale(\n  grades: string[],\n  triads: string[],\n  chordTypes: string[],\n  harmonicFunctions: string[],\n  chordScales: string[],\n) {\n  return (tonic: string): KeyScale => {\n    const intervals = grades.map((gr) => roman(gr).interval || \"\");\n    const scale = intervals.map((interval) => transpose(tonic, interval));\n    const chords = mapScaleToType(scale, chordTypes);\n    const secondaryDominants = scale\n      .map((note) => transpose(note, \"5P\"))\n      .map((note) =>\n        // A secondary dominant is a V chord which:\n        // 1. is not diatonic to the key,\n        // 2. it must have a diatonic root.\n        scale.includes(note) && !chords.includes(note + \"7\") ? note + \"7\" : \"\",\n      );\n\n    const secondaryDominantSupertonics = supertonics(\n      secondaryDominants,\n      triads,\n    );\n    const substituteDominants = secondaryDominants.map((chord) => {\n      if (!chord) return \"\";\n      const domRoot = chord.slice(0, -1);\n      const subRoot = transpose(domRoot, \"5d\");\n      return subRoot + \"7\";\n    });\n    const substituteDominantSupertonics =\n      substituteSupertonics(substituteDominants);\n\n    return {\n      tonic,\n      grades,\n      intervals,\n      scale,\n      triads: mapScaleToType(scale, triads),\n      chords,\n      chordsHarmonicFunction: harmonicFunctions.slice(),\n      chordScales: mapScaleToType(scale, chordScales, \" \"),\n      secondaryDominants,\n      secondaryDominantSupertonics,\n      substituteDominants,\n      substituteDominantSupertonics,\n\n      // deprecated aliases\n      secondaryDominantsMinorRelative: secondaryDominantSupertonics,\n      substituteDominantsMinorRelative: substituteDominantSupertonics,\n    };\n  };\n}\n\n// The root of the ii chord of a dominant: a fifth above its root\nconst supertonicRoot = (dominant: string) =>\n  transpose(dominant.slice(0, -1), \"5P\");\n\n// The ii of a secondary dominant takes its quality from the target: a ii-V\n// into a minor or diminished chord uses a half-diminished ii (Em7b5 A7 Dm),\n// and into a major or augmented chord a minor seventh ii (Gm7 C7 F)\nconst supertonics = (dominants: string[], targetTriads: string[]) =>\n  dominants.map((chord, index) => {\n    if (!chord) return \"\";\n    const target = targetTriads[index];\n    const isMinor = target === \"m\" || target === \"dim\";\n    return supertonicRoot(chord) + (isMinor ? \"m7b5\" : \"m7\");\n  });\n\n// A substitute dominant doesn't resolve to the key it points to (Eb7 resolves\n// to Dm, not Ab), so its ii is always a minor seventh: Bbm7 Eb7 Dm\nconst substituteSupertonics = (dominants: string[]) =>\n  dominants.map((chord) => (chord ? supertonicRoot(chord) + \"m7\" : \"\"));\n\nconst distInFifths = (from: string, to: string) => {\n  const f = note(from);\n  const t = note(to);\n  return f.empty || t.empty ? 0 : t.coord[0] - f.coord[0];\n};\n\nconst MajorScale = keyScale(\n  \"I II III IV V VI VII\".split(\" \"),\n  \" m m   m dim\".split(\" \"),\n  \"maj7 m7 m7 maj7 7 m7 m7b5\".split(\" \"),\n  \"T SD T SD D T D\".split(\" \"),\n  \"major,dorian,phrygian,lydian,mixolydian,minor,locrian\".split(\",\"),\n);\nconst NaturalScale = keyScale(\n  \"I II bIII IV V bVI bVII\".split(\" \"),\n  \"m dim  m m  \".split(\" \"),\n  \"m7 m7b5 maj7 m7 m7 maj7 7\".split(\" \"),\n  \"T SD T SD D SD SD\".split(\" \"),\n  \"minor,locrian,major,dorian,phrygian,lydian,mixolydian\".split(\",\"),\n);\nconst HarmonicScale = keyScale(\n  \"I II bIII IV V bVI VII\".split(\" \"),\n  \"m dim aug m   dim\".split(\" \"),\n  \"mMaj7 m7b5 +maj7 m7 7 maj7 o7\".split(\" \"),\n  \"T SD T SD D SD D\".split(\" \"),\n  \"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian\".split(\n    \",\",\n  ),\n);\nconst MelodicScale = keyScale(\n  \"I II bIII IV V VI VII\".split(\" \"),\n  \"m m aug   dim dim\".split(\" \"),\n  \"m6 m7 +maj7 7 7 m7b5 m7b5\".split(\" \"),\n  \"T SD T SD D  \".split(\" \"),\n  \"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered\".split(\n    \",\",\n  ),\n);\n\n/**\n * Get a major key: its signature, scale, triads, seventh chords, harmonic\n * functions and secondary and substitute dominants. For an invalid tonic\n * it returns a key with empty strings and arrays.\n *\n * @param tonic - the tonic note or pitch class, like \"F\" or \"Bb\"\n * @example\n * Key.majorKey(\"F\").scale; // => [\"F\", \"G\", \"A\", \"Bb\", \"C\", \"D\", \"E\"]\n * Key.majorKey(\"F\").chords; // => [\"Fmaj7\", \"Gm7\", \"Am7\", \"Bbmaj7\", \"C7\", \"Dm7\", \"Em7b5\"]\n * Key.majorKey(\"F\").keySignature; // => \"b\"\n */\nexport function majorKey(tonic: string): MajorKey {\n  const pc = note(tonic).pc;\n  if (!pc) return NoMajorKey;\n\n  const keyScale = MajorScale(pc);\n  const alteration = distInFifths(\"C\", pc);\n\n  return {\n    ...keyScale,\n    type: \"major\",\n    minorRelative: transpose(pc, \"-3m\"),\n    alteration,\n    keySignature: altToAcc(alteration),\n  };\n}\n\n/**\n * Get the chords available in a major key, each with the roles it plays:\n * diatonic chords (\"T\", \"SD\", \"D\") and secondary and substitute dominants\n * with their supertonics (\"V/II\", \"ii/V\", \"subV/II\"...). Returns an empty\n * array for an invalid tonic.\n *\n * @param tonic - the tonic note or pitch class, like \"C\"\n * @returns array of { name: string, roles: string[] }\n * @example\n * Key.majorKeyChords(\"C\").slice(0, 3); // => [{ name: \"Cmaj7\", roles: [\"T\"] }, { name: \"Dm7\", roles: [\"SD\"] }, { name: \"Em7\", roles: [\"T\"] }]\n */\nexport function majorKeyChords(tonic: string): KeyChord[] {\n  const key = majorKey(tonic);\n  const chords: KeyChord[] = [];\n  keyChordsOf(key, chords);\n  return chords;\n}\n\n/**\n * Get the chords available in a minor key, each with the roles it plays. It\n * merges the chords of the natural, harmonic and melodic scales, so a chord\n * that appears in several scales has all its roles. Returns an empty array\n * for an invalid tonic.\n *\n * @param tonic - the tonic note or pitch class, like \"A\"\n * @returns array of { name: string, roles: string[] }\n * @example\n * Key.minorKeyChords(\"A\").slice(0, 2); // => [{ name: \"Am7\", roles: [\"T\", \"ii/bVII\"] }, { name: \"Bm7b5\", roles: [\"SD\", \"ii/I\"] }]\n */\nexport function minorKeyChords(tonic: string): KeyChord[] {\n  const key = minorKey(tonic);\n  const chords: KeyChord[] = [];\n  keyChordsOf(key.natural, chords);\n  keyChordsOf(key.harmonic, chords);\n  keyChordsOf(key.melodic, chords);\n  return chords;\n}\n\nfunction keyChordsOf(key: KeyScale, chords: KeyChord[]) {\n  const updateChord = (name: string, newRole: string) => {\n    if (!name) return;\n    let keyChord = chords.find((chord) => chord.name === name);\n    if (!keyChord) {\n      keyChord = { name, roles: [] };\n      chords.push(keyChord);\n    }\n    if (newRole && !keyChord.roles.includes(newRole)) {\n      keyChord.roles.push(newRole);\n    }\n  };\n\n  key.chords.forEach((chordName, index) =>\n    updateChord(chordName, key.chordsHarmonicFunction[index]),\n  );\n  key.secondaryDominants.forEach((chordName, index) =>\n    updateChord(chordName, `V/${key.grades[index]}`),\n  );\n  key.secondaryDominantSupertonics.forEach((chordName, index) =>\n    updateChord(chordName, `ii/${key.grades[index]}`),\n  );\n  key.substituteDominants.forEach((chordName, index) =>\n    updateChord(chordName, `subV/${key.grades[index]}`),\n  );\n  key.substituteDominantSupertonics.forEach((chordName, index) =>\n    updateChord(chordName, `subii/${key.grades[index]}`),\n  );\n}\n\n/**\n * Get a minor key: its signature, relative major and the scale, chords and\n * dominants of its natural, harmonic and melodic forms. For an invalid tonic\n * it returns a key with empty strings and arrays.\n *\n * @param tnc - the tonic note or pitch class, like \"A\"\n * @example\n * Key.minorKey(\"A\").relativeMajor; // => \"C\"\n * Key.minorKey(\"A\").harmonic.scale; // => [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G#\"]\n * Key.minorKey(\"A\").natural.chords; // => [\"Am7\", \"Bm7b5\", \"Cmaj7\", \"Dm7\", \"Em7\", \"Fmaj7\", \"G7\"]\n */\nexport function minorKey(tnc: string): MinorKey {\n  const pc = note(tnc).pc;\n  if (!pc) return NoMinorKey;\n\n  const alteration = distInFifths(\"C\", pc) - 3;\n  return {\n    type: \"minor\",\n    tonic: pc,\n    relativeMajor: transpose(pc, \"3m\"),\n    alteration,\n    keySignature: altToAcc(alteration),\n    natural: NaturalScale(pc),\n    harmonic: HarmonicScale(pc),\n    melodic: MelodicScale(pc),\n  };\n}\n\n/**\n * Get the tonic of the major key with the given key signature, or null if\n * the signature is not valid.\n *\n * @param sig - accidentals (\"\", \"bb\", \"###\") or a number of fifths (positive for sharps, negative for flats)\n * @example\n * Key.majorTonicFromKeySignature(\"###\"); // => \"A\"\n * Key.majorTonicFromKeySignature(-2); // => \"Bb\"\n * Key.majorTonicFromKeySignature(\"\"); // => \"C\"\n */\nexport function majorTonicFromKeySignature(\n  sig: string | number,\n): string | null {\n  if (typeof sig === \"number\") {\n    return transposeFifths(\"C\", sig);\n  } else if (typeof sig === \"string\" && /^(b*|#*)$/.test(sig)) {\n    return transposeFifths(\"C\", accToAlt(sig));\n  }\n  return null;\n}\n\n/** @deprecated Use the named exports instead. */\nexport default { majorKey, majorTonicFromKeySignature, minorKey };\n"],"mappings":";;;;AAIA,MAAM,QAA2B,OAAO,OAAO,CAAC,CAAa;AAY7D,MAAM,QAAa;CACjB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,cAAc;AAChB;AAiCA,MAAM,aAAuB;CAC3B,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,wBAAwB;CACxB,aAAa;CACb,oBAAoB;CACpB,8BAA8B;CAC9B,kCAAkC;CAClC,qBAAqB;CACrB,+BAA+B;CAC/B,iCAAiC;AACnC;AAaA,MAAM,aAAuB;CAC3B,GAAG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