diff options
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 }) |
