Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return intervals.reduce((semitones, interval) => {
return semitones + Math.abs(Interval.semitones(interval))
}, 0);
}
export function isInterval(interval) {
return typeof Interval.semitones(interval) === 'number';
}
/** Returns interval from step */
return intervals.reduce((min, current) => {
if (!min || Interval.semitones(current) < Interval.semitones(min)) {
return current;
}
return min;
});
}
return intervals.reduce((semitones, interval) => {
return semitones + Math.abs(Interval.semitones(interval))
}, 0);
}
export function isInterval(interval) {
return typeof Interval.semitones(interval) === 'number';
}
export function semitoneDistance(noteA, noteB) {
return Interval.semitones(Distance.interval(noteA, noteB) + '');
}
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))
}
return intervals.reduce((semitones, interval) => {
return semitones + Interval.semitones(interval)
}, 0);
}