diff --git a/.github/workflows/emulator.yml b/.github/workflows/emulator.yml index 642f55a8..9712c9fe 100644 --- a/.github/workflows/emulator.yml +++ b/.github/workflows/emulator.yml @@ -255,6 +255,9 @@ jobs: # page (web/studio; it shows JIANT BYTE's tools from /JIANT-BYTE/, the same origin) mkdir -p build/pages/studio cp web/studio/index.html web/studio/studio.js web/studio/studio-lib.js web/studio/daw.js web/studio/recorder-worklet.js web/studio/learn.js web/studio/wavetable.js web/studio/radio-vis.js web/studio/analysis.js web/studio/convert.js web/studio/learn-fm.json web/studio/learn-byte.json web/studio/live-fm.json web/studio/live-byte.json web/fm1backup.js build/pages/studio/ + cp -r web/studio/smk37 build/pages/studio/smk37 + cp web/fm1pkg.js web/fm1ota.js build/pages/studio/smk37/ + cp -r LICENSE LICENSES LICENSING.md build/pages/studio/smk37/ cp -r web/studio/img build/pages/studio/img # (studio) FM-1 Rescue's builder and base firmware for Studio's Rescue tab; its own page at rescue/ mkdir -p build/pages/studio/rescue/base build/pages/rescue diff --git a/web/fm1ota.js b/web/fm1ota.js index 6cd4dc55..97bc05ff 100644 --- a/web/fm1ota.js +++ b/web/fm1ota.js @@ -26,7 +26,7 @@ export const UPDATE_TIMES = { }; /* the ports worth asking for an identity: the FM-1 (official: its own name or the USB composite's), JIANT, Felucca and * its forks, the update loaders. Other gear is not probed, except a port that appears while we wait for the loader */ -export const PORT_RE = /fm-?1|felucca|jiant|skiff|ota|composite|sinco|usb-midi|m-?vave|cuvave/i; +export const PORT_RE = /smk[ -]?37|fm-?1|felucca|jiant|skiff|ota|composite|sinco|usb-midi|m-?vave|cuvave/i; /* Windows names one device's ports "FM-1", "2- FM-1", "MIDIIN2 (FM-1)" / "MIDIOUT2 (FM-1)", "FM-1 1": the device's name */ export const portBase = (name) => String(name || "").trim().replace(/^\d+\s*-\s*/, "") .replace(/^MIDI(?:IN|OUT)\d*\s*\((.*)\)$/i, "$1").replace(/\s+\d+$/, "").trim().toLowerCase(); @@ -235,7 +235,7 @@ export class Updater { last = Date.now(); if (r.addr === 0xE0000000 || r.addr === 0xF0000000) { link.send(response(r.addr, [...new TextEncoder().encode("success"), 0])); - if (r.addr === finishAddr) return { served, finished: true }; + if (r.addr === finishAddr) return { served, finished: served > 0 }; continue; } if (r.len > MAXDATA || r.addr + r.len > image.length) throw fail("badreq", `bad request ${r.addr.toString(16)}+${r.len}`); @@ -249,9 +249,9 @@ export class Updater { } // full install: running firmware -> loader -> new firmware - async install(image, product, onStep) { + async install(image, product, onStep, requiredIdentity = null) { const step = onStep || (() => {}); - const dev = await this.find((id) => !IS_OTA(id), { tries: this.t.findTries }); + const dev = await this.find((id) => requiredIdentity ? id.text === requiredIdentity : !IS_OTA(id), { tries: this.t.findTries }); if (!dev) throw this.notFound(); const [model] = product.split("_"); if (dev.id.model !== model) { dev.link.close(); throw fail("model", `the device is ${dev.id.text}, the package is for ${product}`, dev.id.text); } @@ -272,13 +272,13 @@ export class Updater { if (!s1.finished) throw fail(s1.lost ? "lost" : "stopped", `the device ${s1.lost ? "was disconnected" : "stopped"} after ${s1.served} requests: nothing was written`); step("loader"); await sleep(this.t.loaderSettle); - const ota = await this.waitFor((id) => id.model === "ota-" + model, this.t.loader); + const ota = await this.waitFor((id) => requiredIdentity ? id.text === "ota-" + product : id.model === "ota-" + model, this.t.loader); if (!ota) throw fail("noloader", "the update loader did not appear. Replug the USB cable and press Install again: the device stays in update mode until it is finished."); const s2 = await this.write(ota, image, step); if (!s2.finished) throw fail(s2.lost ? "lost" : "stopped", `the loader ${s2.lost ? "was disconnected" : "stopped"} after ${s2.served} requests. Replug and press Install again to resume.`); step("reboot"); await sleep(this.t.loaderSettle); - const back = await this.waitFor((id) => !IS_OTA(id), this.t.back); + const back = await this.waitFor((id) => requiredIdentity ? id.model === model : !IS_OTA(id), this.t.back); if (!back) throw fail("noreturn", "the device did not come back: power-cycle it"); back.link.close(); if (back.id.text !== product) throw fail("mismatch", `installed, but the device reports ${back.id.text}`, back.id.text); @@ -298,9 +298,9 @@ export class Updater { } // resume: the device is already in update mode (loader) -> true when the write finished - async resume(image, onStep, product = null) { + async resume(image, onStep, product = null, loaderIdentity = null) { const model = product && product.split("_")[0]; - const ota = await this.find((id) => model ? id.model === "ota-" + model : IS_OTA(id), { tries: 2 }); + const ota = await this.find((id) => loaderIdentity ? id.text === loaderIdentity : model ? id.model === "ota-" + model : IS_OTA(id), { tries: 2 }); if (!ota) return false; const step = onStep || (() => {}); const result = await this.write(ota, image, step); diff --git a/web/studio/dev_server.py b/web/studio/dev_server.py index 428ebd87..09edc1f8 100644 --- a/web/studio/dev_server.py +++ b/web/studio/dev_server.py @@ -45,6 +45,8 @@ def local(path): if rest.startswith("webapp/editor/"): f = repo / "web" / rest[len("webapp/editor/"):] return f.read_bytes() if f.is_file() else None + if site == "/JIANT/" and rest in ("studio/smk37/fm1pkg.js", "studio/smk37/fm1ota.js"): + return (FM / "web" / Path(rest).name).read_bytes() if site == "/JIANT/" and rest == "studio/fm1backup.js": # (the installer's and the editor's, beside Studio) return (FM / "web" / "fm1backup.js").read_bytes() if site == "/JIANT/" and rest.startswith("studio/rescue/"): # (FM-1 Rescue's builder and base firmware) diff --git a/web/studio/smk37/felucca-smk37-elite.fwsc b/web/studio/smk37/felucca-smk37-elite.fwsc new file mode 100644 index 00000000..c03fb41f Binary files /dev/null and b/web/studio/smk37/felucca-smk37-elite.fwsc differ diff --git a/web/studio/smk37/felucca-smk37-pro.fwsc b/web/studio/smk37/felucca-smk37-pro.fwsc new file mode 100644 index 00000000..6fd3aa96 Binary files /dev/null and b/web/studio/smk37/felucca-smk37-pro.fwsc differ diff --git a/web/studio/smk37/index.html b/web/studio/smk37/index.html new file mode 100644 index 00000000..99bda1b8 --- /dev/null +++ b/web/studio/smk37/index.html @@ -0,0 +1,93 @@ + +JIANT · Instalador SMK-37 +JIANT FM · Prueba de hardware

