Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ The FM-1 runs a JieLi AC791N. The emulator is forgiving, the chip is not; the bu
| ------------- | ------------------------------------------------------------------------------------ |
| `./fm1 dev` | build, serve on http://localhost:8000 (`PORT=9000 ./fm1 dev`), rebuild on every save |
| `./fm1 build` | `build/web/` (the site) and `build/NAME-VERSION.fwsc` (the package) |
| `./fm1 flash` | install the build on the FM-1 over USB, as the page's Install does (below) |
| `./fm1 fmt` | format: clang-format (C), prettier (web), ruff (python) |
| `./fm1 shell` | a shell in the toolchain container |
| `./fm1 image` | build the toolchain image from the `Dockerfile` here, instead of pulling it |

`./fm1 flash` runs on your computer, not in Docker (Docker on a Mac can't reach USB), and needs only `python3`
(CoreMIDI on macOS, ALSA on Linux; not on Windows yet: use the page). `./fm1 flash` installs `build/web/firmware.fwsc`,
`./fm1 flash FILE.fwsc` any package, `./fm1 flash --id` says what the FM-1 runs (`FM-1_000`: the USB rescue). Quit
other apps that use the FM-1's MIDI port first. If an install is cut off, run it again: it finishes it.

Windows: `fm1.cmd dev` (Docker Desktop). Without the script:
`docker run --rm -it --platform linux/amd64 -p 8000:8000 -v "$PWD:/work" konsumer/foma-toolchain python3 tools/build.py --dev 8000`.

Expand Down
10 changes: 8 additions & 2 deletions fm1
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
# foma: everything runs in Docker, nothing else to install.
# foma: everything runs in Docker, nothing else to install (flash runs on this computer: it needs USB).
# ./fm1 new NAME make this copy your own firmware (once): ./fm1 new "MY SYNTH" [--repo URL]
# ./fm1 dev build, serve the emulator + installer on http://localhost:8000, rebuild on save
# ./fm1 build build/web (the site) and build/NAME-VERSION.fwsc (the FM-1 package)
# ./fm1 fmt format the code (clang-format, prettier, ruff)
# ./fm1 shell a shell in the toolchain container
# ./fm1 image build the toolchain image here (instead of pulling it)
# ./fm1 flash install build/web/firmware.fwsc on the FM-1 over USB: ./fm1 flash [bt | FILE.fwsc | --id]
# ./fm1 clean remove build/
set -e
cd "$(dirname "$0")"
Expand Down Expand Up @@ -37,6 +38,11 @@ case "${1:-build}" in
fmt) run sh -c 'clang-format -i src/*.c platform/*.c platform/*.h && npx -y prettier -w "web/*.{html,js,css}" "*.json" && ruff format tools' ;;
shell) run bash ;;
image) image ;;
flash)
shift
command -v python3 >/dev/null || { echo "fm1: flash needs python3 on this computer"; exit 1; }
exec python3 tools/flash.py "$@"
;;
clean) rm -rf build ;;
*) sed -n '2,9p' "$0" | sed 's/^# \{0,1\}//'; exit 1 ;;
*) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 1 ;;
esac
1 change: 1 addition & 0 deletions fm1.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set IMAGE=konsumer/foma-toolchain
if "%PORT%"=="" set PORT=8000
set CMD=%1
if "%CMD%"=="" set CMD=build
if "%CMD%"=="flash" echo fm1 flash: macOS and Linux only for now. On Windows, install from the page: fm1 dev, then its Install tab & goto :eof
docker image inspect %IMAGE% >nul 2>&1 || docker pull --platform linux/amd64 %IMAGE% || docker build --platform linux/amd64 -t %IMAGE% .
if "%CMD%"=="image" docker build --platform linux/amd64 -t %IMAGE% . & goto :eof
if "%CMD%"=="build" docker run --rm --init -it --platform linux/amd64 -v "%CD%:/work" %IMAGE% python3 tools/build.py & goto :eof
Expand Down
Loading
Loading