Files
fm1-x0x/web/index_pkg.html
kurogedelic 5684e187b0 Felucca 0.8-beta source
Firmware, update loader, build tools, assets, web installer and editor,
host tests. Four tracks (three synth parts and a drum track), user presets
with live editor sync (protocol v2), editor protocol v3 (tracks), the
command-line installer tools/fm1_install.py.
2026-10-03 16:06:39 +09:00

173 lines
10 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<!-- SPDX-License-Identifier: GPL-3.0-only
Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments -->
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Felucca</title>
<style>
:root { --bg: #fff; --fg: #000; --dim: #777; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --bg: #000; --fg: #fff; --dim: #888; }
}
:root[data-theme="dark"] { --bg: #000; --fg: #fff; --dim: #888; }
body { margin: 0; background: var(--bg); color: var(--fg);
font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
main { max-width: 520px; margin: 0 auto; padding: 48px 16px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 24px; }
.lang { float: right; font-size: 13px; color: var(--dim); cursor: pointer; text-decoration: underline; background: none; padding: 0; color: var(--dim); }
p { margin: 0 0 16px; }
button { font: inherit; background: var(--fg); color: var(--bg); border: 0; padding: 8px 20px; cursor: pointer; }
button:disabled { opacity: .3; cursor: default; }
#status { margin-top: 16px; min-height: 1.6em; }
.small { color: var(--dim); font-size: 13px; }
progress { width: 100%; height: 4px; margin-top: 16px; }
pre { color: var(--dim); font-size: 12px; white-space: pre-wrap; margin-top: 16px; }
</style>
</head>
<body>
<main>
<button class="lang" id="lang"></button>
<h1>Felucca</h1>
<p data-t="intro"></p>
<p data-t="warn"></p>
<p class="small" data-t="direct"></p>
<p class="small" data-t="beta"></p>
<p class="small"><span data-t="brick"></span>
<a href="https://github.com/kurogedelic/FM-1-transporter" target="_blank" rel="noopener" style="color:inherit">FM-1-transporter</a></p>
<p class="small" data-t="back"></p>
<p class="small"><a href="https://www.m-vave.com/download" target="_blank" rel="noopener" style="color:inherit">www.m-vave.com/download</a></p>
<p><button id="go" disabled data-t="install"></button></p>
<progress id="bar" max="100" value="0"></progress>
<p id="status"></p>
<pre id="log"></pre>
<p><a href="../editor/" style="color:inherit" data-t="editor"></a></p>
<p class="small">Felucca by Leo Kuroshita (@kurogedelic), <a href="https://hugelton.com" target="_blank" rel="noopener" style="color:inherit">Hügelton Instruments</a>.<br>
Font: Terminus (Dimitar Toshkov Zhekov, SIL OFL 1.1). Samples: Versilian Studios VSCO-2 Community Edition and VCSL (CC0 1.0), and the Hügelton Sample Pack (© Hügelton Instruments, not CC0).<br>
Test build. M-VAVE and FM-1 are trademarks of their respective owners.<br>
<span data-t="license"></span> <a href="https://github.com/hugelton/Felucca" target="_blank" rel="noopener" style="color:inherit">github.com/hugelton/Felucca</a></p>
</main>
<script type="module">
/*LIB*/
const $ = (id) => document.getElementById(id);
const TEXT = {
ja: {
intro: "FM-1 を USB で接続してください。(Chrome か Edge で使えます)",
warn: "書き込み中は USB を抜かないでください。",
install: "インストール", other: "English",
editor: "エディタ(インストール後、パソコンから音色やシーケンスを編集)",
direct: "USB ケーブルはパソコンに直接つないでください。Probe や Transporter などの機材は不要です。",
brick: "万一インストールに失敗して起動しなくなった場合は、復旧に Transporter が必要です:",
beta: "これはベータ版で、不安定な場合があります。このカスタムファームウェアを使ったことで FM-1 が壊れたり不具合が起きたりしても、作者は一切の責任を負いません。自己責任でお使いください。",
back: "公式ファームウェアに戻すには、M-VAVE 公式のアップデーター M-UPGRADE(Downloads → PC Software → M-UPGRADE)と公式ファームウェア(PC Firmware → FM-1 V15)が必要です。",
nomidi: "このブラウザでは使えません。Chrome か Edge で開いてください。", loadfail: "読み込めませんでした: ",
start: "開始します", verify: "確認中", loader: "書き込みモードに切り替え中", write: "書き込み中",
reboot: "再起動中", done: "完了しました", stopped: "途中で止まりました。USB を挿し直してもう一度押してください。",
error: "エラー: ",
denied: "MIDI(SysEx)の使用が許可されませんでした。アドレスバーのサイト設定で MIDI を許可して、もう一度押してください。",
notfound: "FM-1 が見つかりません。USB ケーブル(データ通信用か)を確かめ、MIDI を使う他のアプリを閉じてから、もう一度押してください。",
model: "接続されている機器は FM-1 ではありません。",
lost: "USB の接続が切れました。挿し直してもう一度押してください。",
noloader: "書き込みモードの FM-1 が見つかりません。USB を挿し直してもう一度押してください(終わるまで書き込みモードのままです)。",
noreturn: "FM-1 が戻ってきません。電源を入れ直してください。",
mismatch: "書き込みは終わりましたが、FM-1 が別のバージョンを報告しています: ",
badpkg: "インストールするファイルが壊れています。ページを再読み込みしてください。",
leave: "書き込み中です。ページを閉じないでください。",
license: "GPL-3.0、無保証。ソース:",
},
en: {
intro: "Connect the FM-1 by USB. (Works in Chrome or Edge.)",
warn: "Do not unplug the USB cable while writing.",
install: "Install", other: "日本語",
editor: "Editor (after installing: edit sounds and sequences from the computer)",
direct: "Connect the USB cable directly to the computer. No probe or Transporter is needed.",
brick: "If an install fails and the FM-1 no longer starts, recovering it needs a Transporter:",
beta: "This is a beta and may be unstable. The author accepts no responsibility if your FM-1 is damaged or misbehaves because of this custom firmware. Use it at your own risk.",
back: "To go back to the official firmware you need M-VAVE's official updater, M-UPGRADE (Downloads → PC Software → M-UPGRADE), and the official firmware (PC Firmware → FM-1 V15).",
nomidi: "This browser cannot do it. Open the page in Chrome or Edge.", loadfail: "Could not load: ",
start: "Starting", verify: "Verifying", loader: "Switching to update mode", write: "Writing",
reboot: "Restarting", done: "Done", stopped: "Stopped. Replug the USB cable and press Install again.",
error: "Error: ",
denied: "MIDI (SysEx) access was not allowed. Allow MIDI in the site settings (address bar) and press Install again.",
notfound: "FM-1 not found. Check the USB cable (a data cable), close other apps that use MIDI, and press Install again.",
model: "The connected device is not an FM-1.",
lost: "The USB connection was lost. Replug it and press Install again.",
noloader: "The FM-1 in update mode was not found. Replug the USB cable and press Install again (it stays in update mode until it is finished).",
noreturn: "The FM-1 did not come back. Power-cycle it.",
mismatch: "Written, but the FM-1 reports another version: ",
badpkg: "The file to install is damaged. Reload the page.",
leave: "Writing. Do not close the page.",
license: "GPL-3.0, no warranty. Source:",
},
};
let lang = (navigator.language || "en").toLowerCase().startsWith("ja") ? "ja" : "en";
const t = (k) => TEXT[lang][k];
let lastKey = null, lastArg = "";
function applyLang() {
document.documentElement.lang = lang;
document.querySelectorAll("[data-t]").forEach((e) => { e.textContent = t(e.dataset.t); });
$("lang").textContent = t("other");
if (lastKey) $("status").textContent = t(lastKey) + lastArg;
}
$("lang").addEventListener("click", () => { lang = lang === "ja" ? "en" : "ja"; applyLang(); });
applyLang();
const sayK = (k, arg = "") => { lastKey = k; lastArg = arg; $("status").textContent = t(k) + arg; };
const say = (txt) => { lastKey = null; $("status").textContent = txt; };
const log = (t) => { $("log").textContent += t + "\n"; };
let image = null;
const meta = /*META*/;
let writing = false;
window.addEventListener("beforeunload", (e) => { if (writing) { e.preventDefault(); e.returnValue = t("leave"); } });
(async () => {
if (!navigator.requestMIDIAccess) { sayK("nomidi"); return; }
try {
const r = await fetch(meta.pkg);
if (!r.ok) throw new Error(`${meta.pkg}: HTTP ${r.status}`);
const pkg = new Uint8Array(await r.arrayBuffer());
if (productOf(pkg) !== meta.product) { sayK("badpkg"); return; }
image = logicalImage(pkg);
say(`Felucca ${meta.version}`);
$("go").disabled = false;
} catch (e) { sayK("loadfail", e.message); }
})();
$("go").addEventListener("click", async () => {
$("go").disabled = true;
let midi;
try { midi = await navigator.requestMIDIAccess({ sysex: true }); }
catch (e) { sayK("denied"); $("go").disabled = false; return; }
writing = true;
try {
const up = new Updater(midi, log);
const total = 74 + 1167;
const step = (k, a) => {
log(`${k} ${a ?? ""}`);
if (k === "start") sayK("start");
if (k === "verify") { sayK("verify"); $("bar").value = (a / total) * 100; }
if (k === "loader") sayK("loader");
if (k === "write") { sayK("write"); $("bar").value = ((74 + a) / total) * 100; }
if (k === "reboot") sayK("reboot");
if (k === "done") { $("bar").value = 100; sayK("done"); }
};
const ota = await up.find((id) => /^ota-/i.test(id.model));
if (ota) {
ota.link.close();
sayK((await up.resume(image, step)) ? "done" : "stopped");
} else {
await up.install(image, meta.product, step);
}
} catch (e) {
if (e && e.code && TEXT[lang][e.code]) sayK(e.code, e.detail || "");
else sayK("error", e && e.message);
log(String(e && e.stack || e));
}
writing = false;
$("go").disabled = false;
});
</script>
</body>
</html>