Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

musical-ratios

ALMaclaine13MIT0.0.10TypeScript support: included

A collection of musical ratios for use in music applications or building modular scale responsive systems.

Musical, Ratios, Modular, Scale, Rhythm, Typography, Responsive

readme

w# musical-ratios

A collection of musical ratios for use in music applications or building modular scale responsive systems.

API

export enum MusicalRatios {
  Unison = 1.00,
  MinorSecond = 1.067,
  MajorSecond = 1.125,
  MinorThird = 1.200,
  MajorThird = 1.250,
  PerfectFourth = 1.333,
  DiminishedFifth = 1.400,
  AugmentedFourth = 1.414,
  PerfectFifth = 1.500,
  MinorSixth = 1.600,
  GoldenRatio = 1.618,
  MajorSixth = 1.667,
  MinorSeventh = 1.750,
  MajorSeventh = 1.875,
  Octave = 2.000
}
export function ratioToPower(ratio: MusicalRatios | number, power: number) {
  return Math.pow(ratio, power);
}

changelog

Changelog