Instalador SMK-37

+

Para M-VAVE SMK-37 Pro y Elite con firmware de fábrica v016. Conectá únicamente el teclado a probar por USB de datos y cerrá el editor, el DAW y el actualizador de M-VAVE.

+

Esta primera prueba reemplaza el firmware. Tené a mano el firmware oficial de tu modelo y una copia de tus datos. El arranque y la recuperación en un teclado real siguen pendientes de validación. Los proyectos y ajustes de esta versión de JIANT se pierden al apagar.

+
+ +

La detección solo consulta la identidad MIDI.

+ +
Registro de la sesión
Código y licencias del firmware + diff --git a/web/studio/studio.js b/web/studio/studio.js index d314e423..b845ee8d 100644 --- a/web/studio/studio.js +++ b/web/studio/studio.js @@ -204,7 +204,7 @@ const TEXT = { shotDaw: "el editor del plugin: pantalla en vivo y pistas", shotDawSound: "el editor del plugin: el sonido", shotDawSamples: "el editor del plugin: el explorador de samples", portsManuals: "Manuales", portsHow: "Cómo funcionan", portTry: "Probar en el navegador", portDownload: "Descargar", portManual: "Manual", portInstall: "Cómo instalar", - portSource: "Código", portBuild: "Compilar", portSoon: "Instalador: próximamente", + portSource: "Código", portBuild: "Compilar", smkInstaller: "Instalador experimental (USB)", stOk: "funciona", stSoon: "próximamente", portSoonBuy: "Próximamente a la venta", stPreview: "preview: buscamos testers", stDev: "en desarrollo", stCi: "compilado en CI", pSmkTitle: "M-VAVE SMK-37 Pro / Elite", pSmkText: "JIANT directo en el chip del SMK-37 (el mismo AC791N que la FM-1): 37 teclas, 16 pads RGB, 8 encoders y 4 faders como panel. Usa el mismo editor web.", pSmk1: "Pads con color por pista", pSmk2: "El mismo editor y los mismos sonidos que la FM-1", @@ -397,7 +397,7 @@ const TEXT = { shotDaw: "the plugin's editor: the live screen and tracks", shotDawSound: "the plugin's editor: the sound", shotDawSamples: "the plugin's editor: the sample browser", portsManuals: "Manuals", portsHow: "How they work", portTry: "Try it in the browser", portDownload: "Download", portManual: "Manual", portInstall: "How to install", - portSource: "Source", portBuild: "Build", portSoon: "Installer: coming", + portSource: "Source", portBuild: "Build", smkInstaller: "Experimental USB installer", stOk: "works", stSoon: "coming soon", portSoonBuy: "Coming soon, for sale", stPreview: "preview: testers wanted", stDev: "in development", stCi: "built by CI", pSmkTitle: "M-VAVE SMK-37 Pro / Elite", pSmkText: "JIANT bare metal on the SMK-37's chip (the FM-1's AC791N): 37 keys, 16 RGB pads, 8 encoders and 4 faders as its panel. The same web editor.", pSmk1: "Pads lit in each track's colour", pSmk2: "The FM-1's editor and sounds", @@ -1128,7 +1128,7 @@ const PORTS = [ // shots: the port running (its emulator's panel in the browser, the plugin's editor), the first one on the card { id: "smk37", name: "pSmkTitle", text: "pSmkText", points: ["pSmk1", "pSmk2"], state: ["stDev", "soon"], pic: OUTLINE.smk, shots: [["img/smk37.webp", "shotSmk"]], - links: [["portTry", "#try:smk37"], ["portManual", MAN + "smk37.html"], ["portBuild", GH + "docs/SMK37.md"], ["portSoon", null]] }, + links: [["portTry", "#try:smk37"], ["portManual", MAN + "smk37.html"], ["portBuild", GH + "docs/SMK37.md"], ["smkInstaller", "smk37/index.html"]] }, { id: "mpc", name: "pMpcTitle", text: "pMpcText", points: ["pMpc1", "pMpc2"], state: ["stPreview", "soon"], pic: OUTLINE.mpc, shots: [["img/mpc.webp", "shotMpc"]], whole: true, // (the unit stands upright: all of it shown) links: [["portTry", "#try:mpc"], ["portManual", MAN + "mpc-sample.html"], ["portDownload", RELEASES], ["portInstall", MAN + "mpc-sample.html#release"]] },