Example #1
0
export function abstract (chords, tonic) {
  tonic = pc(tonic)
  chords = map(parse, chords)
  var tonics = compact(chords.map(function (x) { return x.tonic }))
  // if some tonic missing, can't do the analysis
  if (tonics.length !== chords.length) return null

  return tonics.map(function (t, i) {
    var p = props(interval(tonic, t))
    return buildRoman(p.num - 1, p.alt, chords[i].type)
  })
}
Example #2
0
 return function (tonic) {
   return compact(map(tr(tonic || 'P1'), list))
 }
Example #3
0
export function harmonics (list) {
  var a = asArr(list)
  return a.length ? compact(a.map(interval(a[0]))) : a
}