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 --- index.html | 187 ++++++++++++++++++++++++++++++++++------------------------ intonation.js | 4 ++ 2 files changed, 114 insertions(+), 77 deletions(-) diff --git a/index.html b/index.html index 38aeeca..3876db0 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,12 @@ * { cursor: default; } +.heading { + cursor: pointer; +} +.active { + font-weight: bold; +} pre { white-space: pre-line; } @@ -99,88 +105,84 @@ Wendy Carlos' Alpha scale with perfect fifth divided in nine
+
 
+
- - \ No newline at end of file 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