From ae11b30ff24b046fc1274b883d0c394b85272ad0 Mon Sep 17 00:00:00 2001 From: scottkellum Date: Sat, 7 Mar 2015 10:49:05 -0500 Subject: [PATCH] New min js file for release --- modularscale.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularscale.min.js b/modularscale.min.js index b0bdb1c..0670d4d 100644 --- a/modularscale.min.js +++ b/modularscale.min.js @@ -1 +1 @@ -function ms(r,a,t){"string"==typeof r&&(r=1),void 0==r&&(r=msValue),void 0==a&&(a=msBases),void 0==t&&(t=msRatios),0>=a&&(a=1),"number"!=typeof Math.abs(a[0])&&(a=1);for(var a=(""+a).split(","),t=(""+t).split(","),o=[],s=null,e=0;e=0){for(var n=0;Math.pow(t[e],n)*a[h]>=a[0];)o.push([Math.pow(t[e],n)*a[h],s]),n--;for(var n=0;Math.pow(t[e],n)*a[h]<=Math.pow(t[e],r+1)*a[h];)o.push([Math.pow(t[e],n)*a[h],s]),n++}else{for(var n=0;Math.pow(t[e],n)*a[h]<=a[0];)o.push([Math.pow(t[e],n)*a[h],s]),n++;for(var n=0;Math.pow(t[e],n)*a[h]>=Math.pow(t[e],r-1)*a[h];)Math.pow(t[e],n)*a[h]<=a[0]&&o.push([Math.pow(t[e],n)*a[h],s]),n--}return o=msUnique(o),0>r&&(o=o.reverse()),o[Math.abs(r)]}var msValue=0,msBases=1,msRatios=(1+Math.sqrt(5))/2,msUnique=function(r){r=r.sort(function(r,a){var t=r[0],o=a[0];return t-o}),newArr=[];for(var a=null,t=0;t=o&&(o=1),"number"!=typeof Math.abs(o[0])&&(o=1);for(var o=(""+o).split(","),t=(""+t).split(","),a=[],e=null,h=0;h=0){for(var s=0;Math.pow(t[h],s)*o[n]>=o[0];)a.push([Math.pow(t[h],s)*o[n],e]),s--;for(var s=0;Math.pow(t[h],s)*o[n]<=Math.pow(t[h],r+1)*o[n];)a.push([Math.pow(t[h],s)*o[n],e]),s++}else{for(var s=0;Math.pow(t[h],s)*o[n]<=o[0];)a.push([Math.pow(t[h],s)*o[n],e]),s++;for(var s=0;Math.pow(t[h],s)*o[n]>=Math.pow(t[h],r-1)*o[n];)Math.pow(t[h],s)*o[n]<=o[0]&&a.push([Math.pow(t[h],s)*o[n],e]),s--}return a=msUnique(a),0>r&&(a=a.reverse()),a[Math.abs(r)][0]}var msValue=0,msBases=1,msRatios=(1+Math.sqrt(5))/2,minorSecond=1.067,majorSecond=1.125,minorThird=1.2,majorThird=1.25,perfectFourth=1.333,augFourth=1.414,perfectFifth=1.5,minorSixth=1.6,goldenSection=1.618,majorSixth=1.667,minorSeventh=1.778,majorSeventh=1.875,octave=2,majorTenth=2.5,majorEleventh=2.667,majorTwelfth=3,doubleOctave=4,msUnique=function(r){r=r.sort(function(r,o){var t=r[0],a=o[0];return t-a}),newArr=[];for(var o=null,t=0;t