How to use the tonal-pitches.isIvlPitch 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-distances / dist / index.js View on Github external
function transpose(a, b) {
  if (arguments.length === 1) return function (b) {
    return transpose(a, b);
  };
  var pa = tonalPitches.asPitch(a);
  var pb = tonalPitches.asPitch(b);
  var r = tonalPitches.isIvlPitch(pa) ? trBy(pa, pb) : tonalPitches.isIvlPitch(pb) ? trBy(pb, pa) : null;
  return a === pa && b === pb ? r : tonalPitches.toPitchStr(r);
}
github tonaljs / tonal / packages / tonal-distances / lib / index.js View on Github external
export function transpose (a, b) {
  if (arguments.length === 1) return (b) => transpose(a, b)
  const pa = asPitch(a)
  const pb = asPitch(b)
  const r = isIvlPitch(pa) ? trBy(pa, pb)
    : isIvlPitch(pb) ? trBy(pb, pa) : null
  return a === pa && b === pb ? r : toPitchStr(r)
}
github tonaljs / tonal / packages / tonal-distances / lib / index.js View on Github external
export function transpose (a, b) {
  if (arguments.length === 1) return (b) => transpose(a, b)
  const pa = asPitch(a)
  const pb = asPitch(b)
  const r = isIvlPitch(pa) ? trBy(pa, pb)
    : isIvlPitch(pb) ? trBy(pb, pa) : null
  return a === pa && b === pb ? r : toPitchStr(r)
}