How to use the tonal.Interval.semitones function in tonal

To help you get started, we’ve selected a few tonal 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 felixroos / harmonical / src / util.ts View on Github external
return intervals.reduce((semitones, interval) => {
    return semitones + Math.abs(Interval.semitones(interval))
  }, 0);
}
github felixroos / harmonical / src / util.ts View on Github external
export function isInterval(interval) {
  return typeof Interval.semitones(interval) === 'number';
}
/** Returns interval from step */
github felixroos / harmonical / src / util_old.ts View on Github external
return intervals.reduce((min, current) => {
    if (!min || Interval.semitones(current) < Interval.semitones(min)) {
      return current;
    }
    return min;
  });
}
github felixroos / harmonical / src / util_old.ts View on Github external
return intervals.reduce((semitones, interval) => {
    return semitones + Math.abs(Interval.semitones(interval))
  }, 0);
}
github felixroos / harmonical / src / util_old.ts View on Github external
export function isInterval(interval) {
  return typeof Interval.semitones(interval) === 'number';
}
github felixroos / harmonical / src / util_old.ts View on Github external
export function semitoneDistance(noteA, noteB) {
  return Interval.semitones(Distance.interval(noteA, noteB) + '');
}
github felixroos / harmonical / src / util.ts View on Github external
export function noteArray(range) {
  const slots = Interval.semitones(Distance.interval(range[0], range[1]) + '');
  return new Array(slots + 1)
    .fill('')
    .map((v, i) => Distance.transpose(range[0], Interval.fromSemitones(i)) + '')
    .map(n => Note.simplify(n))
}
github felixroos / harmonical / src / util.ts View on Github external
return intervals.reduce((semitones, interval) => {
    return semitones + Interval.semitones(interval)
  }, 0);
}