diff --git a/tools/aqua-trial/README.md b/tools/aqua-trial/README.md index 0870e58..9f14194 100644 --- a/tools/aqua-trial/README.md +++ b/tools/aqua-trial/README.md @@ -16,7 +16,7 @@ the patch through the same faustwasm runtime the page loads (`node test.mjs`, 15 rattle layers only; the rumble (tone) is untouched, so lowering it moves the mix tone-forward. That reading of "tone-forward mix" is this author's; at 100 the signal equals the thruster (asserted sample for sample). Variants: rpm 600, noise 100 / 50 / 20 / 0. Not loudness-matched, so level and noise are confounded by design. -- `logic.mjs`: design, statistics, validation and export shape (shared by page and tests). +- `logic.js`: design, statistics, validation and export shape (shared by page and tests). - `analyze.mjs`: dependency-free. `node analyze.mjs export1.json [export2.json ...]` prints per-variant n, mean, sd, min/max, peak, rms, words, and whether peak / rms predicted the ratings (Spearman rho, permutation p; "predicts" means |rho| >= 0.5 and p < 0.05, fixed before any data). diff --git a/tools/aqua-trial/analyze.mjs b/tools/aqua-trial/analyze.mjs index 52b73ea..0414d4c 100644 --- a/tools/aqua-trial/analyze.mjs +++ b/tools/aqua-trial/analyze.mjs @@ -4,7 +4,7 @@ // Pure functions are exported for test.mjs; the CLI runs only when this file is the entry point. import { readFileSync } from "node:fs"; import { pathToFileURL } from "node:url"; -import { rng, shuffle, SCHEMA } from "./logic.mjs"; +import { rng, shuffle, SCHEMA } from "./logic.js"; export const mean = (xs) => xs.reduce((a, b) => a + b, 0) / xs.length; export const sd = (xs) => (xs.length < 2 ? NaN : Math.sqrt(xs.reduce((a, x) => a + (x - mean(xs)) ** 2, 0) / (xs.length - 1))); diff --git a/tools/aqua-trial/build.mjs b/tools/aqua-trial/build.mjs index fa5c41f..ac741ee 100644 --- a/tools/aqua-trial/build.mjs +++ b/tools/aqua-trial/build.mjs @@ -1,4 +1,4 @@ -// Assembles dist/ (the static trial site): web/, logic.mjs, the trial patch, and the faustwasm runtime copied from +// Assembles dist/ (the static trial site): web/, logic.js, the trial patch, and the faustwasm runtime copied from // the sibling aqua-playground's node_modules (run `npm install` there first). Prints a content hash for the // publish path: minds.gamecult.org/aqua/trial-/. Usage: node build.mjs [outDir] import { cpSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs"; @@ -13,7 +13,7 @@ const fw = join(play, "node_modules/@grame/faustwasm"); rmSync(out, { recursive: true, force: true }); mkdirSync(join(out, "vendor/faustwasm"), { recursive: true }); cpSync(join(here, "web"), out, { recursive: true }); -cpSync(join(here, "logic.mjs"), join(out, "logic.mjs")); +cpSync(join(here, "logic.js"), join(out, "logic.js")); cpSync(join(here, "thruster-trial.dsp"), join(out, "thruster-trial.dsp")); cpSync(join(play, "web/ui.js"), join(out, "ui.js")); cpSync(join(fw, "dist/esm/index.js"), join(out, "vendor/faustwasm/index.js")); diff --git a/tools/aqua-trial/logic.mjs b/tools/aqua-trial/logic.js similarity index 100% rename from tools/aqua-trial/logic.mjs rename to tools/aqua-trial/logic.js diff --git a/tools/aqua-trial/test.mjs b/tools/aqua-trial/test.mjs index 7570a86..9c519e8 100644 --- a/tools/aqua-trial/test.mjs +++ b/tools/aqua-trial/test.mjs @@ -5,7 +5,7 @@ import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { dirname, join, resolve } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; -import { makeDesign, variants, stats, cleanWord, validRating, buildExport, renderVariant, rng, shuffle, SCHEMA, PATCH } from "./logic.mjs"; +import { makeDesign, variants, stats, cleanWord, validRating, buildExport, renderVariant, rng, shuffle, SCHEMA, PATCH } from "./logic.js"; import { analyze, format, mean, sd, spearman, ranks, pearson } from "./analyze.mjs"; const here = dirname(fileURLToPath(import.meta.url)); diff --git a/tools/aqua-trial/web/trial.js b/tools/aqua-trial/web/trial.js index ef4e721..9c3f4f8 100644 --- a/tools/aqua-trial/web/trial.js +++ b/tools/aqua-trial/web/trial.js @@ -1,9 +1,9 @@ // Browser glue for the listening trial. The decisions (design, statistics, validation, export shape) live in -// ../logic.mjs and are tested in node; this file only touches the DOM, the AudioContext and the download. +// ../logic.js and are tested in node; this file only touches the DOM, the AudioContext and the download. // Nothing here makes a network request after the page assets load, and nothing is written to storage. import { instantiateFaustModuleFromFile, LibFaust, FaustCompiler, FaustMonoDspGenerator } from "./vendor/faustwasm/index.js"; import { controlsOf } from "./ui.js"; -import { variants, makeDesign, renderVariant, cleanWord, validRating, buildExport, PATCH } from "./logic.mjs"; +import { variants, makeDesign, renderVariant, cleanWord, validRating, buildExport, PATCH } from "./logic.js"; const $ = (s, root = document) => root.querySelector(s); const status = (t) => { $("#status").textContent = t; };