summaryrefslogtreecommitdiff
path: root/intonation.js
diff options
context:
space:
mode:
Diffstat (limited to 'intonation.js')
-rw-r--r--intonation.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/intonation.js b/intonation.js
index 8c12847..fe2fa37 100644
--- a/intonation.js
+++ b/intonation.js
@@ -28,7 +28,7 @@ var Intonation = (function(){
interval_list = interval_list.split(" ")
}
this.intervals = interval_list
- this.opt.interval = parseInterval.call(this, interval_list.pop() )
+ this.interval = this.opt.interval = parseInterval.call(this, interval_list.pop() )
this.scale = interval_list.map( parseIntervalString.bind(this) ).filter(function(v){
return !! v
})
@@ -37,7 +37,7 @@ var Intonation = (function(){
var scale = this.scale = []
var root = this.opt.root
var tet = this.opt.tet
- var interval = this.opt.interval
+ var interval = this.interval = this.opt.interval
var ratio = Math.pow( interval, 1/tet )
var n = root
scale.push(n)
@@ -83,7 +83,6 @@ var Intonation = (function(){
note = Math.pow( 2, (parseFloat(note) / 1200) )
}
else {
- console.log("note", line, note)
note = parseInterval(note)
}
if (note) {
@@ -97,7 +96,7 @@ var Intonation = (function(){
octave = octave || this.opt.octave
var f = this.scale[ mod(i, this.scale.length)|0 ]
var pow = Math.floor(norm(i, 0, this.scale.length)) + octave
- f *= Math.pow(this.opt.interval, pow)
+ f *= Math.pow(this.interval, pow)
return f
}
Intonation.prototype.range = function(min, max){
@@ -115,7 +114,7 @@ var Intonation = (function(){
if (f == 0) return 0
var scale_f = f
var pow = 0
- var interval = this.opt.interval
+ var interval = this.interval
var scale = this.scale
while (scale_f < root) {
scale_f *= interval