tonal-range
Advanced tools
Comparing version 0.50.0 to 0.50.1
@@ -8,3 +8,3 @@ 'use strict'; | ||
const isNum = (n) => typeof n === 'number' | ||
function isNum (n) { return typeof n === 'number' } | ||
// ascending range | ||
@@ -59,3 +59,3 @@ function ascR (b, n) { for (var a = []; n--; a[n] = n + b); return a } | ||
const chromas = tonalArray.map(tonalNote.chroma, scale) | ||
return (midi) => { | ||
return function (midi) { | ||
const pcIndex = chromas.indexOf(midi % 12) | ||
@@ -79,4 +79,4 @@ return pcIndex > -1 ? buildNote(scale[pcIndex], midi) : null | ||
function noteRange (fn, a, b) { | ||
if (arguments.length === 1) return (a, b) => noteRange(fn, a, b) | ||
return range(a, b).map(fn).filter((x) => x !== null) | ||
if (arguments.length === 1) return function (a, b) { return noteRange(fn, a, b) } | ||
return range(a, b).map(fn).filter(function (x) { return x !== null }) | ||
} | ||
@@ -83,0 +83,0 @@ |
@@ -6,3 +6,3 @@ import { pc, chroma } from 'tonal-note' | ||
const isNum = (n) => typeof n === 'number' | ||
function isNum (n) { return typeof n === 'number' } | ||
// ascending range | ||
@@ -57,3 +57,3 @@ function ascR (b, n) { for (var a = []; n--; a[n] = n + b); return a } | ||
const chromas = map(chroma, scale) | ||
return (midi) => { | ||
return function (midi) { | ||
const pcIndex = chromas.indexOf(midi % 12) | ||
@@ -77,4 +77,4 @@ return pcIndex > -1 ? buildNote(scale[pcIndex], midi) : null | ||
export function noteRange (fn, a, b) { | ||
if (arguments.length === 1) return (a, b) => noteRange(fn, a, b) | ||
return range(a, b).map(fn).filter((x) => x !== null) | ||
if (arguments.length === 1) return function (a, b) { return noteRange(fn, a, b) } | ||
return range(a, b).map(fn).filter(function (x) { return x !== null }) | ||
} | ||
@@ -81,0 +81,0 @@ |
{ | ||
"name": "tonal-range", | ||
"version": "0.50.0", | ||
"version": "0.50.1", | ||
"description": "Create ranges of notes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
18070