From 1d98b40051d099dfd20b290960dfb9b9ad0028bc Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 25 May 2023 16:15:17 -0400 Subject: [PATCH] esbuild complained about >> --- js/application.js | 35 +++++++++++++++++++++++++---------- src/application.jsx | 4 ++-- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/js/application.js b/js/application.js index 1b43a42..977db22 100644 --- a/js/application.js +++ b/js/application.js @@ -58,10 +58,12 @@ var NoteInput = class extends preact.Component { }); var octaves = []; for (var i = 0; i < 9; ++i) { - octaves.push(/* @__PURE__ */ preact.h("option", { - key: i, - value: i - }, i)); + octaves.push( + /* @__PURE__ */ preact.h("option", { + key: i, + value: i + }, i) + ); } var [note, octave] = split_value(value); return /* @__PURE__ */ preact.h(preact.Fragment, null, /* @__PURE__ */ preact.h("select", { @@ -361,14 +363,24 @@ function SampleDisplay(props) { title: "Frequency" }, freq); var rv = []; - rv.push(/* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ (", fspan, " * ", /* @__PURE__ */ preact.h("i", null, "n"), ") >> ", shift, " ]")); - rv.push(/* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ (", fspan, " * ", /* @__PURE__ */ preact.h("i", null, "n"), ") / ", 1 << shift, " ]")); + rv.push( + /* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ (", fspan, " * ", /* @__PURE__ */ preact.h("i", null, "n"), ") >> ", shift, " ]") + ); + rv.push( + /* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ (", fspan, " * ", /* @__PURE__ */ preact.h("i", null, "n"), ") / ", 1 << shift, " ]") + ); if (freq2) { if (freq2 >= shift) { - rv.push(/* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq / (1 << shift)), " ]")); + rv.push( + /* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq / (1 << shift)), " ]") + ); } else { - rv.push(/* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq >> freq2), " >> ", shift - freq2, " ]")); - rv.push(/* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq >> freq2), " / ", 1 << shift - freq2, " ]")); + rv.push( + /* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq >> freq2), " >> ", shift - freq2, " ]") + ); + rv.push( + /* @__PURE__ */ preact.h("div", null, "Sample", /* @__PURE__ */ preact.h("sub", null, "n"), " = RAM[ ", nmultiply(freq >> freq2), " / ", 1 << shift - freq2, " ]") + ); } } return rv; @@ -672,5 +684,8 @@ var Application = class extends preact.Component { // src/main.jsx window.addEventListener("load", function() { - preact.render(/* @__PURE__ */ preact.h(Application, null), document.getElementById("application")); + preact.render( + /* @__PURE__ */ preact.h(Application, null), + document.getElementById("application") + ); }); diff --git a/src/application.jsx b/src/application.jsx index 8c1f743..8ec528f 100644 --- a/src/application.jsx +++ b/src/application.jsx @@ -41,7 +41,7 @@ function SampleDisplay(props) { rv.push(
- Samplen = RAM[ ({fspan} * n) >> {shift} ] + Samplen = RAM[ ({fspan} * n) >> {shift} ]
); rv.push( @@ -60,7 +60,7 @@ function SampleDisplay(props) { } else { rv.push(
- Samplen = RAM[ { nmultiply(freq >> freq2) } >> {shift - freq2} ] + Samplen = RAM[ { nmultiply(freq >> freq2) } >> {shift - freq2} ]
); rv.push(