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

On a properly configured computer, installing SCAMP is as simple as opening a terminal and running:

pip3 install --user scamp

(This installs it for a single user. To install it for all users on a computer, use sudo pip3 install scamp and enter your administrator password.)

Properly configuring your computer involves:

  1. Installing Python 3.6 or greater
  2. (Linux only) Installing FluidSynth
  3. (Optional) Installing python-rtmidi
  4. (Optional) Installing abjad and LilyPond

Each of these steps is described in greater detail below. After configuring the computer and running pip3 install --user scamp, you should be able to test the installation by:

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

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

1) Installing Python 3.10 or greater

Mac

You can download and install Python 3 here: https://www.python.org/downloads/. After installation, open up a terminal and type:

python3 --version

You should be greeted with "Python 3.10" or something similar in response. If so, you're all set! If you get something like "command not found" instead, it's likely that something went wrong in the process of installation.

Windows

As on a Mac, you can download and install Python 3 here: https://www.python.org/downloads/. In the installer, be sure to select "Add Python 3.10 to PATH". This allows you to invoke python from the Command Prompt by typing either python or py, and this should also default to the latest version of python. Test that all went according to plan by typing:

python --version

You should be greeted with "Python 3.10" or something similar in response. If so, you're all set! For all other installation instructions below, use python instead of python3 and pip instead of pip3.

Linux

On Linux, Python 3.10 or greater is often already installed by default. Again, you can check this by opening a terminal and running:

python3 --version

If your version of python is already 3.10 or greater, you're good to go. However, if your version of Python 3 is less than 3.10, you will have to install python 3.10 or higher, e.g. from a third party PPA.

2) (Linux only) Installing FluidSynth

SCAMP requires FluidSynth for soundfont playback, but on both Mac and Windows — due to the lack of a default package manager — it became clear that the path of least resistance was to include the compiled FluidSynth library within the SCAMP package. For this reason, you don't need to take the step of installing FluidSynth to use SCAMP on Mac or Windows.

Since Linux distros have package managers, it makes more sense to have users take the extra step to install FluidSynth that way. On apt-based distros like Debian and Ubuntu, it's as simple as running:

sudo apt install fluidsynth

You are now the proud owner of a FluidSynthesizer!

3) (Optional) Installing python-rtmidi

For midi input, and also to generate an outgoing midi stream (which could, for instance, be routed to a DAW), you will need the python-rtmidi library. You can get this by running from a terminal:

pip3 install --user python-rtmidi

On Linux, if you're running into an error you may need to first install the python3-dev package, for instance with the command:

sudo apt install python3-dev

For any other python-rtmidi installation woes, take a look at the installation instructions here.

4) (Optional) Installing abjad and LilyPond

For LilyPond output, you will need the abjad library. To do so, run the following:

pip3 install abjad

Note that abjad sometimes changes in a way that breaks compatibility with SCAMP. If you are using a version of abjad that is more recent than the one SCAMP was tested with, a warning will indicate this fact when you try to use it to generate notation.

After installing abjad, you will also need to download and install LilyPond, since it is a dependency of abjad.

5) (Optional) 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 of the scope of the main framework.

The easiest way to install scamp_extensions is by running the command:

pip3 install --user scamp_extensions

To install the most up-to-date version (assuming you have git installed), you can instead run:

pip3 install --user git+https://git.sr.ht/~marcevanstein/scamp_extensions

This will install the latest version from this repository.

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.9.3.2a0.tar.gz (197.9 kB view details)

Uploaded Source

Built Distributions

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

scamp-0.9.3.2a0-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

scamp-0.9.3.2a0-py3-none-manylinux_2_28_x86_64.whl (9.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

scamp-0.9.3.2a0-py3-none-manylinux_2_28_aarch64.whl (9.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

scamp-0.9.3.2a0-py3-none-macosx_14_0_arm64.whl (2.7 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

scamp-0.9.3.2a0-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.9.3.2a0.tar.gz.

File metadata

  • Download URL: scamp-0.9.3.2a0.tar.gz
  • Upload date:
  • Size: 197.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for scamp-0.9.3.2a0.tar.gz
Algorithm Hash digest
SHA256 c891b6f9ba9e0a1dffbd7b1bb4c5aa4b8ae37248ce25224c7bd23234b718bf97
MD5 9f65bfb520388e8800ba1182335140c6
BLAKE2b-256 695db02a89da2dbd0b4309d066bef41ff0aac2a706ca84e6bbca3465600e395a

See more details on using hashes here.

File details

Details for the file scamp-0.9.3.2a0-py3-none-win_amd64.whl.

File metadata

  • Download URL: scamp-0.9.3.2a0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.7 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.9.3.2a0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 08bed9a5301a1b9e5b33c1ccf6bca0843a3d970f456e139536ab5aad9fba884c
MD5 802b359f8696f0ccd90a47691a1a4f31
BLAKE2b-256 4fbfe8c260f3f980d534e1c5a3289334c297177d82866292577dc69213d28d5d

See more details on using hashes here.

File details

Details for the file scamp-0.9.3.2a0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scamp-0.9.3.2a0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 613f7e3d934eda92825cc9ee7d0af45d36cfc1e02ba2d643ba2771ea340e5400
MD5 39ffa94b166b98e43da6e2dc19e88d70
BLAKE2b-256 183c9cfb2c2d511cc1998ff1ed351b3f1f2618f7cdc8a91197cd20f635c412fa

See more details on using hashes here.

File details

Details for the file scamp-0.9.3.2a0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scamp-0.9.3.2a0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 10734bb7d6be36abb7162db1ec8d54b77a258eadab9febb43f092ca9a79f07de
MD5 49046aa495c56ad46bc50693a5c1a937
BLAKE2b-256 012ef6bba262ee979e534a14fa70c9751841307f1930bd0bff63c909e21ac16c

See more details on using hashes here.

File details

Details for the file scamp-0.9.3.2a0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for scamp-0.9.3.2a0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3907f3d7d62fe06e92cd7138d3234ec3c6e6fbcd4cfff7c42c89915d0aaa7f40
MD5 f2f654b541a4429ecf4f63881c5fdb88
BLAKE2b-256 25967f3aae934d2b6cd43f0796ea8c3fb520e762a8f4f5ed7594289bf438c689

See more details on using hashes here.

File details

Details for the file scamp-0.9.3.2a0-py3-none-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for scamp-0.9.3.2a0-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d0a3702824289cc85d607809436b0abfb1e2985bc004e33f29ced25e1233d9b2
MD5 4d63ead3191402e17c6d04ab751bdc83
BLAKE2b-256 90d088d171a3f9d3922baccc667dff44e15b2820c4f1a5b2b32e83cda8e94ade

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