How to use the tonal-pitches.encode function in tonal-pitches

To help you get started, we’ve selected a few tonal-pitches examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tonaljs / tonal / packages / tonal-progressions / dist / index.js View on Github external
function parseRomanChord(str) {
  var m = ROMAN.exec(str);
  if (!m) return null;
  var num = NUM[m[2].toLowerCase()];
  var alt = m[1].length;
  if (m[1][0] === 'b') alt = -alt;
  return { root: tonalPitches.encode(num, alt, 0, 1), name: m[3] };
}
github tonaljs / tonal / packages / tonal-progressions / lib / index.js View on Github external
function parseRomanChord (str) {
  var m = ROMAN.exec(str)
  if (!m) return null
  var num = NUM[m[2].toLowerCase()]
  var alt = m[1].length
  if (m[1][0] === 'b') alt = -alt
  return { root: encode(num, alt, 0, 1), name: m[3] }
}