array-notation
Advanced tools
Comparing version 1.0.0 to 1.0.1
36
API.md
@@ -138,2 +138,32 @@ ## `interval.parse` | ||
## `operation` | ||
Decorate a function to work with intervals, notes or pitches in | ||
[array notation](https://github.com/danigb/tonal/tree/next/packages/array-notation) | ||
with independence of string representations. | ||
This is the base of the pluggable notation system of | ||
[tonal](https://github.com/danigb/tonal) | ||
### Parameters | ||
* `parse` **`Function`** the parser | ||
* `str` **`Function`** the string builder | ||
* `op` **`Function`** the operation to decorate | ||
### Examples | ||
```js | ||
var operation = require('array-notation/operation') | ||
var parse = require('array-notation/interval/parse') | ||
var str = require('array-notation/interval/str') | ||
var add = operation(parse, str, function(a, b) { | ||
return [a[0] + b[0], a[1] + b[1]] | ||
}) | ||
add('3m', '3M') // => '5P' | ||
``` | ||
## `pitch.parse` | ||
@@ -184,6 +214,6 @@ | ||
## `roman.memoize` | ||
## `roman.parse` | ||
Roman to coordinate: convert from [roman numerals](https://en.wikipedia.org/wiki/Roman_numeral_analysis) | ||
to [pitch coordinates]() | ||
to [array-notation]() | ||
@@ -198,3 +228,3 @@ ### Parameters | ||
```js | ||
var parse = require('array-notation/roman.memoize') | ||
var parse = require('array-notation/roman.parse') | ||
parse('V') // => [1] | ||
@@ -201,0 +231,0 @@ parse('bII') // => [-5] |
var A = {} | ||
var A = require('./operation') | ||
A.note = function (n) { A.note.str(A.note.parse(n)) } | ||
@@ -4,0 +4,0 @@ A.note.regex = require('./note/regex') |
{ | ||
"name": "array-notation", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convert music elements to array notation", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "npm test && npm run coverage && npm run docs && npm run disc && npm run dist", | ||
"test": "mocha", | ||
"docs": "documentation -f md > API.md" | ||
"docs": "documentation -f md *.js > API.md", | ||
"dist": "browserify index.js | uglifyjs > tmp/music-gamut.min.js&& ls -hall tmp/", | ||
"disc": "browserify --full-paths index.js | uglifyjs | discify > tmp/disc.html", | ||
"coverage": "istanbul cover _mocha" | ||
}, | ||
"repository": "https://github.com/danigb/tonal/tree/next/packages/array-notation", | ||
"repository": "https://github.com/danigb/tonal/tree/master/packages/array-notation", | ||
"bugs": { | ||
@@ -12,0 +15,0 @@ "url": "https://github.com/danigb/tonal/issues" |
@@ -7,4 +7,28 @@ # array-notation [![npm version](https://img.shields.io/npm/v/array-notation.svg)](https://www.npmjs.com/package/array-notation) | ||
## Features | ||
- Parse notes and pitch classes | ||
- Parse intervals in short hand notation | ||
- Parse roman numerals | ||
- Parse pitched elements (scales, chords, keys) | ||
## Install | ||
Via npm only: `npm install --save array-notation` | ||
It's important to notice that you can __NOT__ require the whole library. Instead, you must require the functions you will use. | ||
## Usage | ||
You can parse notes to array notation with the `note/parse` function: | ||
```js | ||
var parse = require('array-notation/note/parse') | ||
parse('C2') // => [0, 2, null] | ||
``` | ||
Read the [API documentation](https://github.com/danigb/tonal/blob/next/packages/array-notation/API.md) to see all the available functions. | ||
## License | ||
MIT License |
@@ -11,5 +11,5 @@ 'use strict' | ||
* Roman to coordinate: convert from [roman numerals](https://en.wikipedia.org/wiki/Roman_numeral_analysis) | ||
* to [pitch coordinates]() | ||
* to [array-notation]() | ||
* | ||
* @name roman.memoize | ||
* @name roman.parse | ||
* @function | ||
@@ -20,3 +20,3 @@ * @param {String} str - the roman numeral string | ||
* @example | ||
* var parse = require('array-notation/roman.memoize') | ||
* var parse = require('array-notation/roman.parse') | ||
* parse('V') // => [1] | ||
@@ -23,0 +23,0 @@ * parse('bII') // => [-5] |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
429541
47
810
34
2
3