How to use the music-notation/note/regex.exec function in music-notation

To help you get started, we’ve selected a few music-notation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tonaljs / tonal / packages / music-dictionary / index.js View on Github external
function dict (name, tonic) {
    var data = dict.props(name)
    if (!data) {
      var n = R.exec(name)
      data = n ? dict.props(n[5]) : null
      if (!data) return []
      tonic = tonic === false ? tonic : tonic || n[1] + n[2] + n[3]
    }
    if (typeof tonic === 'undefined') return function (t) { return dict(name, t) }
    return data.intervals.map(transpose(tonic))
  }
  return build(src, dict)
github tonaljs / tonal / packages / music-scale / index.js View on Github external
scale.get = function (name) {
  var p = regex.exec(name)
  return (p && p[5]) ? scale(p[5], p[1] + p[2] + p[3]) : []
}

music-notation

Parse alterations, notes, intervals and other musical elements with differents notations

MIT
Latest version published 9 years ago

Package Health Score

63 / 100
Full package analysis