Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ic(ivl) {
var s = typeof ivl === 'string' ? tonalPitches.chroma(ivl) : Math.round(ivl);
return s !== null ? CLASSES[Math.abs(s) % 12] : null;
}
export const density = listFn((list) => {
var a, b, i
const notes = list.filter(isPitchNotIvl)
const len = notes.length
const result = [0, 0, 0, 0, 0, 0]
for (a = 0; a < len; a++) {
for (b = a; b < len; b++) {
i = ic(chroma(notes[b]) - chroma(notes[a]))
if (i === 6) result[5] = result[5] + 1
else if (i > 0) result[5 - i] = result[5 - i] + 1
}
}
return result
})
export function ic (ivl) {
const s = typeof ivl === 'string' ? chroma(ivl) : Math.round(ivl)
return s !== null ? CLASSES[Math.abs(s) % 12] : null
}
var density = tonalArrays.listFn(function (list) {
var a, b, i;
var notes = list.filter(tonalPitches.isPitchNotIvl);
var len = notes.length;
var result = [0, 0, 0, 0, 0, 0];
for (a = 0; a < len; a++) {
for (b = a; b < len; b++) {
i = ic(tonalPitches.chroma(notes[b]) - tonalPitches.chroma(notes[a]));
if (i === 6) result[5] = result[5] + 1;else if (i > 0) result[5 - i] = result[5 - i] + 1;
}
}
return result;
});