Skip to main content

A computer-assisted composition framework that manages the flow of musical time, plays back notes via SoundFonts, MIDI or OSC, and quantizes and saves the result to music notation.

Project description

SCAMP (Suite for Computer-Assisted Music in Python)

SCAMP is an computer-assisted composition framework in Python designed to act as a hub, flexibly connecting the composer-programmer to a wide variety of resources for playback and notation. SCAMP allows the user to manage the flow of musical time, play notes either using FluidSynth or via MIDI or OSC messages to an external synthesizer, and ultimately quantize and export the result to music notation in the form of MusicXML or Lilypond. Overall, the framework aims to address pervasive technical challenges while imposing as little as possible on the aesthetic choices of the composer-programmer.

Features

  • Flexible and extensible playback: Although SCAMP comes with a basic general MIDI soundfont, any .sf2 or .sf3 soundfont can be used, and playback can also include MIDI or OSC messages to external programs or synthesizers, which effectively offers limitless sonic possibilities.

  • Note-based, but in a broad sense: Although SCAMP conceives of music in terms of notes, notes in SCAMP are extremely flexible sound-objects that can include the continuous evolution of arbitrary playback parameters.

  • Effortless microtonality: to play the G above middle C 30 cents sharp, the user has only to use the MIDI pitch 67.3. Behind the scenes, SCAMP manages all the MIDI pitchbend messages, placing notes on separate channels where necessary so that these messages do not conflict.

  • Effortless playback of glissandi and dynamic envelopes. Both pitch and volume can follow arbitrary curves defined using the expenvelope package.

  • Flexible and precise polyphonic tempo control using clockblocks. In SCAMP, different layers of music moving at different tempi can be interwoven with one another while remaining coordinated. Smooth accelerandi and ritardandi are possible, and the resulting music can be quantized according to the tempo of any layer.

  • Sensible and flexible quantization. The user has a fine degree of control over how rhythms are quantized and over the degree of complexity in the resulting notation.

Philosophy

Compositional tools always feature some degree of trade-off between functionality and freedom; every feature that is made available to the user steers them in a certain direction. For instance, if a framework provides abstractions for manipulating harmonies, the user may find themselves (perhaps unconsciously) pushed in the direction of a particular harmonic language. While this may be a worthwhile trade-off in many cases, it is not the goal of SCAMP. Here, the goal is to provide general purpose tools, to remove the drudgery of implementing practical functionality that is needed again and again. Beyond this scope, users are encouraged to write and share their own extensions to suit their own compositional inclinations. (Several such extensions are available in the scamp_extensions package.)

Other key values underlying this framework are:

  • Playback first, notation second: SCAMP has been designed so that the user interacts with an ensemble, not a score. This way, ideas can be quickly auditioned and iterated over based on the sonic result. Once the result is deemed satisfactory, the user can then export it as music notation.
  • Compact and expressive code: Efforts have been made to make user code simple, yet powerful. One of the ways this is accomplished is through sensible defaults; although there is a lot of functionality under the hood, it shouldn't be encountered by the user until it is needed.
  • Modularity and adherence as much as possible to the Unix Philosophy. SCAMP bundles a number of tools together for convenience, but it may be more than a given user needs. For this reason, the MusicXML export capability is available separately as pymusicxml, the flexible musical Envelope class is available separately as expenvelope, and the system for managing musical time is available separately as clockblocks.

Installation & Requirements

SCAMP requires Python 3.12 or greater. With Python installed, opening a terminal and running:

pip install scamp

is usually all you need. 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 with no separate install step.

To pull in the optional extras (LilyPond export, MIDI input/output, keyboard/mouse input) in one go:

pip install "scamp[all]"

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

Test the installation by:

  1. Opening a terminal and typing python to start an interactive python session.
  2. Typing in from scamp import test_run; test_run.play() and pressing return.

If you hear a piano gesture sweeping inward towards middle C, SCAMP has installed correctly!

Optional dependencies, individually

You don't need any of these for a basic install — they only matter if you want the corresponding feature.

python-rtmidi — needed for MIDI input and for generating an outgoing MIDI stream (e.g. into a DAW). On Linux, if pip install python-rtmidi fails, you may first need the Python development headers: sudo apt install python3-dev. See the python-rtmidi installation instructions for details.

