diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-09-20 14:33:31 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-09-20 14:33:31 -0400 |
| commit | a7c9044a3139c517818d273bdb3e68d24704ceb0 (patch) | |
| tree | 4cb2d58e3580f538f758dc4871b0031098377e88 /intonation.js | |
| parent | 866716676f5be34262d1ca81add5047f55d16ede (diff) | |
play weird scales with keyboard
Diffstat (limited to 'intonation.js')
| -rw-r--r-- | intonation.js | 4 |
1 files changed, 4 insertions, 0 deletions
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 }) |
