scamp package

SCAMP: A 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.



Module containing user-facing playback classes: Ensemble, ScampInstrument, and NoteHandle/ ChordHandle


Module containing the PerformanceNote, PerformancePart, and Performance classes, which represent transcriptions of notes played by a group of ScampInstrument objects.


Module containing classes for defining adjustments to the playback of note parameters, as well as the PlaybackAdjustmentsDictionary, which defines how particular notations should be played back.


Module containing the abstract base class PlaybackImplementation, as well as several of its concrete subclasses: SoundfontPlaybackImplementation, MidiPlaybackImplementations, and OSCPlaybackImplementation.


Module containing classes and functions related to the quantization of performances.


Module containing classes that deal with music notation.


Module containing the Session class, which is the central hub through which nearly all of SCAMP’s functionality flows.


Module containing the main settings classes: PlaybackSettings, QuantizationSettings, and EngravingSettings, as well as TempoSettings and GlissandiSettings, which are part of EngravingSettings.


Module containing the SpellingPolicy class, which describes how pitches should be spelled.


Simple module with a play() function that can be used to verify that SCAMP is installed successfully.


Module containing utilities for representing text in SCAMP, currently containing the StaffText class.


Module containing the Transcriber class which records the playback of a group of ScampInstrument objects to create a Performance


Various and sundry utility functions used by SCAMP.

Public-Facing API (result of import *):

Clock(name, parent, initial_rate, …)

Recursively nestable clock class.

MetricPhaseTarget(phase_or_phases, …)

Class representing a particular point in a (beat or measure) cycle.

TempoEnvelope(initial_rate_or_segments, …)

A subclass of Envelope that is specifically designed for representing changing tempo curves.


Get the Clock active on the current thread (or None if none is active)

fork(process_function[, args, kwargs, name, …])

Spawns a parallel process running on a child clock of the currently active clock.

fork_unsynchronized(process_function[, …])

Spawns a parallel process, but as an asynchronous thread, not on a child clock.

wait(dt[, units])

Calls wait() on the clock that is currently active on the thread.


Calls wait_for_children_to_finish() on the clock that is currently active on the thread; generally, this is called when there are child clocks running and we want to keep the main script alive while the action takes place on the child clocks.


Calls wait_forever() on the clock that is currently active on the thread; generally, this is called when there are child clocks running and we want to keep the main script alive while the action takes place on the child clocks.


Class representing a piece-wise exponential function.

EnvelopeSegment(start_time, end_time, …)

A segment of an envelope, with the ability to perform interpolation and integration.


Probes the available devices for midi input or output


Probes the available devices for midi input or output


Get the port number of a given device based on its a fuzzy string match of its name.


Prints a list of available ports and devices for midi input or output


Prints a list of available ports and devices for midi input or output

ChordHandle(note_handles, intervals)

This handle, returned by instrument.start_chord, allows us to manipulate a chord that we have started, (i.e.

Ensemble(default_soundfont, …)

Host for multiple ScampInstrument objects, keeping shared resources, and shared default settings.

NoteHandle(note_id, instrument)

This handle, which is returned by instrument.start_note, allows us to manipulate the note that we have started, (i.e.

ScampInstrument(name, ensemble, …[, …])

Instrument class that does the playing of the notes.

Performance(parts, tempo_envelope)

Representation of note playback events, usually a transcription of the notes played by an Ensemble.

PerformancePart(instrument, name, voices, …)

Transcription of the notes played by a single ScampInstrument.

NotePlaybackAdjustment(pitch_adjustment, …)

Represents an adjustment to the pitch, volume and/or length of the playback of a single note

ParamPlaybackAdjustment(multiply, add)

Represents a multiply/add playback adjustment to a single parameter.

PlaybackAdjustmentsDictionary(articulations, …)

Dictionary containing playback adjustments for different articulations, noteheads, and other notations.

MIDIStreamPlaybackImplementation(*args, **kwargs)

Playback implementation that sends an outgoing MIDI stream to an external synthesizer / program

OSCPlaybackImplementation(*args, **kwargs)

Playback implementation that sends outgoing OSC messages to an external synthesizer / program

PlaybackImplementation(*args, **kwargs)

Abstract base class for playback implementations, which do the actual work of playback, either by playing sounds or by sending messages to external synthesizers to play sounds.

SoundfontPlaybackImplementation(*args, **kwargs)

Playback implementation that does Soundfont playback, via the MIDI protocol.

BeatQuantizationScheme(length, divisors, …)

Scheme for making a decision about which divisor to use to quantize a beat

MeasureQuantizationScheme(beat_schemes, …)

Scheme for quantizing a measure, including beat lengths and which beat divisors to allow.

QuantizationScheme(measure_schemes, loop)

Scheme for quantizing a PerformancePart or Performance

TimeSignature(numerator, Sequence[int]], …)

Class representing the time signature of a measure

Measure(voices, time_signature, …)

Representation of a single measure within in a Staff

NoteLike(pitch, float, Tuple]], …)

Represents a note, chord, or rest that can be notated without ties

Score(parts, StaffGroup]] = None, title, …)

Representation of a score in traditional western notation.

Staff(measures, name)

Representation of a single staff of a western-notated score

StaffGroup(staves, name, clef_choices, …)

Representation of a StaffGroup (used for the multiple staves of a single instrument)

Tuplet(tuplet_divisions, normal_divisions, …)

Representation of a Tuplet object within a single voice of music.

Voice(contents, NoteLike]], time_signature)

Representation of a single voice within a single measure of a single staff of music.

Session(tempo, default_soundfont, …[, …])

A Session combines the functionality of a master Clock, an Ensemble, and a Transcriber.


Instance of EngravingSettings containing the actual engraving defaults to be consulted


Instance of PlaybackSettings containing the actual playback defaults to be consulted


Instance of QuantizationSettings containing the actual quantization defaults to be consulted

SpellingPolicy(step_alteration_pairs, …)

Object that translates pitches or pitch classes to the actual spelling used in a score

StaffText(text, italic, bold, placement)

Represents text that will be attached to the staff at a given note.


Class responsible for transcribing notes played by instruments into a Performance.