abjad + LilyPond — needed for LilyPond output. SCAMP pins to abjad==3.31; newer abjad releases sometimes break compatibility, so prefer pip install "scamp[all]" (which uses the pinned version) over pip install abjad. After installing abjad, also download and install LilyPond, which abjad calls out to.

pynput — needed for the keyboard/mouse input helpers in scamp.utilities.

Building FluidSynth from source (Linux, advanced)

Linux wheels include a bundled FluidSynth, but if you have FluidSynth installed system-wide (e.g. sudo apt install fluidsynth), SCAMP will prefer that copy. This is useful if you want SCAMP to share a FluidSynth build with the rest of your system, or you're running on a distro the wheels weren't built for.

Installing scamp_extensions

The scamp_extensions package is the place for models of music-theoretical concepts (e.g. scales, pitch-class sets), additional conveniences for interacting with various types of input and output, and in general anything that builds upon SCAMP but is outside the scope of the main framework.

pip install scamp_extensions

To install the latest development version directly from GitHub:

pip install git+https://github.com/MarcTheSpark/scamp_extensions

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scamp-0.10.0.tar.gz (10.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

scamp-0.10.0-py3-none-win_amd64.whl (13.2 MB view details)

Uploaded Python 3Windows x86-64

scamp-0.10.0-py3-none-manylinux_2_34_x86_64.whl (15.3 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

scamp-0.10.0-py3-none-manylinux_2_34_aarch64.whl (15.0 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ ARM64

scamp-0.10.0-py3-none-macosx_14_0_arm64.whl (13.2 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

scamp-0.10.0-py3-none-macosx_12_0_x86_64.whl (14.1 MB view details)

Uploaded Python 3macOS 12.0+ x86-64

File details

Details for the file scamp-0.10.0.tar.gz.

File metadata

  • Download URL: scamp-0.10.0.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for scamp-0.10.0.tar.gz
Algorithm Hash digest
SHA256 1c7f95bab81b974ed493321dab37e87648f9c90a91ab72edb9727a310462121a
MD5 dec9de8d43bbbbbdcd4bba7bbeef0d4c
BLAKE2b-256 58858da0e498a710de1cbdb06afe4795ecf47ae4d3be81b6781c4800cadf4b33

See more details on using hashes here.

File details

Details for the file scamp-0.10.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: scamp-0.10.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for scamp-0.10.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e37a9cbf22a9fc4efd3747305451053922c36a93067be54167b37142123a4637
MD5 03c5fccc23da14f88185c687fc2bba59
BLAKE2b-256 8dacb1b939cf5f622f3f7243ac7bc0c1f00bebed18b9e5ad8e7972162791ec7f

See more details on using hashes here.

File details

Details for the file scamp-0.10.0-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for scamp-0.10.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0b739d78ac80d27db462991fd0d1ac768ec58c95c13a0740e9ff6a0f5bfeb860
MD5 fa19bac61f1bf2df29149cb26fda1d6d
BLAKE2b-256 b8a1ce866a175144a24c528d6544d073474b42b41dfdad6e71bea1acfbf12ffc

See more details on using hashes here.

File details

Details for the file scamp-0.10.0-py3-none-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for scamp-0.10.0-py3-none-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 12ecf39cee01451ef85f1569dba9894fcaa5414521392613abd8c16c3bb89d0b
MD5 2e1314f37ed460543b5d7939228c1968
BLAKE2b-256 b77332441f70f7d00834fcbf189ae69726b20415a75efbbf32e93a1189094a48

See more details on using hashes here.

File details

Details for the file scamp-0.10.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for scamp-0.10.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a9e6cb5e15c2bb91b1348d37c869868ffd567fa3450433819fd0cdbc1e119d45
MD5 c5b2f25463d93c21fcfbffe592a043de
BLAKE2b-256 c7ab6fb61c0fdac8b6be243d6c5d5dbdfed48cd2e5ff1f269d88663a04d207d9

See more details on using hashes here.

File details

Details for the file scamp-0.10.0-py3-none-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for scamp-0.10.0-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 f05548295c93bd0cd5a4a65e7966fda8cac408bc966287146525d1cfc12993ac
MD5 40d66aa4794fc7f9f4c3ef57cb788de2
BLAKE2b-256 70a308f42a3782bcb24405c76da03adcbe4f2954acb2f03c0e172858740a33b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page