From a7c9044a3139c517818d273bdb3e68d24704ceb0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 20 Sep 2016 14:33:31 -0400 Subject: play weird scales with keyboard --- intonation.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'intonation.js') diff --git a/intonation.js b/intonation.js index fe2fa37..a0cbedf 100644 --- a/intonation.js +++ b/intonation.js @@ -1,6 +1,7 @@ var Intonation = (function(){ var Intonation = function(opt){ opt = this.opt = Object.assign({ + name: "", root: 440, octave: 0, interval: 2, @@ -27,6 +28,7 @@ var Intonation = (function(){ if (typeof interval_list == "string") { interval_list = interval_list.split(" ") } + this.name = this.opt.name || "interval list" this.intervals = interval_list this.interval = this.opt.interval = parseInterval.call(this, interval_list.pop() ) this.scale = interval_list.map( parseIntervalString.bind(this) ).filter(function(v){ @@ -45,6 +47,7 @@ var Intonation = (function(){ n *= ratio scale.push(n) } + this.name = this.opt.name || tet + "-tone equal temperament" this.intervals = null } Intonation.prototype.generate_scl = function(){ @@ -52,6 +55,7 @@ var Intonation = (function(){ var scl = this.parse_scl( this.opt.scl ) this.intervals = scl.notes this.interval = scl.notes.pop() + this.name = this.opt.name || scl.description this.scale = scl.notes.map(function(v){ return v * root }) -- cgit v1.2.3-70-g09d2