Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function harmonize (source, tonic) {
if (arguments.length === 1) return function (t) { return harmonize(source, t) }
return gamut.transform(function (g) {
if (tonic === null) return g
var base = g[0]
var intervals = g.map(distanceTo(base))
if (tonic === false) return intervals
tonic = parse(tonic)
return intervals.map(transpose(tonic))
}, source)
}
module.exports = function (tonic, progression) {
return gamut.transform(false, progression)
.map(function (e) { return roman.exec(e) })
.map(function (roman) {
if (!roman) return null
var intervl = parse(roman[2])
return transpose(tonic, intervl) + roman[3]
})
}
function sort (comp, source) {
if (arguments.length > 1) return sort(comp)(source)
if (comp === null || comp === true) comp = asc
else if (comp === false) comp = desc
return transform(function (g) { return g.sort(comp) })
}