Setup for Experienced Python Users

Basic Installation

SCAMP requires Python 3.12 or greater. If you’re already familiar with Python and you know how to install packages using pip, installing SCAMP is a one-liner:

pip install scamp

The prebuilt wheels on PyPI bundle the FluidSynth library for Linux, macOS (both Intel and Apple Silicon), and Windows, so soundfont playback works out of the box on all three platforms — no separate FluidSynth install is required.

To pull in the optional extras (LilyPond export, MIDI I/O, keyboard/mouse input) all at once:

pip install "scamp[all]"

This installs abjad==3.31 (pinned for compatibility), python-rtmidi, and pynput.

A note about FluidSynth

The way that SCAMP plays notes out of the box is through a free and open source library called FluidSynth, which renders sound from short recordings of individual notes stored in soundfonts (.sf2 files). You usually shouldn’t need to think about it — the bundled FluidSynth that ships with the SCAMP wheels is enough on all supported platforms. It’s worth knowing the mechanism, though, in case you want to swap in a system copy (especially on Linux, where a package-managed FluidSynth is often better integrated with the host audio stack — JACK, PipeWire, PulseAudio routing, etc.).

Two playback_settings flags govern what gets loaded:

  • try_system_fluidsynth_first — if True, SCAMP tries to dlopen the system libfluidsynth first and falls back to the bundled binary if that fails. Defaults to True on Linux and False on Mac/Windows. Set it to True on any platform if you’ve installed FluidSynth yourself (e.g. brew install fluid-synth, sudo apt install fluidsynth) and want SCAMP to use it.

  • use_bundled_pyfluidsynth — if True (the default everywhere), SCAMP uses its own copy of the pyfluidsynth Python wrapper, which can dlopen either the system or bundled libfluidsynth. Set to False to use a separately pip installed pyfluidsynth instead.

You can change either of these via PlaybackSettings and persist with save_to_json(). To inspect what actually got loaded in the current process, see the testing section below.

Testing the install

To make sure that everything is working correctly, you can run the following short script:

from scamp import test_run, print_dependency_status

print_dependency_status()
test_run.play(show_lilypond=True)

Ideally, you should see a bunch of checkmarks and hear a short piano gesture sweeping inward toward middle C.

print_dependency_status() prints a one-line-per-dependency report covering FluidSynth (with the wrapper and the resolved libfluidsynth binary path, so you can confirm whether the system or bundled copy got loaded), sf2utils, python-osc, python-rtmidi, pynput, and abjad (with installed-vs-tested-version comparison). States are ok / warn / missing. If you’re excessively nerdy and would rather consume the data programmatically, dependency_status() returns the same information as a list of (name, state, detail) tuples.

test_run.play() plays the aforementioned piano gesture; with show_lilypond=True it also exercises the abjad → LilyPond → PDF path to display notation.