summaryrefslogtreecommitdiff
path: root/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle.js')
-rw-r--r--bundle.js35
1 files changed, 28 insertions, 7 deletions
diff --git a/bundle.js b/bundle.js
index ba8d9f8..599731f 100644
--- a/bundle.js
+++ b/bundle.js
@@ -38148,6 +38148,11 @@ var scales = exports.scales = [{ name: "natural", get: function get(i, j) {
get: function get(ii, jj, i, j) {
return [a[i], b[j]];
}
+}, {
+ name: "hyperbolic",
+ get: function get(ii, jj, i, j, x, y) {
+ return [1 + i * (x + 1) / (y + 1), 1 + j * (x + 1) / (y + 1)];
+ }
},
// {
// name: "triangle",
@@ -38809,9 +38814,21 @@ function add(i, j) {
}
var a_inv = a * denominator;
var b_inv = b * numerator;
- var ba_gcd = (0, _computeGcd2.default)(a_inv, b_inv);
- var a_disp = a_inv / ba_gcd;
- var b_disp = b_inv / ba_gcd;
+ var a_disp = void 0,
+ b_disp = void 0;
+ if (scale.name === "hyperbolic") {
+ a_inv *= Math.round(base_y) + 1;
+ b_inv *= Math.round(base_y) + 1;
+ var ba_gcd = (0, _computeGcd2.default)(Math.round(a_inv), Math.round(b_inv));
+ a_disp = Math.round(a_inv / ba_gcd);
+ b_disp = Math.round(b_inv / ba_gcd);
+ // a_disp = Math.round(a_inv);
+ // b_disp = Math.round(b_inv);
+ } else {
+ var _ba_gcd = (0, _computeGcd2.default)(a_inv, b_inv);
+ a_disp = a_inv / _ba_gcd;
+ b_disp = b_inv / _ba_gcd;
+ }
frac = Math.log2(isEqualTemperament ? interval : aa / bb) % 1;
@@ -38938,11 +38955,15 @@ function bind() {
document.querySelector("#help-button").addEventListener("click", function () {
return document.querySelector("#help").classList.toggle("visible");
});
- document.querySelector("#pythagorean").addEventListener("click", function () {
- scaleMode = _scales.scales.findIndex(function (scale) {
- return scale.name === "pythagorean";
+ Array.from(document.querySelectorAll(".mode")).forEach(function (el) {
+ console.log(el.getAttribute("name"));
+ el.addEventListener("click", function (event) {
+ var name = el.getAttribute("name");
+ scaleMode = _scales.scales.findIndex(function (scale) {
+ return scale.name === name;
+ });
+ rebuild();
});
- rebuild();
});
// Wheel to scroll