tonal-interval
Advanced tools
Comparing version 1.0.0-pre5 to 1.0.0-pre6
@@ -53,3 +53,3 @@ 'use strict'; | ||
* List basic (perfect, major, minor) interval names within a octave | ||
* @param {String} types - (Optional, default "PMm") the valid types | ||
* @param {String} qualities - (Optional, default "PMm") the valid types | ||
* @return {Array} the interval names | ||
@@ -179,15 +179,2 @@ * @example | ||
/** | ||
* Get interval type. Can be perfectable (1, 4, 5) or majorable (2, 3, 6, 7) | ||
* It does NOT return the actual quality. | ||
* | ||
* @function | ||
* @param {String} interval | ||
* @return {String} 'P' for perfectables, 'M' for majorables or null if not | ||
* valid interval | ||
* @example | ||
* interval.type('5A') // => 'P' | ||
*/ | ||
var type = function (str) { return props(str).type; }; | ||
/** | ||
* Get size in semitones of an interval | ||
@@ -344,3 +331,2 @@ * | ||
exports.name = name; | ||
exports.type = type; | ||
exports.semitones = semitones; | ||
@@ -347,0 +333,0 @@ exports.chroma = chroma; |
@@ -49,3 +49,3 @@ /** | ||
* List basic (perfect, major, minor) interval names within a octave | ||
* @param {String} types - (Optional, default "PMm") the valid types | ||
* @param {String} qualities - (Optional, default "PMm") the valid types | ||
* @return {Array} the interval names | ||
@@ -175,15 +175,2 @@ * @example | ||
/** | ||
* Get interval type. Can be perfectable (1, 4, 5) or majorable (2, 3, 6, 7) | ||
* It does NOT return the actual quality. | ||
* | ||
* @function | ||
* @param {String} interval | ||
* @return {String} 'P' for perfectables, 'M' for majorables or null if not | ||
* valid interval | ||
* @example | ||
* interval.type('5A') // => 'P' | ||
*/ | ||
export var type = function (str) { return props(str).type; }; | ||
/** | ||
* Get size in semitones of an interval | ||
@@ -190,0 +177,0 @@ * |
15
index.js
@@ -49,3 +49,3 @@ /** | ||
* List basic (perfect, major, minor) interval names within a octave | ||
* @param {String} types - (Optional, default "PMm") the valid types | ||
* @param {String} qualities - (Optional, default "PMm") the valid types | ||
* @return {Array} the interval names | ||
@@ -176,15 +176,2 @@ * @example | ||
/** | ||
* Get interval type. Can be perfectable (1, 4, 5) or majorable (2, 3, 6, 7) | ||
* It does NOT return the actual quality. | ||
* | ||
* @function | ||
* @param {String} interval | ||
* @return {String} 'P' for perfectables, 'M' for majorables or null if not | ||
* valid interval | ||
* @example | ||
* interval.type('5A') // => 'P' | ||
*/ | ||
export const type = str => props(str).type; | ||
/** | ||
* Get size in semitones of an interval | ||
@@ -191,0 +178,0 @@ * |
{ | ||
"name": "tonal-interval", | ||
"version": "1.0.0-pre5", | ||
"version": "1.0.0-pre6", | ||
"description": "Music interval creation and manipulation", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/danigb/tonal/packages/interval", |
@@ -43,3 +43,2 @@ <a name="module_interval"></a> | ||
* [`.name(interval)`](#module_interval.name) ⇒ <code>String</code> | ||
* [`.type(interval)`](#module_interval.type) ⇒ <code>String</code> | ||
* [`.semitones(ivl)`](#module_interval.semitones) ⇒ <code>Integer</code> | ||
@@ -63,3 +62,3 @@ * [`.chroma(str)`](#module_interval.chroma) ⇒ <code>Number</code> | ||
| --- | --- | --- | | ||
| types | <code>String</code> | (Optional, default "PMm") the valid types | | ||
| qualities | <code>String</code> | (Optional, default "PMm") the valid types | | ||
@@ -134,20 +133,2 @@ **Example** | ||
``` | ||
<a name="module_interval.type"></a> | ||
## `interval.type(interval)` ⇒ <code>String</code> | ||
Get interval type. Can be perfectable (1, 4, 5) or majorable (2, 3, 6, 7) | ||
It does NOT return the actual quality. | ||
**Kind**: static method of [<code>interval</code>](#module_interval) | ||
**Returns**: <code>String</code> - 'P' for perfectables, 'M' for majorables or null if not | ||
valid interval | ||
| Param | Type | | ||
| --- | --- | | ||
| interval | <code>String</code> | | ||
**Example** | ||
```js | ||
interval.type('5A') // => 'P' | ||
``` | ||
<a name="module_interval.semitones"></a> | ||
@@ -154,0 +135,0 @@ |
@@ -127,7 +127,8 @@ var ivl = require("../index"); | ||
test("interval types", () => { | ||
expect($("1P 2M 3M 4P 5P 6M 7M").map(ivl.type)).toEqual($("P M M P P M M")); | ||
expect($("8d 9m 10m 11d 12d 13m 14m").map(ivl.type)).toEqual( | ||
const type = i => ivl.props(i).type; | ||
expect($("1P 2M 3M 4P 5P 6M 7M").map(type)).toEqual($("P M M P P M M")); | ||
expect($("8d 9m 10m 11d 12d 13m 14m").map(type)).toEqual( | ||
$("P M M P P M M") | ||
); | ||
expect($("-15A -16A -17A -18A -19A -20A -21A").map(ivl.type)).toEqual( | ||
expect($("-15A -16A -17A -18A -19A -20A -21A").map(type)).toEqual( | ||
$("P M M P P M M") | ||
@@ -134,0 +135,0 @@ ); |
46751
1047
270