Build, search, and play chords.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
1.7 KiB

  1. export enum Interval {
  2. UNISON,
  3. MINOR_SECOND,
  4. MAJOR_SECOND,
  5. MINOR_THIRD,
  6. MAJOR_THIRD,
  7. PERFECT_FOURTH,
  8. DIMINISHED_FIFTH,
  9. PERFECT_FIFTH,
  10. AUGMENTED_FIFTH,
  11. MAJOR_SIXTH,
  12. DIMINISHED_SEVENTH = MAJOR_SIXTH,
  13. MINOR_SEVENTH,
  14. MAJOR_SEVENTH,
  15. OCTAVE,
  16. MINOR_NINTH,
  17. MAJOR_NINTH,
  18. AUGMENTED_NINTH,
  19. TENTH,
  20. MINOR_ELEVENTH,
  21. MAJOR_ELEVENTH,
  22. TWELFTH,
  23. MINOR_THIRTEENTH,
  24. MAJOR_THIRTEENTH,
  25. AUGMENTED_THIRTEENTH,
  26. }
  27. export enum ChordBase {
  28. MAJOR = 'MAJOR',
  29. MINOR = 'MINOR',
  30. DIMINISHED = 'DIMINISHED',
  31. AUGMENTED = 'AUGMENTED',
  32. }
  33. export enum ChordExtensionType {
  34. MAJOR = 'MAJOR',
  35. MINOR = 'MINOR',
  36. DOMINANT = 'DOMINANT',
  37. DIMINISHED = 'DIMINISHED',
  38. AUGMENTED = 'AUGMENTED',
  39. }
  40. export enum ChordModificationType {
  41. SUSPENDED = 'SUSPENDED',
  42. LOWERED = 'LOWERED',
  43. }
  44. export enum ChordComponent {
  45. ROOT = 'ROOT',
  46. SECOND = 'SECOND',
  47. THIRD = 'THIRD',
  48. FOURTH = 'FOURTH',
  49. FIFTH = 'FIFTH',
  50. SIXTH = 'SIXTH',
  51. SEVENTH = 'SEVENTH',
  52. NINTH = 'NINTH',
  53. ELEVENTH = 'ELEVENTH',
  54. THIRTEENTH = 'THIRTEENTH',
  55. }
  56. export const CHORD_COMPONENT_ORDERS = [
  57. ChordComponent.ROOT,
  58. ChordComponent.SECOND,
  59. ChordComponent.THIRD,
  60. ChordComponent.FOURTH,
  61. ChordComponent.FIFTH,
  62. ChordComponent.SIXTH,
  63. ChordComponent.SEVENTH,
  64. ChordComponent.NINTH,
  65. ChordComponent.ELEVENTH,
  66. ChordComponent.THIRTEENTH,
  67. ];
  68. export interface ChordModification {
  69. type: ChordModificationType;
  70. component: ChordComponent;
  71. }
  72. export interface ChordExtension {
  73. type: ChordExtensionType;
  74. component: ChordComponent;
  75. }
  76. export interface ChordAnalysis {
  77. base?: ChordBase;
  78. modifications?: ChordModification[];
  79. extensions?: ChordExtension[];
  80. omissions?: ChordComponent[];
  81. }