The hako command
tools/bin/hako is the computer's side: Linux, Python 3 with numpy, ALSA. It finds the unit as
the ALSA card ELZ_1; --dev /dev/snd/midiCxDy names another port. hako COMMAND --help says
more about each.
Building
hako pack APP.out APP.BIN [--lz4] | an app's ELF as an app file (--lz4: half the size, for the disk) |
hako image loader.out ELZ_1.BIN | the loader as the update file SYSTEM UPDATE flashes |
hako check ELF... | an app calls nothing outside itself |
On the unit
hako run APP.BIN | run an app from RAM; nothing is written |
hako install FILE --as NAME.APP | write an app into its own folder, NAME/NAME.APP |
hako install FILE --as NAME/SUB/FILE.EXT | write a file into an app's folder |
hako open NAME | start NAME.APP from the disk, as if picked in the menu |
hako stock FILE | check your Sonicware firmware (the zip or its ELZ_1.bin) and write it to STOCK/ for the STOCK app |
hako stock | with the unit's disk mounted: move the ELZ_1.bin a Sonicware update left in its root into STOCK/ |
hako setup [DISK] | from the boot menu's USB MSC: keep Sonicware's ELZ_1.bin in STOCK/, put Hako on; then SYSTEM UPDATE |
hako uninstall [DISK] | from the boot menu's USB MSC: Sonicware's ELZ_1.bin back in the root; then SYSTEM UPDATE |
hako menu | back to the launcher's menu |
hako recover | after a reset: wait for the unit and get to the menu |
hako disk unit|computer | who writes the unit's disk |
hako hello | which app is running, and its build |
hako screen text|shot|video|crc | the console's rows, a screenshot, a video, a checksum |
hako press NAME, hako key N, hako turn ENC N | press a button (OK, MENU, A+B), a key (0-39), turn an encoder |
hako watch | the unit's control events as they happen |
install and open refuse while the computer has the unit's disk mounted: eject it first.
In a browser instead: tools/web/sendapp.html, served on localhost and opened in Chrome or
Edge (Web MIDI), runs and installs apps from any computer.
Tests and measurements
hako test SCRIPT... | test scripts (Python, hako.testing): the last line says ALL PASS |
hako film SCRIPT OUT.mp4 [--use 1,2] | a test filmed: the screen, the sound, the steps as subtitles |
hako listen --use 1,2 | record the unit's line out through an audio interface: level, pitch, pulses; --dropouts |
hako play WAV or --tone HZ | play into the unit's AUX IN |
hako clock lead|measure | the other end of the unit's MIDI clock: send it, or time it |
The audio interface is named by --device or HAKO_AUDIO (arecord -L lists them), and how
many channels it opens with by --channels or HAKO_AUDIO_CHANNELS. Many interfaces open only
with all their inputs; listen and film keep only those named with --use, in memory, and
drop the rest before anything is written, so a microphone on another input is never recorded.
A shared unit
HAKO_LOCK=/path/to/module.py:NAME makes every command take turns: the module has
claim(name, wait=seconds), called when a port is opened, and touch(name), called as messages
are sent. HAKO_LOCK_WAIT is how long to wait in line (30 minutes by default).
As a library
tools/ on sys.path, then from hako import unit, lab, testing: the SysEx protocol and the
port (unit.Port, unit.launcher, unit.send), lab mode (lab.press, lab.rows,
lab.shot, lab.Video), and the test helper.