Installation and runtime¶
Run these commands from a checkout of the repository. Python 3.10 or newer is required for Submediant; use Python 3.12 when building this documentation.
Local Python environment¶
Create and activate a virtual environment before installing the package:
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
python -m submediant --help
The base installation includes NumPy, SciPy, and pyiv. Audio rendering to WAV
does not require Pillow or FFmpeg. Keep generated audio, video, and reports
under the ignored build/ directory.
Video rendering¶
Install Pillow through the video extra:
python -m pip install -e '.[video]'
Install FFmpeg separately in the environment that runs Python. On macOS with Homebrew:
brew install ffmpeg
On Debian or Ubuntu:
sudo apt-get update
sudo apt-get install ffmpeg fonts-dejavu-core
Check that Python can find the executable, then inspect its encoders:
python -c "import shutil; print(shutil.which('ffmpeg'))"
ffmpeg -hide_banner -encoders
The first command must print an executable path rather than None. Full-song
video requires both libx264 and alac encoders. Submediant invokes the
executable named ffmpeg through PATH; installing the video extra alone does
not supply it.
For example, render an excerpt from the distributable fixture:
mkdir -p build
gzip -dc tests/fixtures/black-canal.sequence.json.gz > build/black-canal.json
python -m submediant video build/black-canal.json build/black-canal.mp4 --duration 2
The historical macOS full-song validation used a local FFmpeg binary supplied
by imageio-ffmpeg. That package is outside Submediant’s declared dependencies,
and Submediant does not automatically discover its bundled binary. An existing
bundled binary must be exposed as ffmpeg on PATH, or replaced by a separate
FFmpeg installation.
Research and tests¶
Reference-audio analysis uses the optional research extra:
python -m pip install -e '.[research]'
For the test environment used by CI, install both extras and make FFmpeg available before running the suite:
python -m pip install -e '.[video,research]'
python -m unittest discover -s tests -v
Docker and CI¶
The current repository provides no Dockerfile, Compose service, or container
launcher. The documented runtime uses a local Python virtual environment.
The inherited Docker workflow guidance and .dockerignore do not supply a
container runtime for Submediant.
The full Python conformance workflow runs on a GitHub-hosted macOS ARM64 runner
with the qualified numerical environment described below. The documentation
workflow remains on Ubuntu and uses Python 3.12 and .[docs] to
build Sphinx HTML and render the component gallery with Pillow. It does not
need FFmpeg or the video extra.
Qualified numerical conformance¶
The complete test suite includes exact little-endian float64 response hashes.
The current qualified environment is macOS ARM64, Python 3.13.18,
NumPy 2.5.5, and SciPy 1.18.1. The workflow records and checks that environment
before running every test; ci/numerical-constraints.txt pins the numerical
dependencies. FFmpeg is available through Homebrew on the runner.
The job uses uv 0.13.9 to provision Python 3.13.18; GitHub’s setup-python
distribution does not provide that patch version for the selected ARM64 runner.
For the same local conformance environment, select Python 3.13.18 on macOS ARM64, make FFmpeg available, then run from the repository root. With uv, use:
uv venv --python 3.13.18 build/conformance-venv
uv pip install --python build/conformance-venv/bin/python -c ci/numerical-constraints.txt '.[video,research]'
. build/conformance-venv/bin/activate
python -m unittest discover -s tests -v
These float64 hashes qualify an environment; they do not promise byte-identical intermediate floating-point values across operating systems or architectures. Matching only NumPy and SciPy versions is insufficient. Native marimba kernel preparation enforces the accepted response hashes during rendering too: an unqualified environment can fail with a response-pin mismatch, including on Linux. This is a runtime support boundary, not just a test-suite restriction.
The broader Python installation requirement remains 3.10+ for the package’s other supported APIs. The Ubuntu documentation job independently checks the public integer-PCM playback example, the programmatic xylophone example, and the component renderer; it does not qualify native marimba on Linux. Do not replace accepted pins or disable their assertions to accommodate another environment. Portability of the native float64 profiles requires its own validation effort.
Sympathetic-resonance adapters evaluate source and body filtering on a canonical 2,048-frame timeline, then deliver the requested block sizes from that bounded window. Smaller receiver-step limits are applied inside those windows. This preserves exact samples across caller block partitions without relaxing the float64 comparisons. The adapter implementation identity is version 2; saved resonant candidates declaring the old runtime identity must be re-created from their model definitions before playback. The default 2,048-frame output is preserved, and the accepted instrument response pins are unchanged.