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 @@ + +
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.
+Descargas oficiales de M-VAVE · Elegí M-UPGRADE y el firmware SMK-37 PRO V016.
+