1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1× 1× 10× | var note = require('../note/parse') var interval = require('../interval/parse') /** * Convert a note or interval string to a [pitch in coord notation]() * * @name pitch.parse * @function * @param {String} pitch - the note or interval to parse * @return {Array} the pitch in array notation * * @example * var parse = require('music-notation/pitch/parse') * parse('C2') // => [0, 2, null] * parse('5P') // => [1, 0] */ module.exports = function (n) { return note(n) || interval(n) } |