Development
Requirements
-
Python 3 with
numpyandPillow: they generate the sounds, font, logo and website. - Docker: builds and runs the tests (GCC) and the emulator (Emscripten). No local compiler needed.
On Windows the Python command is py -3; on Linux and macOS, python3.
Commands
py -3 tools/build.py assets # font, kits, waves, factory loops and logo (core/gen/)
py -3 tools/build.py test # builds and runs the PC tests; screenshots in assets/screens/
py -3 tools/build.py web # emulator: web/bm.js
py -3 tools/build.py site # website documentation pages: web/docs/ and web/en/docs/
py -3 tools/build.py all # all of the above
The tests (tests/test_core.c) go through the firmware the way a person would: boot, press buttons, record, save, power off and on again. They also check sequencer timing, the screen budget and that the flash is never written while playing.
Layout
core/ the firmware, C99 with no hardware: audio, sequencer, interface and storage
core/gen/ data generated by tools/: font, kits, waves, loops and logo
hal/ hardware layers: sim (PC and web), web (WebAssembly) and fm1 (port)
web/ website: home page, emulator (emulador.html) and docs (docs/, en/)
docs/ manual, spec, design and guides (source of the website); docs/en/ in English
tests/ automated tests
tools/ generators and build
assets/ logo, screenshots, factory loops
Core rules
-
core/knows nothing about the hardware: everything goes through the platform (bm_platform) eachhal/provides. -
No
malloc. The FM-1 has 96 KiB of RAM; the budget is inMEMORIA.md(Spanish). - Audio runs in its own context: the interface only talks to it through the command queue.
- The flash is only written with the transport stopped: writing pauses the audio.
Sounds and factory loops
-
Kits and waves are synthesized in
tools/gen_assets.py. -
Factory loops are defined in
assets/loops/loops.jsonand synthesized intools/gen_loops.py. -
To test with your own audio, create
assets/loops/loops.local.json(it is in.gitignore) and generate with:
py -3 tools/gen_loops.py --local
A build made with --local must not be published: neither web/bm.js nor binaries. Before pushing, generate again without --local.
Screen languages
The firmware speaks English. Each language is a pack (.bmlang) in its own flash zone; the format is in core/bm_lang.h.
-
Translated when drawn:
gfx_textandgfx_smalllook up each phrase in the active pack (by the hash of the English phrase). With English active it costs nothing. -
Formats: whatever goes through
snprintfis marked withTF("...")(if the translation does not have the same%, English is used) and words joined with%sgo inT(...). -
py -3 tools/gen_lang.pycollects the phrases ofcore/intolang/plantilla.txt, checkslang/<code>.txt(ASCII only, the same%, phrases that exist) and buildslang/<code>.bmlangandweb/lang/(for the emulator).build.py testandbuild.py webrun it.lang/ignorar.txtlists code strings that are not screen text. -
On the FM-1 it is loaded with
py -3 tools/fm1/idioma.py lang/es.bmlang(console command0x21).
The website
-
web/index.htmlis the Spanish home page,web/en/index.htmlthe English one, andweb/emulador.htmlthe emulator (both languages). -
The pages in
web/docs/andweb/en/docs/are generated from the.mdfiles bytools/gen_site.py: edit the.md, not the HTML. English sources live indocs/en/. -
GitHub Pages publishes the
web/folder through.github/workflows/pages.yml.
Branches
| Branch | For |
|---|---|
dev | Day-to-day work. Pull requests go here |
qa | What is about to be released, under test: emulator and, once it exists, the FM-1 |
main | What is released. Every version comes from here and the website is published from here |
Changes move one way only: dev › qa › main.
Continuous integration
.github/workflows/ci.yml runs the tests on every push and every pull request.
Versions
-
The version number lives in
core/bm_config.h(BM_VERSION_STR) and in the changelog. -
Every public version is a
vX.Y.Ztag with its source code. The GPL requires that any published binary comes with its corresponding source.
This page is generated from docs/en/DEVELOPMENT.md. Spotted a mistake? Edit the file and send a pull request.