Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return s.map(function (n, i) {
return G.rotate(i, s)
})
}
module.exports = function triads (notes, size, grade, tonic) {
if (arguments.length === 2) return function (g, t) { return triads(notes, size, g, t) }
var set = pitchSet(notes, false).map(interval)
var g = roman(grade)
var index = selectGrade(g, set)
if (!index) return null
var scale = gamut.rotate(1, set.map(transpose(inv(set[index]))))
var grades = scale.reduce(function (g, ivl) {
var grade = props(ivl)[0]
g[grade] = ivl
return g
}, {})
return [1, 3, 5, 7].map(function (i) { return grades[i - 1] }).map(transpose(tonic))
}