tonal-distance
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -35,2 +35,3 @@ 'use strict'; | ||
*/ | ||
// Map from letter step to number of fifths starting from "C": | ||
@@ -41,3 +42,3 @@ // { C: 0, D: 2, E: 4, F: -1, G: 1, A: 3, B: 5 } | ||
// Given a number of fifths, return the octaves they span | ||
var fOcts = function (f) { return Math.floor(f * 7 / 12); }; | ||
var fOcts = function (f) { return Math.floor((f * 7) / 12); }; | ||
@@ -85,4 +86,4 @@ // Get the number of octaves it span each step | ||
var encoder = function (props$$1) { return memo(function (str) { | ||
var p = props$$1(str); | ||
var encoder = function (props) { return memo(function (str) { | ||
var p = props(str); | ||
return p.name === null ? null : encode(p); | ||
@@ -244,3 +245,3 @@ }); }; | ||
f.length === 1 | ||
? [t[0] - f[0], -Math.floor((t[0] - f[0]) * 7 / 12)] | ||
? [t[0] - f[0], -Math.floor(((t[0] - f[0]) * 7) / 12)] | ||
: [t[0] - f[0], t[1] - f[1]]; | ||
@@ -247,0 +248,0 @@ return tonalInterval.build(decodeIvl(d)); |
@@ -36,3 +36,3 @@ /** | ||
// Given a number of fifths, return the octaves they span | ||
var fOcts = function (f) { return Math.floor(f * 7 / 12); }; | ||
var fOcts = function (f) { return Math.floor((f * 7) / 12); }; | ||
@@ -238,3 +238,3 @@ // Get the number of octaves it span each step | ||
f.length === 1 | ||
? [t[0] - f[0], -Math.floor((t[0] - f[0]) * 7 / 12)] | ||
? [t[0] - f[0], -Math.floor(((t[0] - f[0]) * 7) / 12)] | ||
: [t[0] - f[0], t[1] - f[1]]; | ||
@@ -241,0 +241,0 @@ return ibuild(decodeIvl(d)); |
@@ -36,3 +36,3 @@ /** | ||
// Given a number of fifths, return the octaves they span | ||
const fOcts = f => Math.floor(f * 7 / 12); | ||
const fOcts = f => Math.floor((f * 7) / 12); | ||
@@ -231,3 +231,3 @@ // Get the number of octaves it span each step | ||
f.length === 1 | ||
? [t[0] - f[0], -Math.floor((t[0] - f[0]) * 7 / 12)] | ||
? [t[0] - f[0], -Math.floor(((t[0] - f[0]) * 7) / 12)] | ||
: [t[0] - f[0], t[1] - f[1]]; | ||
@@ -234,0 +234,0 @@ return ibuild(decodeIvl(d)); |
{ | ||
"name": "tonal-distance", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Transpose notes and find intervals between them", | ||
@@ -23,4 +23,4 @@ "keywords": [ | ||
"dependencies": { | ||
"tonal-interval": "^2.0.0", | ||
"tonal-note": "^2.0.0" | ||
"tonal-interval": "^2.1.0", | ||
"tonal-note": "^2.1.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "babel": { |
39240
8
973
Updatedtonal-interval@^2.1.0
Updatedtonal-note@^2.1.0