Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
filter.midi = function (fn, midi) {
if (arguments.length === 1) return function (m) { return filter.midi(fn, m) }
fn = filterFn(fn)
var midiNotes = gamut.split(midi).map(note)
return gamut.reduce(function (notes, n) {
if (fn(n)) notes.push(n)
else if (fn(prevEnh(n))) notes.push(prevEnh(n))
else if (fn(nextEnh(n))) notes.push(nextEnh(n))
return notes
}, [], midiNotes)
}