summaryrefslogtreecommitdiff
path: root/client/lib
diff options
context:
space:
mode:
Diffstat (limited to 'client/lib')
-rw-r--r--client/lib/scales.js53
1 files changed, 51 insertions, 2 deletions
diff --git a/client/lib/scales.js b/client/lib/scales.js
index cb36b28..2d59f8a 100644
--- a/client/lib/scales.js
+++ b/client/lib/scales.js
@@ -19,6 +19,38 @@ const meantone = `! meanquar.scl
2/1
`
+const shares = `! shares.scl
+!
+A scale based on shares of wealth
+!
+1.
+5.
+15.
+32.
+52.
+78.
+116.
+182.
+521.
+1000.
+`
+
+const shares_sum = `! shares_sum.scl
+!
+A scale based on summing shares of wealth
+!
+1
+6.0
+21.0
+53.0
+105.0
+183.0
+299.0
+481.0
+1002.0
+2/1
+`
+
const mavila = `! mavila12.scl
!
A 12-note mavila scale (for warping meantone-based music), 5-limit TOP
@@ -137,6 +169,12 @@ const scales = [
{
scl: colundi,
},
+ {
+ scl: shares,
+ },
+ {
+ scl: shares_sum,
+ },
].map( (opt) => new Intonation(opt) )
let scale = scales[0]
@@ -152,7 +190,18 @@ function build () {
})
scale_list.appendChild(scale.heading)
})
-
+ pick(0)
+}
+function build_options(el) {
+ scales.forEach( (scale, i) => {
+ const option = document.createElement('option')
+ option.innerHTML = scale.name
+ option.value = i
+ el.appendChild(option)
+ })
+ el.addEventListener('input', function(e){
+ pick(e.target.value)
+ })
pick(0)
}
@@ -178,4 +227,4 @@ function names () {
}
-export default { scales, current, build, pick, names, onChange }
+export default { scales, current, build, build_options, pick, names, onChange }