diff --git a/.github/workflows/emulator.yml b/.github/workflows/emulator.yml index 1d70c2cb..3d70e22a 100644 --- a/.github/workflows/emulator.yml +++ b/.github/workflows/emulator.yml @@ -50,6 +50,16 @@ jobs: else sh web/emu/build.sh fi + # Use the current browser shell with the pinned firmware, preserving its version label. + python3 - <<'PY' + from pathlib import Path + import re, shutil + target = Path("build/emu/index.html") + version = re.search(r'(.*?)', target.read_text()).group(1) + shell = Path("web/emu/index.html").read_text().replace("@VERSION@", version).replace("@PREVIEW@", "") + target.write_text(shell) + shutil.copy("web/emu/sample-bank.js", "build/emu/sample-bank.js") + PY # (JIANT) the installer and the web editor next to the emulator: the package needs JieLi's toolchain (downloaded) # and three files of their AC79 SDK (a partial clone: only those blobs). A firmware build failure stops deployment. - name: JieLi toolchain and SDK files (cached) @@ -165,7 +175,7 @@ jobs: - name: the front page and the emulator under emu/ run: | mkdir -p build/pages/emu - for f in index.html worklet.js fm1backup.js felucca.wasm fonts; do + for f in index.html worklet.js sample-bank.js fm1backup.js felucca.wasm fonts; do if [ -e "build/emu/$f" ]; then mv "build/emu/$f" build/pages/emu/; fi done cp -r build/emu/. build/pages/ diff --git a/README.md b/README.md index 63cd4144..b46b7805 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,19 @@ twelve original synthetic recordings, dedicated to the public domain under CC0-1 You can also import your own WAV files in the editor. See [factory sounds, rates and source](web/FACTORY-SAMPLES.md). +### Try the kits in the online emulator + +Before pressing **Switch on** in the [emulator](https://juanjiant-bit.github.io/JIANT/emu/), use **Sample bank**: + +- **Keep saved bank** preserves the samples already saved in this browser. +- **Kit 2 · Voices + instruments (7)** loads the seven-sound bank with VOICE 06, VOICE 10 and VOICE 14. +- **Kit 1 · Synth (12)** loads the original synthetic factory bank. + +After switching on, select **SAMPLE → KIT KEYS** on the instrument; slots begin at C4. +Reload the page to choose another bank. The selected bank is kept in this browser when local storage is available. +It changes only the emulator's sample storage, never a connected FM-1. +Playback uses the existing firmware; this does not add the offline preview's interpolation. + ### Storage and current limits - **Up to 15 mono samples** share a **6144-byte bank**, including its header, using IMA ADPCM. diff --git a/web/emu/build.sh b/web/emu/build.sh index adc4f3dd..38c09c01 100644 --- a/web/emu/build.sh +++ b/web/emu/build.sh @@ -21,6 +21,6 @@ emcc ${EMU_OPT:--O2} -ffp-contract=off -std=gnu99 -w ${EMU_CFLAGS:-} \ -o build/emu/felucca.wasm web/emu/felucca_web.c [ "${EMU_PREVIEW:-1}" = 0 ] && PREVIEW='' || PREVIEW=' (preview)' sed -e "s/@VERSION@/$VERSION/g" -e "s/@PREVIEW@/$PREVIEW/g" web/emu/index.html > build/emu/index.html -cp web/emu/worklet.js web/emu/stems.js web/fm1backup.js build/emu/ +cp web/emu/worklet.js web/emu/stems.js web/emu/sample-bank.js web/fm1backup.js build/emu/ cp web/emu/fonts/DotGothic16-subset.woff web/emu/fonts/OFL.txt build/emu/fonts/ echo "emu: build/emu ($(wc -c < build/emu/felucca.wasm | tr -d ' ') B wasm, $VERSION)" diff --git a/web/emu/index.html b/web/emu/index.html index 204716d0..cb9aa2d3 100644 --- a/web/emu/index.html +++ b/web/emu/index.html @@ -66,6 +66,8 @@ a { color: inherit; } .start p { margin: 0; max-width: 32em; text-align: center; color: #fff; } .keys, footer { margin: 16px 0 0; color: var(--dim); text-align: center; } .keys span { white-space: nowrap; margin: 0 8px; } +#sample-bank-controls span { display:block; white-space:normal; margin-top:8px; } +#sample-bank-controls select { max-width:100%; font:inherit; } kbd { font: 600 11px ui-monospace, Menlo, monospace; border: 1px solid var(--rule); padding: 0 4px; color: var(--fg); } footer { margin-top: 12px; font-size: 12px; } footer nav a { margin: 0 6px; } @@ -80,6 +82,12 @@ footer small { font-size: 11px; opacity: .8; }
Z–' Q–O keys 1–= FX … REC @@ -101,6 +109,7 @@ footer small { font-size: 11px; opacity: .8; }