tonal-pcset
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -32,5 +32,6 @@ 'use strict'; | ||
*/ | ||
var chr = function (str) { return tonalNote.chroma(str) || tonalInterval.chroma(str) || 0; }; | ||
var pcsetNum = function (set) { return parseInt(chroma$2(set), 2); }; | ||
var clen = function (chroma$$1) { return chroma$$1.replace(/0/g, "").length; }; | ||
var pcsetNum = function (set) { return parseInt(chroma(set), 2); }; | ||
var clen = function (chroma) { return chroma.replace(/0/g, "").length; }; | ||
@@ -49,3 +50,3 @@ /** | ||
*/ | ||
function chroma$2(set) { | ||
function chroma(set) { | ||
if (isChroma(set)) { return set; } | ||
@@ -70,3 +71,3 @@ if (!Array.isArray(set)) { return ""; } | ||
return typeof n === "number" | ||
? all.filter(function (chroma$$1) { return clen(chroma$$1) === n; }) | ||
? all.filter(function (chroma) { return clen(chroma) === n; }) | ||
: all.slice(); | ||
@@ -91,3 +92,3 @@ } | ||
normalize = normalize !== false; | ||
var binary = chroma$2(set).split(""); | ||
var binary = chroma(set).split(""); | ||
return tonalArray.compact( | ||
@@ -142,3 +143,3 @@ binary.map(function(_, i) { | ||
if (arguments.length === 1) { return function (s) { return isEqual(s1, s); }; } | ||
return chroma$2(s1) === chroma$2(s2); | ||
return chroma(s1) === chroma(s2); | ||
} | ||
@@ -201,3 +202,3 @@ | ||
if (arguments.length > 1) { return includes(set)(note); } | ||
set = chroma$2(set); | ||
set = chroma(set); | ||
return function(note) { | ||
@@ -224,3 +225,3 @@ return set[chr(note)] === "1"; | ||
exports.chroma = chroma$2; | ||
exports.chroma = chroma; | ||
exports.chromas = chromas; | ||
@@ -227,0 +228,0 @@ exports.modes = modes; |
{ | ||
"name": "tonal-pcset", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Create and manipulate pitch class sets", | ||
@@ -21,5 +21,5 @@ "keywords": [ | ||
"dependencies": { | ||
"tonal-array": "^2.0.0", | ||
"tonal-interval": "^2.0.0", | ||
"tonal-note": "^2.0.0" | ||
"tonal-array": "^2.1.0", | ||
"tonal-interval": "^2.1.0", | ||
"tonal-note": "^2.1.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "babel": { |
38949
8
838
Updatedtonal-array@^2.1.0
Updatedtonal-interval@^2.1.0
Updatedtonal-note@^2.1.0